RankMath Functions»
Move RankMath metabox to bottom of the edit screen //change the metabox display location to bottom function rank_math_change_metabox_priority() { return 'low'; } add_filter( 'rank_math/metabox/priority', 'rank_math_change_metabox_priority' ); Remove node from admin…
PHP, WP/CP | Type: PHP
Remove Items from WP/CP Admin Bar»
// Remove items from the admin bar function remove_from_admin_bar($wp_admin_bar) { /* * Placing items in here will only remove them from admin bar * when viewing the fronte end of…
PHP, WP/CP | Type: PHP
Remove Metabox from Template»
When you need a particular metabox to disappear from a particular template.
Javascript, WP/CP | Type: Javascript
Remove Personal Options Section from User Profile»
Removes the 'profile.php' admin color scheme options.
Users, WP/CP | Type: PHP
Removing autop, and when you can’t remove it»
The autop function can be very annoying when you’re trying to format content. But some plugins depend on autop to work, such as the checkout function in EDD, and possibly…
eCommerce, PHP, WP/CP | Type: PHP
Replace Deprecated Init create_function (php 7.2)»
Several plugins still use the deprecated function. EXAMPLE (SSN) //deprecated version add_action('widgets_init', create_function('', 'return register_widget("SimpleSectionNav");')); //7.2 ready version function ssn_register_widget() { return register_widget("SimpleSectionNav"); } add_action( 'widgets_init', 'ssn_register_widget' ); EXAMPLE //deprecated…
PHP, WP/CP | Type: PHP
Show Tags for Only One Category»
Decided not to do this on a project after finding this snippet, but kept the snippet just in case. query_posts('category_name=news'); if (have_posts()) : while (have_posts()) : the_post(); //replace 'news' with…
WP/CP | Type: PHP
Specify minimum size for image upload»
//specify minimum size for uploaded images (including featured images) add_filter('wp_handle_upload_prefilter','tc_handle_upload_prefilter'); function tc_handle_upload_prefilter($file) { $img=getimagesize($file['tmp_name']); $minimum = array('width' => '300', 'height' => '300'); $width= $img[0]; $height =$img[1]; if ($width < $minimum['width']…
Images, WP/CP | Type: PHP
Turn Start Date into Pretty Date»
Once you've established a date, display it as you like (see catholic fdn single-events.php for complex usage)
ACF, PHP, WP/CP | Type: PHP
Ultimate Guide to WordPress Conditionals»
An excellent resource for WP developers; includes examples.
¡Important!, WP/CP | Type: PHP