Reputation:
What is post edit action hook that i can put plugin translation path for custom type post.php?
function wp_professionals_load_plugin_textdomain()
{
load_plugin_textdomain( 'wp-professionals', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( '????', 'wp_professionals_load_plugin_textdomain' );
Upvotes: 0
Views: 3910
Reputation: 1127
If you're looking for a hook that fires when a post is created or updated, you should use save_post
. It fires just after the post is successfully saved in the database.
function wp_professionals_load_plugin_textdomain($post_id)
{
load_plugin_textdomain( 'wp-professionals', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( 'save_post', 'wp_professionals_load_plugin_textdomain' );
Note that save_post
also passes $post_id
to your function in case you need it.
Upvotes: 2
Reputation: 722
Hi it is edit_post hook right?
do_action( 'edit_post', int $post_ID, WP_Post $post )
Please try it
Upvotes: 0