* @since 5.1.0 `WP_DEBUG_LOG` can be a file path. * Any of the syntaxes explained in the PHP documentation for the, * {@link https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'}, * Also see the {@link https://developer.wordpress.org/plugins/ Plugin API} for. * @return string|false|WP_Error A list of tags on success, false if there are no terms. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. wp_populate_basic_auth_from_authorization_header. * This file will contain the variable $upgrading, set to the time the file, * was created. // For taxonomies that belong only to custom post types, point to a valid archive. * did_action() returns the number of times an action has been fired during, * This function allows detection for any action currently being executed, * (regardless of whether it's the most recent action to fire, in the case of. * @return string The "second.microsecond" finished time calculation. * @global string $wp_version The WordPress version string. '/(^|\s|,)application\/([\w!#\$&-\^\.\+]+\+)?json(\+oembed)?($|\s|;|,)/i'. * @type Walker $walker Walker object to use to build the output. * WordPress offers filter hooks to allow plugins to modify. Source: wp-includes/functions.php:2782 Used by 1 function | Uses 1 function wp_get_default_extension_for_mime_type () Function: Returns first matched extension for the mime-type, as mapped from wp_get_mime_types () . * Default 'name'. Are you sure you want to create this branch? Below are some wordpress examples sorted in different categories: Blog As WordPress was created as a blogging platform the best use of WordPress is Blogging as it matured over 12 years. See wp_tag_cloud(). Default true. Accepts 0, 1, or their bool equivalents. * @return bool True if inside WordPress site administration pages. // Test to make sure the pattern matches expected. * The given tags are checked against the post's tags' term_ids, names and slugs. If the file was created less than 10 minutes ago, WordPress. * @return bool True if inside WordPress login screen, false otherwise. * @param string $hook_name The name of the filter to add the callback to. * Filters whether to enable maintenance mode. The important part is that, * the `$accepted_args` value must reflect the number of arguments the bound callback *actually*, * opted to accept. * The given terms are checked against the post's terms' term_ids, names and slugs. Default 1. * @param int|false $priority Optional. * Determines whether the current request is for a user admin screen. GitHub - githubwordpress/wp-includes Includes the named template part for a theme or if a name is specified then a specialized part will be included. You switched accounts on another tab or window. WordPress / WordPress Public master WordPress/wp-includes/load.php Go to file Cannot retrieve contributors at this time 1849 lines (1637 sloc) 50.4 KB Raw Blame <?php /** * These functions are needed to load WordPress. * @param string $before String to use before the terms. String to use after the tags. Why Use WordPress with GitHub 3. // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes". In order to run using the hook, the plugin, * will have to be included, which means that any code laying outside of a, * function will be run during the uninstallation process. * @type array $topic_count_text Nooped plural text from _n_noop() to supply to. * @param int $category Optional. * 'accepted_args' => 0, * 'function' => function() {. * Default 'name'. // From our prior conditional, one of these must be set. Code Modernization: Explicitly declare all properties in `Text_Diff_E. * @param int $priority Optional. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Docs: Increase the specificity of types in various inline documentation. * @type string $feed_type Feed type. * Retrieves the terms of the taxonomy that are attached to the post. Star Wars News The Sartorialist Playstation Blog Ebay Blog Reuters Blog Flickr Blog * @param string $file Known path to the file. You switched accounts on another tab or window. * The function current_filter() only returns the most recent filter being executed. * Set PHP error reporting based on WordPress debug settings. * Optional. * Returns whether or not an action hook is currently being processed. For example, when the, * plugin is located in wp-content/plugins/sampleplugin/sample.php, then. * @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms. // If no callback exists, look for the old-style single_text and multiple_text arguments. * Retrieve an array of must-use plugin files. * @type string $post_type The post type. * @param object $a The first object to compare. How To Update Your WordPress Plugin From GitHub in 2020. Pass an empty string. Accepts 0, 1, or their bool equivalents. Docs: Various corrections and improvements to inline docs and docblocks. * this function with a context different from the current context may give inaccurate results. See get_categories(), get_terms(), and WP_Term_Query::__construct(), * @type int|int[] $current_category ID of category, or array of IDs of categories, that should get the. Defaults to the current tag ID. * as a string or an array, depending on 'format' argument. * @return int The number of times the action hook has been fired. For example: * return apply_filters( 'wpdocs_filter', $value, $extra_arg ); * return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9.0', 'wpdocs_new_filter' ); * @param string $hook_name The name of the filter hook. Ciprian on Tuesday, March 24 . * specifying the name of the new hook using the `$hook_name` parameter. * @param string[] $plugins Array of absolute plugin main file paths. * @param callable $callback The callback to be run when the action is called. To review, open the file in an editor that reveals hidden Unicode characters. Show 10 more uses Hide more uses. Accepts any positive integer. * @param string $taxonomy Name of the taxonomy. * @since 4.4.0 Added the `$post_id` parameter. * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. * for human consumption, both localized and rounded. 0), so use the `===` operator for testing the return value. /* translators: %s: Number of items (tags). The difference is that HTML will be displayed to the user. * Filters the generated output of a tag cloud. /** This filter is documented in wp-includes/category-template.php */. * equivalents. class-wp-recovery-mode-cookie-service.php. * @param string $context The context to check for protection. * @return string|WP_Error A list of term parents on success, WP_Error or empty string on failure. WordPress will also, * display internal notices: when a deprecated WordPress function, function, * argument, or file is used. * @return string[] Filtered array of absolute paths to themes, without any paused themes. // Store list of paused themes for displaying an admin notice. * @link https://www.php.net/manual/en/function.ini-get-all.php. * False on failure. How to Find a Backdoor in a Hacked WordPress Site and Fix It - WPBeginner No warning. // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice). * @return void|string|string[] Void if 'echo' argument is true, or on failure. * @global WP_Locale $wp_locale WordPress date and time locale object. * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * @param string[] $themes Array of absolute theme directory paths. Docs: Revise comments using we in various docblocks. The plugin, when using the 'uninstall.php', * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before, * @param callable $callback The callback to run when the hook is called. Defaults to the current term ID. * Optional. * It is possible to create new action hooks by simply calling this function. Default 'category'. * @param string $sep Optional. Cannot retrieve contributors at this time. * 'DESC' (descending), or 'RAND' (random). Backdoors are the next step of a hack after the user has broken in. The plugin should not, * If the plugin can not be written without running code within the plugin, then, * the plugin should create a file named 'uninstall.php' in the base plugin, * folder. Array or string of arguments to generate a categories drop-down element. * debugging output, but rather functional nuances in WordPress. * to check against. * Default false (create select element even if no categories are found). /* translators: %s: WP_ENVIRONMENT_TYPES */, 'The %s constant is no longer supported.'. * Determines whether the current request is a WordPress cron request. * @return string[] Array of absolute paths to theme directories. The post ID. * Default empty string. * A variety of taxonomy drop-down display elements can be modified, * just prior to display via this filter. * @param array $parsed_args Arguments used to build the drop-down. * @return bool True if themes should be used, false otherwise. get_template_part() | Function | WordPress Developer Resources code snippets and examples. * of that hook is returned, or false if the function is not attached. * @param string $hook_name The name of the action hook. * @param string $hook_name The name of the action hook. * Filters a given list of themes, removing any paused themes from it. * @param bool $nicename Optional. * categories will be output separated by `
` tags. Script Loader: Add support for HTML 5 "async" and "defer" attributes. // Get relative path from plugins directory. * @global int[] $wp_actions Stores the number of times each action was triggered. * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. * @param callable|string|array|false $callback Optional. * @see do_action() This function is identical, but the arguments passed to the. Default 8 (pt). WordPress/wp-includes/category-template.php at master - GitHub * If an object-cache.php file exists in the wp-content directory. * be active unless the plugin hooks into the action. * size unit. * Determines whether we are currently handling an Ajax action that should be protected against WSODs. // If we don't have anything to pull from, return early. Docs: Document default values for optional parameters in various DocB. // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. * @global int[] $wp_filters Stores the number of times each filter was triggered. Default 1. * Checks if this site is protected by HTTP Basic Auth. get_post() wp-includes/post.php: Retrieves post data given a post ID or post object. * When the plugin consists of only one file and is (as by default) located at, * wp-content/plugins/sample.php the name of this hook will be. It is designed for, * non-web runtimes. * Filters the data used to generate the tag cloud. * Filters whether the current request should use themes. Before you install a WordPress theme or plugin from GitHub, make sure that you are able to receive updates for it. * Builds a unique string ID for a hook callback function. * @param int $post_id Optional. This is done for optimization purposes, so. * @type callable $topic_count_scale_callback Callback used to determine the tag count scaling. Accepts 0, 1, or their bool. * When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`. When a `$is_installing` is passed, the function will. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. It is designed for non-web. * that should be protected against WSODs and the theme is paused. * @since 2.7.0 The `$post` parameter was added. * @param int|WP_Post $post Post ID or object. * Finalize scraping for edited file errors. * @param string $after Optional. * // (maybe) do something with the args. * Set the database table prefix and the format specifiers for database. * Checks if the current post has any of given terms. * // Use parens for clone to accommodate PHP 4. False otherwise. Default false. * @param callable $callback The callback to be run when the filter is applied. * @return bool True if `Accepts` or `Content-Type` headers contain `text/xml`. * @type string $aria_describedby The 'id' of an element that contains descriptive text for the select. * or the post does not exist, WP_Error on failure. * @return bool True if the current post has any of the given tags. * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected. Example Plugin. * Retrieve an array of active and valid plugin files. Accepts any valid term field: 'term_id', 'name'. * @return string Category description, if available. * @type int $depth Maximum depth. // Use ORIG_PATH_INFO if there is no PATH_INFO. * To hook methods, you'll need to pass an array one of two ways. Then simply rinse and repeat for any other themes and plugins you want to download! * @return bool True if inside WordPress network administration pages. * the hook, which this function was called for. String to use between the tags. * Retrieves an array of active and valid themes. * @return bool The current 'using' setting. * 1|true for echo. Default empty. * @param string $hook_name The filter to remove callbacks from. Default false. * @see apply_filters() This function is identical, but the arguments passed to the. Editor: allow filtering block patterns by source. * Fires just before PHP shuts down execution. Accepts 'name' or 'slug'. * Currently, this is only used by Application Passwords to prevent a conflict since it also utilizes. * These functions are needed to load WordPress. * @param string $hook_name The action hook to which the function to be removed is hooked. * Adds a callback function to a filter hook. * @uses Walker_CategoryDropdown to create HTML dropdown content. * Checks whether current request is an XML request, or is expecting an XML response. * @param callable $callback The function hooked to the 'activate_PLUGIN' action. * @return bool True if the current endpoint should be protected. To review, open the file in an editor that reveals hidden Unicode characters. For example: * $value = apply_filters( 'hook', $value, $arg2, $arg3 ); * add_filter( 'hook', 'example_callback' ); // Where $priority is default 10, $accepted_args is default 1. * Determines whether the current request is a WordPress Ajax request. * @param bool $wp_doing_cron Whether the current request is a WordPress cron request. * non-web runtimes. * @param int|WP_Post $post Optional. * You can pass extra arguments to the hooks, much like you can with `apply_filters()`. * For a more powerful, list-based function, see wp_list_categories(). * This filter runs before it can be used by plugins. * must be passed here to `$args` as an array. * * that's hooked onto `example_action` above. // Assemble the data that will be used to generate the tag cloud markup. * function example_callback( $value, $arg2 ) {. // If either PHP_AUTH key is already set, do nothing. * The API callback examples reference functions, but can be methods of classes. * @param int $upgrading The timestamp set in the .maintenance file. * @type bool|int $use_desc_for_title Whether to use the category description as the title attribute. WordPress/wp-includes/class-wp-query.php at master - GitHub * @type string $show_option_all Text to display for showing all categories. Defaults to the current post. * @type string $style The style used to display the categories list. * @type string $value_field Term field that should be used to populate the 'value' attribute. Upgrade/Install: Pass the full database version string to WordPress.o. External Libraries: Update the SimplePie library to version 1.5.7. Coding Standards: Rename WordPress Dependencies API class files. Downloading and Installing WordPress Plugins and Themes From GitHub. Default empty which results in a. Default empty. * Sets the deactivation hook for a plugin. * @param int $tag Optional. * Uses three constants: `WP_DEBUG`, `WP_DEBUG_DISPLAY`, and `WP_DEBUG_LOG`. The priority number to remove them from. * @type bool|int $show_count Whether to display the tag counts. * This can be used to remove default functions attached to a specific action. * @param mixed $args Elements array, maximum hierarchical depth and optional additional arguments. * @return void|false Void on success, false on failure. * Runs just before PHP shuts down execution. * @return string|WP_Error Category name on success, WP_Error on failure. * At the moment, this merely checks for the present of Basic Auth credentials. * When a plugin is activated, the action 'activate_PLUGINNAME' hook is, * called. Customizer Code Examples on GitHub - Make WordPress Themes This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. Coding Standards: Always use parentheses when instantiating an object. * which checks if any filter is currently being run. * @type string $option_none_value Value to use when no category is selected. Accepts 0, 1, or their. * @param string $media_type A Media Type string to check. * Prior to v2.7, only one category could be compared: in_category( $single_category ). * @param mixed $args Optional. * @return bool True if string is a valid JSON Media Type. * @return bool True if WP is installing, otherwise false. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. * Actions are the hooks that the WordPress core launches at specific points, * during execution, or when specific events occur. * Valid developer modes are 'core', 'plugin', 'theme', or an empty string to disable developer mode. * @return mixed The filtered value after all hooked functions are applied to it. * @param string $hook_name The name of the filter hook. * This function can be called unconditionally to speculatively check. // Check for hacks file if the option is enabled. A complete example for using WP PHPUnit in the context of plugin development. 'The site you have requested is not installed properly. * The plugin API is located in this file, which allows for creating actions, * and filters and hooking functions, and methods. * @return bool Whether the function is removed. * Default 'flat'. // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores. * 'enable_wp_debug_mode_checks' => array(. Many functions in WP core also has dependencies in other files and it can be a mess to figure out exactly what files you need to . How to use WordPress with GitHub (The Complete Guide) | WPBlazer * To use this filter you must define a `$wp_filter` global before. * In a future release, this evaluation may be made more robust. * * - $arg1 and $arg2 are the additional arguments passed to the callback. * @param string $separator Optional. Default 0. REST API: return post modified datetime for Templates. * Filters whether a site is protected by HTTP Basic Auth. * @return int The ID of the current network. * @param string $replacement Optional. How To Update Your WordPress Plugin From GitHub in 2020 Basic Example. The footprint will be much smaller than just loading the wp-load.php and still gives you access to all the all the built in functions in WordPress core, unlike including for example /wp-includes/wp-db.php directly. A ready to use .travis.yml configured with a reasonable test matrix. * @param string $hook_name The filter hook to which the function to be removed is hooked. // Fallback for the 'All' link is the posts page. * that an external object cache is being used. If `$_SERVER`. Default empty. * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request. * @return bool True if the current Ajax action should be protected. * under [cat name]'. * In order to always serve the same content to all users, the 'aria-label' gets printed out: * - when the tag count is displayed (for example when users check the checkbox in the, * Tag Cloud widget), regardless of the tags font size. * `$hook_name` and `$priority` are no longer used. * Displays or retrieves the HTML dropdown list of categories. Default 10. gallery_shortcode() | Function | WordPress Developer Resources * Calls the callback functions that have been added to a filter hook, specifying arguments in an array. * Default 'No categories'. String to use after the terms. False otherwise. * Retrieves category name based on category ID. * Retrieves the current development mode. * of no use, since we want to use the `mb_` functions for `utf-8` strings. * (or any tag, if no tag specified). * of `$name`. * @param string $separator Optional. * @param string $setting The name of the ini setting to check. // Look for the alternative callback style. * Note: This function only returns results from the default "category" taxonomy. * in an unordered list. This goes for both filters and actions. * The dynamic portion of the hook name, `$taxonomy`, refers. * @param int $post_id Optional. * Filters whether to allow the debug mode check to occur. * add_filter( 'example_filter', 'example_callback', 10, 3 ); * * Apply the filters by calling the 'example_callback()' function. * Filters how the items in a tag cloud are sorted. * @param int $term Optional. Default true. String to use after the tags. * @global string $pagenow The filename of the current screen. * @since 4.2.0 Introduced the `value_field` argument. * @param callable|string|array $callback The callback to be removed from running when the filter is applied. Database: Move the if statement outside of the loop. * @type callable $topic_count_text_callback Callback used to generate nooped plural text for. * have changed and it may need to update keys and cleanup caches. Function: Checks the equality of two values, following JSON Schema semantics. * in an unordered list), or 'array' (returns an array). * The 'all' hook passes all of the arguments or parameters that were used for. Feeds: Add an early exit when calling RSS functions directly. Default empty. Default empty string. Array or string of arguments for generating a tag cloud. * @param int|false $post_id The post ID. // Fix for IIS when running with PHP ISAPI. * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * Removes all of the callback functions from an action hook. * @param bool $enable_object_cache Whether to enable loading object-cache.php (if present). * positive integer or zero to return all. See get_terms(). wp_cache_switch_to_blog( get_current_blog_id() ). * While upgrading or installing WordPress, no plugins are returned. * Default empty string. Editor: add box shadow support to blocks. Accepts 'multiple', 'single', or empty. * Redirect to the installer if WordPress is not installed. The callback to check for. * or zero to return all. * @return bool True if the current post has any of the given categories. If it's been rewritten to the `HTTP_AUTHORIZATION` header. * @type string $orderby Value to order tags by. * @since 2.8.0 Added the `taxonomy` argument. You signed in with another tab or window. * If no terms are given, determines if post has any terms. // Re-initialize any hooks added manually by object-cache.php. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. * Determines whether the current request is for the network administrative interface. * WordPress loads, usually in `wp-config.php`. * @return bool True if JSONP request, false otherwise. * Die with a maintenance message when conditions are met. A backdoor is code added to a website that allows a hacker to access the server while remaining undetected, and bypassing the normal login. * a static method or function. * @return string|WP_Error A list of category parents on success, WP_Error on failure. /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */. String to use between the tags. * @param string $hook_name The name of the action to be executed. * @global int[] $wp_filters Stores the number of times each filter was triggered. * If no categories are given, determines if post has any categories. // Avoid clashes with the 'name' param of get_terms(). ', 'Please check that the %s PHP extension is installed and enabled. * Generates a tag cloud (heatmap) from provided data. How to Create Custom WordPress Editor Blocks in 2021 - Delicious Brains * that evaluates to false (e.g. Harden wordpress security nginx GitHub