post_status => publish not working

I have a front end form that let users submit a post. This is how i store the data when a post is submitted : if ( isset( $_POST[‘submitted’] )) { $post_information = array( ‘post_title’ => wp_strip_all_tags( $_POST[‘postTitle’] ), ‘post_content’ => $_POST[‘postContent’], ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’ ); $new_post = wp_insert_post( $post_information ); The … Read more

How to trap “Publish” button to check for meta box validation?

I’m trying to do some form validation on my custom meta box, and I remember somewhere reading about some javascript function to disable/enable the Publish button – except I can’t find it. How do I either a) enable/disable the publish button or, b) when Publish is clicked, trap it and prevent the update and alert … Read more

publish_post conflicts with save_post

my plugin has a save_post hook used to save the custom fields. now I add a publish_slider hook used to change a checkbox’s status(slider is a custom post type). but it doesn’t work properly. the save_post hook is as below add_action(‘save_post’, ‘save_post_func’, 10, 1); function save_post_func($post_id) { if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) return; if … Read more

Registration and Custom Post Types – How to synchronize information?

I am building a platform where service providers can offer their services to potential customers. Therefore, I have two user roles, one “customer” who can only create an account and read; and “providers” who can create an account, and publish a post with their account information. Here is the problem I am having: I created … Read more

the_modified_date returns published date

I wanna display modified date instead of published date. I have this code in my theme: echo ‘<li><i class=”fa fa-clock-o”></i> <span class=”post-date updated”>’ . get_the_date() . ‘</span></li>’; i changed it to this: the_modified_date(‘j F Y’, ‘<li><i class=”fa fa-clock-o”></i> <span class=”post-date updated”>’, ‘</span></li>’); but it still shows the published data. my post is published on the … Read more