Hot answers tagged

1

This will only execute that code for a specific post type: function my_super_filer_function6($query_args){ global $post; if($post->post_type == 'specific post type'){ $post_author = $post->post_author; $query_args['author'] = $post_author; } return $query_args; } add_filter('listing/grid/posts-query-args', '...


1

There's a couple ways you could handle this. Option 1 Check the global $post object Inside your filter you may be able to check the current $post object or other Conditional Tags for a specific type. function my_super_filer_function6( $args ) { global $post; /* Check against the current post object */ if( empty( $post ) || 'post_type_here' !=...


1

The first block you provided can be sufficiently updated to be used with your code but see my example below: Start of by setting up your WordPress function to load your scripts (inside functions.php) and set the global ajax script variable to use later. I am breaking it down into sections since this would the correct way of doing it: function ...


1

This isn't possible with custom table columns, and you should avoid and move away from custom modifications to WP Core tables. Instead, store this data in user meta instead of custom table columns. When you next update WordPress, if the database schema will change, WP will adjust the tables to match, destroying your custom columns and all the data they ...


1

Filters get queued and sorted by priority, then order of occurrence. Filters' default priority is 10, unless otherwise specified. The order of occurrence can be affected by the order plugins get fired (alphabetical, by plugin name). So, when you started poking at this, both filters had equal priority. That would mean a rather arbitrary factor caused one ...


1

If the javascript code is actually embedded in the post content, you could use php filters such as the_content to remove script tags. But that will strip it out at runtime, every time the page is loaded. If this is your situation, then you'd be better off stripping it out of the wp_posts.post_content table/column from the database. If you want to quickly ...


1

You have a LaTex plugin? It probably filters "the_content". Try return apply_filters( 'the_content', '$\frac{15}{5} = 3$' );


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