Cron schedule interval through plugin options?

Yes, in my opinion that’s exactly the right way to extend the default schedule timings. I would be a little more informative with the display value but I think that is only example code. However, one important thing should be taken into account. The default WordPress schedule implementation that is invoked as a side effect … Read more

wp_link_pages output appears twice

you need to set the ‘echo’ parameter of wp_link_pages() to ‘echo=0’; example: $content .= ‘<div class=”pagination”>’ . wp_link_pages(‘before=&after=&next_or_number=next&nextpagelink=Next&previouspagelink=Previous&echo=0’) . ‘</div>’;

How to add a custom filter in functions.php

To be honest, I had to actually see the source code to get the correct answer for you. The problem with this particular filter is that the $filter part is dynamic and thus you have to know what particular frequency you want to modify. There’s a numerous of options: homepage, blogpage, $post_type . ‘_archive’, $post_type … Read more

Filter all html output

You can’t protect against everything a user will do. What if they hard-code an email address in the footer/header/sidebar of their theme? The only way to capture and escape that is with output buffering … and that can become a performance nightmare. My recommendation would be to do two things: Hook in to all of … Read more

Use content custom filter for all shortcodes

so I would like to execute a filter or something that works on every shortcode Looks like you’re after do_shortcode_tag. It “Filters the output created by a shortcode callback.”. Aurovrata Venet gives a demo usage similar to: add_filter( ‘do_shortcode_tag’,function ($output, $tag, $attr){ //make sure it is the right shortcode if(‘aShortcode’ != $tag){ return $output; } … Read more

Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu

Solution function append_album_review_to_title( $title, $id = NULL ) { if ($id) { if ( get_post_type( $id ) == ‘album_review’ ){ return ‘Album Review: ‘ . $title; } else { return $title; } } else { return ‘Album Review: ‘ . $title; }; } add_filter(‘the_title’, ‘append_album_review_to_title’, 10, 2); Explanation First trying this: function append_album_review_to_title( $title, $id … Read more

posts_groupby problem

Your filter will result in SQL query with GROUP BY statement but without aggregate function. This will result in displaying only the first row that appear in the group that match your query and omitting the subsequent rows. Read this question for more details. If you want to order your results by post_type, you can … Read more