Skip to content

Instantly share code, notes, and snippets.

D pre_comment_author_name
H dashboard_primary_title - on hold
D wpmu_signup_user_notification
D the_weekday_date
D post_row_actions
D wp_terms_checklist_args
D post_comments_feed_link
D get_the_generator_{$type}
D teeny_mce_buttons
D posts_join_paged
@WerdsWords
WerdsWords / pre_comment_author_name.php
Last active December 19, 2015 19:28
#1: pre_comment_author_name
<?php
/**
* Filter the comment author name for administrators
*
* @see wp_filter_comment(), sanitize_comment_cookies()
*
* @param string $name The comment author name.
* @return string The filtered author name.
*/
function wpdocs_comment_author_name( $name ) {
@WerdsWords
WerdsWords / dashboard_primary_title.php
Last active December 19, 2015 19:28
#2: dashboard_primary_title
<?php
/**
* NOTE: This one is on hold until we can confirm
* it actually a) works, b) serves a purpose.
*
* Filter the WordPress Blog widget title
*
* @see wp_dashboard_setup()
*
* @param string $title The dashboard widget title.
@WerdsWords
WerdsWords / wpmu_signup_user_notification.php
Last active December 19, 2015 19:28
#3: wpmu_signup_user_notification
<?php
/**
* Disable email confirmation emails for Gmail users
*
* @see wpmu_signup_user_notification()
*
* @param string $user The user's login name.
* @param string $user_email The user's email address.
* @param string $key The activation key from wp_signup_user().
* @param array $meta An array of meta, default is an empty array.
@WerdsWords
WerdsWords / the_weekday_date.php
Last active December 19, 2015 21:08
#4: the_weekday_date
<?php
/**
* Convert a post's published day to pirate when the day is Saturday.
*
* We won't check the string, but rather the numerical representation
* of Saturday, just in case the days of the week are translated.
*
* @see the_weekday_date(), #24781
*
* @param string $day The day of the week the post was published.
@WerdsWords
WerdsWords / post_row_actions.php
Last active December 19, 2015 21:39
#5: post_row_actions
<?php
/**
* Disable Quick Edit row action for posts
*
* @see WP_Posts_List_Table::single_row()
*
* @param array $actions An array of row actions, keys corresponding to the span class attribute of each element.
* @param object $post The post object.
*
* @return array The row actions array.
@WerdsWords
WerdsWords / wp_terms_checklist_args.php
Last active December 19, 2015 21:39
#6: wp_terms_checklist_args
<?php
/**
* Disable 'checked_ontop' for Media Categories taxonomy
*
* @see wp_terms_checklist()
*
* @param array $args An array of arguments.
* @param int $post_id The post id.
*
* @return array The arguments array.
@WerdsWords
WerdsWords / post_comments_feed_link.php
Last active December 19, 2015 23:18
#7: post_comments_feed_link
<?php
/**
* Enforce https for post comments feed url
*
* @param string $url The post comments feed url.
*
* @return string The feed url.
*/
function wpdocs_change_comments_feed_url( $url ) {
// Make sure the feed url is https
@WerdsWords
WerdsWords / get_the_generator_type.php
Last active December 19, 2015 23:28
#8: get_the_generator_{$type}
<?php
/**
* WordPress versions to jazz musicians
*
* @param string $gen The generator meta tag.
* @param string $type The type of page to generate the tag for.
*
* @return string The filtered generator meta tag.
*/
function wpdocs_generator_as_jazzer( $gen, $type ) {
@WerdsWords
WerdsWords / teeny_mce_buttons.php
Last active December 19, 2015 23:49
#9 teeny_mce_buttons
<?php
/**
* Register a new teeny mce button for Press This
*
* @param array $buttons The teeny mce buttons array.
* @param int $editor_id The editor id.
*
* @return array The filtered teeny mce buttons.
*/
function wpdocs_teeny_mce_button( $buttons, $editor_id ) {