Viewing 1 replies (of 1 total)
  • Plugin Author Alexandre Gaboriau

    (@mcurly)

    Hi Lenin,

    Maybe you can try with this code:

    function MPT_wp_insert_post($post_id, $post, $update) {
    	$plugin = new Magic_Post_Thumbnail();
    	$plugin_admin = new Magic_Post_Thumbnail_Admin( $plugin->get_plugin_name(), $plugin->get_version() );
    	$launch_plugin = $plugin_admin->MPT_trigger_wp_insert_post($post_id);
    }
    
    
    add_action( 'wp_insert_post', 'MPT_wp_insert_post', 15, 3 );

    But be careful, this code can also assign an image when you add a post manually with the back office, so I didn’t include this code in the plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘hook wp_insert_post’ is closed to new replies.