This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enable user auto-complete for non-super admins who have the promote_users cap. | |
* | |
* @see wp_ajax_autocomplete_user() | |
* | |
* @param bool $yesno Whether to allow non-super admins to use user autocomplete. Defaults to false. | |
* | |
* @return bool Whether to allow it. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// There is no example yet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example 'Marco, Polo' Heartbeat nopriv data received filter. | |
* | |
* Based on an original Gist by Jason Coleman (https://gist.github.com/strangerstudios/5888123) | |
* | |
* @see wp_ajax_nopriv_heartbeat() | |
* | |
* @param array|object $response The response object. | |
* @param array $data An array of $_POST data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modifed date emphasis | |
* | |
* @param string $modified_date The modified date output. | |
* @param string $date The date format. Defaults to 'date_format' option value. | |
* @param string $before What to output before the date. | |
* @param string $after What to output after the date. | |
* | |
* @return string The modified modified date (heh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AP style-ize 'e-mail' in login messages | |
* | |
* @param string $messages The login message(s). | |
* | |
* @return string The filtered login message(s). | |
*/ | |
function wpdocs_login_messages( $messages ) { | |
$messages = str_replace( 'e-mail', 'email', $messages ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove use of Oxford/serial comma at the end of taxonomy lists | |
* | |
* @param array $separators The array of defaul list item separators. | |
* | |
* @return array The filtered list of list separators. | |
*/ | |
function wpdocs_no_oxford_comma( $separators ) { | |
// Replaces __( ', and ' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Extend http timeout duration to 30 seconds | |
* | |
* @param int $timeout The timeout duration in seconds. Default is 5. | |
* | |
* @return int The filtered timeout duration in seconds. | |
*/ | |
function wpdocs_extend_http_response_timeout( $timeout ) { | |
return 30; // seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Only retrieve cap and object_type in taxonomy XML-RPC getters | |
* | |
* @see wp.getTaxonomy(), wp.getTaxonomies() | |
* | |
* @param array $fields An array of taxonomy fields. | |
* @param string $method The XML-RPC method name. | |
* | |
* @return array The filtered array of fields. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Only allow super admins to upload files | |
* | |
* @see map_meta_cap() | |
* | |
* @param array $caps Primitive capabilities assigned to meta caps. | |
* @param string $cap Meta capability. | |
* @param int $user_id The current user id. | |
* @param array $args An array of arguments, sometimes empty. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Keep posts' featured images | |
* | |
* @see delete_metadata() | |
* | |
* @param bool $bool Default is null, anything else short-circuits delete_metadata(). | |
* @param int $object_id The post, user, or comment object id. | |
* @param string $meta_key The meta key to delete. | |
* @param string $meta_value The meta value to delete. |