Insert all post IDs in new database table

I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table? Right now I’m using an action hook to immediately insert the id of new posts I publish. function transfer_post_id($post_ID) { global $wpdb; if (!($wpdb->get_row(“SELECT post_id FROM $my_table WHERE … Read more

How to change the location of admin notice in html without using Javascript?

I am adding an admin notice via the conventional admin_notice hook in my plugin: function my_admin_notice() { ?> <div class=”notice notice-info is-dismissible”> <p><?php _e( ‘some message’, ‘my-text-domain’ ); ?></p> </div> <?php } if ( my_plugin_show_admin_notice() ) add_action( ‘admin_notices’, ‘my_admin_notice’ ); How can I control where wordpress places the admin notice, in the html on the … Read more

WordPress Ajax callback function from plugin – OOP

Using PluginBoilerplate to write a plugin. I need to make an ajax call. I added to main plugin.php file, class to register scripts and handle ajax calls. if ( ! class_exists( ‘PoorMansNameSpaceAJAX’ ) ) { class PoorMansNameSpaceAJAX{ public static $instance = null; public $nonce=””; public $name=”ajaxexample”; public static function getInstance() { null === self::$instance AND … Read more

Hooks for Links Box [duplicate]

This question already has answers here: Closed 10 years ago. Possible Duplicate: Getting archive pages in WP’s AJAX internal link finder? Are there any hooks for the new internal links box that was created in WP 3.1? I’m trying to modify it in my plugin. 1 Answer 1 Right now there are no hooks to … Read more

How can I customize the upload error message in WordPress?

After following the guide for How can I prevent uploading bmp image? to remove bmp (and in my case tiff images) from being uploaded, I tested and it is working, but noticed users are now getting the error message: Sorry, this file type is not permitted for security reasons. screenshot-with-shadow.png http://img813.imageshack.us/img813/4526/screenshotwithshadow.png That looks to be … Read more

Post thumbnail relative link and HTML modify

I want to remove the website url from all the_post_thumbnail() so they become relative and remove/add attributes from the output. So far I got the following code added to functions.php of the theme, xcept I am not sure how to modify the thumbnail $html for the second part. Help is appreciated add_filter( ‘post_thumbnail_html’, ‘my_post_image_html’, 10, … Read more