I am interested in changing our WP dashboard so that I can choose whether an individual Post will include the publish date or not. Is there a way to do it without a plug-in and insert code that maybe creates a checkmark or something like that in the Post dashboard that can toggle the publish date display? Thank you in advance!
Is there a way I can call a link so when clicked it publishes the post via the ID I provide? I have get_delete_post_link( $postID ) set fine, and would like to do the same to make a draft go to published, or if you can't publish post, make it pending. I also have this code running in my functions.php file so may be also a way to call this if a link is clicked.
The preview function works fine when posts are just draft. The url looks like this : http://exemple.domain.com/blog/?p=12&preview=true Then when I pubish my posts, let's say I want to change something and preview it, the url looks like this : http://exemple.domain.com/blog/my-article-title/?preview=true&preview_id=12&preview_nonce=514e88946a&post_format=standard The problem is it does reflect any changes ... I use WordPress 3.9.2 running Twenty Fourteen theme without any plugins EDIT I've turn the permalink to default and it resolve the problem. But I need it to work using the …
I have been searching for several hours to find a way to embed the "Add New Post" inside a page in the front end. I read this post but sadly no answer to it. I have embedded the login form in another page called (example.com/user-login) and What I want is to have a page (example.com/add-post) which allows the person who logged in to publish a post in a page that is within the WordPress theme. The same way as default …
the following code is supposed to store post meta of the recently published post to the variable $temp. But it doesn't, $temp is always empty. This seems to happen because "transition_post_status" fires before meta information is stored to the database. Is there a hook that makes me able to get the post meta of the post I just published? function myfunction($new_status, $old_status, $post) { if ($post->post_status !== "publish" ) { return; } $temp = get_post_meta($post->ID); // do something with post …
I am trying to change the text of the publish button to save function change_publish_button( $translation, $text ) { if ( $text == 'Publish' ) return 'Save'; return $translation; } add_filter( 'gettext', 'change_publish_button', 10, 2 ); I am trying to run the above code but it doesn't change the text of the publish button, can anyone please tell what is wrong with this code or suggest any new method. Thanks in advance Update I want to change the publish button …
I notice that the documentation for wp_schedule_single_event mentions the following:- The action will fire off when someone visits your WordPress site, if the schedule time has passed. However this does not seem to be true for scheduled posts. I notice that some posts can be missed if wp-cron is not run for a while (not sure of exact timeframe). The post then has the label 'Missed Schedule' in the admin panel. My questions are:- Is this just for scheduled posts …
I want to count the total number of comments the user has received for his published posts. for example show: total comments of your all posts : 47 Is there a way to do this? Can you help me?
How do you publish posts when the post edit form is submitted with the enter/return key on the keyboard? By default WordPress saves the post in draft status. To provide some background, I have an Inventory custom post type, which does not use the Title or Content fields, only meta fields which are text inputs. To streamline input of Inventory posts, I want to publish the post when the author hits the enter/return key. I've compared the $_POST variable of …
For example I create post at 29 day, publish it. In url there is 29 day. Now if I change publish date to 28, url works with 28 day. But it also works with 29 day, just redirects to 28. I do not get how it knows how to redirect to 28? Will it be forever? I see lot of articles telling not to change publih dates. Why? If it redirects, then it is good - old and new links …
I'm trying to adapt Welcher's answer here to replace Gutenberg's default pre-publish conditions with my own - namely for requiring that a category and a featured image are set. However, no matter what I try I can't seem to get his code working for me. Here is the content of my pre-publish-checks.js: const { registerPlugin } = wp.plugins; const { PluginPrePublishPanel } = wp.editPost; const { select, dispatch } = wp.data; const { count } = wp.wordcount; const { serialize …
I am trying to set post terms on the post, when it is puublished I use following code but is doesn't work add_action('pending_to_publish', 'oj_publish_post'); function oj_publish_post($post_id) { $taxonomy = 'category'; $term_id = array(8); $term_id = array_map('intval', $term_id); wp_set_post_terms( $post_id ,$term_id, $taxonomy,true); } But, when I pass the id of the post manually i.e instead of using post_id. I use 773 it works add_action('pending_to_publish', 'oj_publish_post'); function oj_publish_post($post_id) { $taxonomy = 'category'; $term_id = array(8); $term_id = array_map('intval', $term_id); wp_set_post_terms( 773 ,$term_id, …
I am trying to write a plugin that will stop a user from publishing (or updating) a post if a given condition is not met, for example, if the title of the post is already being used in a different post (I am using a custom post type, if that makes a difference). I wrote a function that gets called through the 'transition_post_status' hook to attempt to catch the post before it gets published or updated in the database, so …
I have created a CPT that I want to edit with Elementor. Now when I try to edit a draft CPT post with Elementor it works fine but when I try to edit that same post after publishing it, Elementor gives a 404 error. Thanks for any help.
Is it possible to take the blue publish button in back end of the wordpress and place it in the frontend near the post in my index.php. I need a way to publish the pending article without going to dashboard and only admin can see the publish button? <?php $args=array( 'post_type' => 'post', 'post_status' => 'pending', 'order' => 'ASC', 'caller_get_posts' =>1, 'paged' =>$paged, ); Thank You all in advance for help :D
Anyone know a way round this? http://wordpress.org/support/topic/set-draft-page-as-parent I can't risk publishing as a public-facing system updates periodically from the same install.
I am using the transition_post_status to process a post being published. I was getting inconsistent behaviour between two installations of WordPress, and I have tracked this down to the AJAX calls being made from the post compose page itself. These are the requests being made when I transition a post from a draft to published on my two installations: As you can see, the AJAX call to post.php is not being made in the second example. It turns out that …
I've been struggling to find a solution for this and I don't know if it's the Gutenberg editor or if it's the hook publish_post. Hook: function api_method($post_id) { // If this is just a revision, don't send request if ( wp_is_post_revision( $post_id ) ) { return; } // Get Post Object $post = get_post($post_id); open_log($post); $postData = array( 'unit' => get_post_meta($post_id, 'open_unit', true), 'abstract' => get_post_meta($post_id, 'open_abstract', true), 'image' => get_the_post_thumbnail_url($post, 'full'), 'title' => get_the_title($post), 'url' => get_the_permalink($post), ); open_log($postData); …
This problem started when I wanted to create a new post. I'm using the Elementor editor, so I created a new post, set the title and featured image and then clicked on "Edit with Elementor" as usual. While Elementor was loading, I got this error. My first thought was that this is an Elementor issue. But then I tried to first create a new post and then save it as a draft or publish it first before editing it with …