Tag Info

Hot answers tagged

2

You need to call global $post before using $post->ID, or better, use get_the_ID() instead.


2

CSS is the answer. If you look at the HTML code of each row (<tr>), you will see that it has classes that include post ID, post status, post tags, categories, and so on. So, you can easily apply CSS rules based on that classes and based on post tags. For example, this is a row in one of my site: <tr id="post-24392" class="post-24392 type-post ...


1

Im no expert on this but here goes: After reading some code and doing a global search of the filter, its not a filter at all, the only time that filter is called is in a do_action // HOOKABLE: This action runs just before logging the user in (before creating a WP cookie) do_action( "wsl_hook_process_login_before_wp_set_auth_cookie", $user_id, ...


1

The filter you're looking for is manage_edit-comments_columns. Here is a post detailing how to add custom columns to the edit comments section of the admin http://stv.whtly.com/2011/07/27/adding-custom-columns-to-the-wordpress-comments-admin-page/


1

First, your filter should return, not echo anything. The content will appear in the wrong place if you echo directly within the function. The original contents of the_content are passed to the filter function as an argument- function fds_the_content( $content ) { // <--- original value of the_content // append original $content $new_content = ...


1

You cannot mix array syntax and string syntax in the same argument. If you start with array syntax, you should stick with that, the same applies if you start with string syntax, then you should stick with string syntax. Because you are using post__not_in which is an array, you should stick with array syntax <?php $query = new WP_Query( array( ...


1

Of course! I just had to set the $accepted_args parameter of add_filter() to 2. Like so: add_filter('posts_join', 'my_join', 10, 2); function my_join($join, &$query) { echo $query->is_main_query() ? 'y' : 'n'; return $join; }


1

So far, the only workable solution I've come up with is to run a new query within the ajax_query_attachments_args filter. It's definitely not ideal but works as expected in the absence of a more efficient alternative: function restrict_media_library_by_width($query) { $include = array(); $exclude = array(); $temp_query = new WP_Query($query); ...



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