How to append custom text to the output of ‘categories widget’?

To append text to the end of the titles in that widget and nothing more i.e. does not matter the URL, you can just use some CSS. <li> <a class=”my-folder-categories”>Category 1</a> </li> a.my-folder-categories-folder:after {content:” folder”; This will effectivly make the text appear as so: category 1 folder Be sure to add that space in the … Read more

Get_template_part inside filter?

You can use output buffering to get the template output and return it in place of the emptied shortcode content: if ($pos !== false) ob_start; get_template_part(‘content-gallery.php’); $contentgallery = ob_get_contents(); ob_end_clean(); return substr_replace( $content, $contentgallery, $pos, strlen($shortcode[0]) );` } EDIT It might make it easier to just replace the gallery shortcode? remove_shortcode(‘gallery’); add_shortcode(‘gallery’,’my_content_gallery’); function my_content_gallery() { … Read more

menu-item class missing on wordpress menu

The default fallback in wp_nav_menu for a menu that doesn’t exist/isn’t registered is wp_page_menu, which unfortunately does not support the same arguments/implement the same level of “customisability” – you either need to create a custom fallback, or remove the fallback entirely (so that the user is forced to set a menu).

Add Adsense code between job listings – wp job manager plugin

There’s a filter for the output $job_listings_output = apply_filters( ‘job_manager_job_listings_output’, ob_get_clean() ); so, you should just do add_filter(‘job_manager_job_listings_output’,’my_job_manager_job_listings_output’); function my_job_manager_job_listings_output($output) { $adsense_code=” My adsense code”; return $output . $adsence_code; }

What is the action hook to use if you want to capture the new password during password change?

I have been looking around the core files searching for hooks, there were very few when it comes to hooking into edit_user() function which updates the user data in profile.php page, so I have finished with some workarounds: My workaround is to save the user’s password in a custom option before the password was updated, … Read more

How to hide some categories in dashboard

You could hook to the get_terms_args filter conditionally depending on your user/role Something along those lines add_filter( ‘get_terms_args’, ‘restrict_cat’, 10, 2 ); function restrict_cat( $args, $taxonomies ){ // Don’t run if we are not dealing with categories if( ‘category’ != $taxonomies[0] ) return $args; // The check for the user we want to restrict // … Read more

Admin: how to make a custom list filter button send GET queryvars

Thanks to @cybmeta I was able to solve my issue. Below I post all the relevant code. Keep in mind it refers to a ‘distributor’ custom post type that uses 4 custom taxonomies (‘italy’,’france’,’spain’,’world’). // add columns function add_distributor_columns($table_columns){ $area_column = array(‘area’ => ‘Area’); $macroarea_column = array(‘macroarea’ => ‘Macroarea’); // put them on the right … Read more