Clean/filter HTML inserted to post content by XML RPC

From the save_post Codex page: save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. So, if you hook into save_post you can run your filter before save: add_action( ‘save_post’, ‘wpse_75871_save_post’ ); function wpse_75871_save_post( $post_id ) { … Read more

How can I display wp_link_pages before a shortcode, if it is used, or display after content?

Do something like this. // your shortcode callback function your_sc_callback($atts,$content) { $content = wp_list_pages(array(‘echo’=>false)).$content; define(‘YOUR_SC_RAN’,true); return $content; } Now, in your theme template after the content prints if (!defined(‘YOUR_SC_RAN’)) { wp_list_pages(); } Or, you could do … function append_list_pages($content) { return $content.wp_list_pages(array(‘echo’=>false)); } add_filter(‘the_content’,’append_list_pages’,100); And your shortcode callback would be … function your_sc_callback($atts,$content) { $content … Read more

Sanitizing a custom query’s clauses

I would suggest to think in this way: if I can not sanitize whole query (as you can not, what does sanitized mean? Is DELETE or DROP malicious or wanted query? Your plugin would have to be able to determinate the intended purpose of each query ant it is unreachable.), you can predict it’s content. … Read more

Filter image and text from post format

I’m pretty sure you’d define the custom post formats in functions.php, then they’d reference their own PHP file which contains the loop you’d need. So for example, Text format would go to post-text.php, Image format post-image.php, etc. You could add your match filters into a function within functions.php, and then call the function from within … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)