WordPress Front end Form – Enable to Submit PHP Codes
Running forms through the_content filter should be fine.
Running forms through the_content filter should be fine.
Try this workaround of this issue without using publish_post hook (using save_post) add_action( ‘save_post’, ‘wpse228941_save_post’ ); function wpse228941_save_post( $post_id ) { if( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) return; if ( “publish” == get_post_status( $post_id ) && ! get_post_meta( $post_id, “se_228941_mailed”, 1 ) ) { do_action( “sm12_publish_post”, $post_id ); update_post_meta( $post_id, “se_228941_mailed”, time() ); } } add_action( … Read more
You got this action comment_post which fires just after comment is inserted in database
“Submit for review” for updates on existing posts
Published site reverts without changes to theme
How to switch wordpress post status between publish and schedule in MySQL?
Decide user that can publish a post
I have the below code which works as expected if anyone else is looking for similar. add_action( ‘publish_page’, ‘redirect_user_page_list’, 10, 3 ); function redirect_user_page_list() { if( is_user_logged_in() ) { $user = wp_get_current_user(); $role = ( array ) $user->roles; if ( ‘role_slug’ == $role[0] ) { $url=”url to redirect to”; wp_redirect($url); exit; } } }
Publish Post when URL is available else reschedule the post in wordpress [duplicate]
Try this: add_action(‘publish_post’, ‘dp_expiry’); function dp_expiry( $data ) { /*adds 2 weeks onto the current date in unix epoch format*/ $dp_new_expiry_date = (strtotime( current_time( ‘mysql’ ) ) + 1209600); /*converts unix timstamp back to yyyy-mm-dd format like you required*/ $dp_new_expiry_date_conv = date(“Y-m-d”, $dp_new_expiry_date); update_post_meta( $data[‘post_id’], ‘postexpiry’, $dp_new_expiry_date_conv ); }