Authors should not publish

The role you are describing is “Contributor”. So the option would be to use this role unless you still want to edit Author capabilities which would be done as follows: function disable_authors_publish_cap() { // Get author role object $author = get_role( ‘author’ ); // Remove the post publishing capability $author->remove_cap( ‘publish_posts’ ); } add_action( ‘init’, … Read more

Should you manually ping new WordPress posts?

This is one of those things I tend to call “ritualistic”. Search engines will never explicitly tell you either that pinging does anything or nothing at all. It’s there for them to use or do nothing at all about. From my experience semi–active WP site with basic decent SEO setup (such as sitemaps) would be … Read more

After I publish a post where does it go

You can just delete the posts from your wordpress site, but you are likely going to want to look at the media section of your wp site, as if you have many videos or photos on your site, those will take more space than just a post. When in your wp admin panel, on the … Read more

What is the reason for the new_to_publish hook not working?

When you create a new post, the initial post status is not new, but rather auto-draft. Try this: add_action(“draft_to_publish”, “doSomething”, 10,1); function doSomething($post){ global $post; $_SESSION[‘yeni’] = ‘test’; } echo $_SESSION[‘yeni’]; Also note that you may want to make sure your session is properly initialized. To verify the callback works at least, enable WP_DEBUG and … Read more

What is happening to make my Update/Publish button disabled?

Without seeing your specific situation, I cannot say whether this is what’s causing your issues or not, but this is my best guess. WordPress has this cool thing called the Heartbeat API. It pings the server periodically while you’re logged in and in the WordPress admin. It does a number of things to help improve … Read more

problem with publish date not always appearing [duplicate]

From the the_date() documentation: Will only output the date if the current post’s date is different from the previous one output. i.e. Only one date listing will show per day worth of posts shown in the loop, even if the function is called several times for each post. [Emphasis mine] You’re almost certainly looking for … Read more

Change the text of the publish button to Save

Put below code into your theme functions.php and try function change_publish_button( $translation, $text ) { if ( $text == ‘Publish…’ ) // Your button text $text=”Save”; return $text; } add_filter( ‘gettext’, ‘change_publish_button’, 10, 2 ); This one is worked for me Hope it will help you!

Get publish post link?

I used URL parameters and created a specific function called at init: add_action( ‘init’, ‘publish_post_status’ ); function publish_post_status($post_id){ if (isset($_GET[‘publish’]) && current_user_can(‘publish_posts’)) { if ($_GET[‘publish’] == “true”) { $current_post = get_post( $_GET[‘post_id’], ‘ARRAY_A’ ); $current_post[‘post_status’] = ‘publish’; wp_update_post($current_post); } } if (isset($_GET[‘queue’])) { if ($_GET[‘queue’] == “true”) { $current_post = get_post( $_GET[‘post_id’], ‘ARRAY_A’ ); $current_post[‘post_status’] … Read more

Custom save button shows ‘Are you sure you want to…’ dialog

SOLVED: Found the solution. Trick is to disable the autosave. But take care to only do this on a non-ajax save. add_action( ‘admin_enqueue_scripts’, ‘my_admin_enqueue_scripts’ ); function my_admin_enqueue_scripts() { if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return false; // don’t disable if it is an auto-autosave if ( ‘POST_TYPE’ == get_post_type() ){ wp_dequeue_script( ‘autosave’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)