Tag Info

Hot answers tagged

2

If you want to test your custom SQL to see how it affects the loading time, you can try this query swapping: /** * Restrict the potential slow query in the meta_form() to the current post ID. * * @see http://wordpress.stackexchange.com/a/187712/26350 */ add_action( 'add_meta_boxes_post', function( $post ) { add_filter( 'query', function( $sql ) ...


2

You can try the following approach using the the_title filter in the edit.php screen: /** * Modify post titles in the edit.php screen. * If the post title is empty, then show max 10 words from the post content instead. */ add_action( 'load-edit.php', function() { add_filter( 'the_title', function( $title ) { $post = get_post(); ...


1

I believe the filter you want is wp_get_nav_menus: function wp_get_nav_menus( $args = array() ) { $defaults = array( 'hide_empty' => false, 'orderby' => 'name' ); $args = wp_parse_args( $args, $defaults ); /** * Filter the navigation menu objects being returned. * * @since 3.0.0 * * @see get_terms() * * ...


1

Almost exactly the same to brasofilo, my code below also accounts for different taxonomies and removes the checkbox for parent categories at the top level, only if they have children. This allows for other top level categories that are childless to still be selectable. I put this simple code my theme's functions.php file: class Category_Checklist { ...


1

Assuming you've added the column correctly and not hacked it in somehow, then the manage_${post_type}_posts_custom_column filter should do what you want. The example in the Codex is about the best I've got given the sparcity of information in the question: add_action( 'manage_posts_custom_column' , 'custom_columns', 10, 2 ); function custom_columns( ...


1

I think this is a bad case of taxonomy split introduced in WP 4.2 ref. https://make.wordpress.org/core/2015/02/16/taxonomy-term-splitting-in-4-2-a-developer-guide/ Solution for this would be to use this plugin to detect and fix the splitting before Updating menus which is a bit buggy in my opinion. Update nav menus will trigger ...



Only top voted, non community-wiki answers of a minimum length are eligible