Send email for pending post

I did a bit more research and this is what is working for me now. The admin will only get an update if a pending post is added or updated. add_action( ‘transition_post_status’, ‘pending_post_status’, 10, 3 ); function pending_post_status( $new_status, $old_status, $post ) { if ( $new_status === “pending” ) { $post_title = get_the_title( $post_id ); … 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

Sort / display recent posts by publish date

The Recent Posts widget, and the posts page for that matter, doesn’t display ordered by update date, it orders by published date. If it’s displaying by updated date then you must have a plugin somewhere that’s changing this behaviour, or are using something other than the standard Recent Posts widget.

how to execute some code after a post is published in WordPress [duplicate]

You’re looking for the save_post action. This allows you to add a function when a post is saved (updated). You can hook into it like this: function your_save_post_function( $post_id ) { } add_action( ‘save_post’, ‘your_save_post_function’ ); Remember to not change WordPress Core files, as these will be overwritten when WordPress is updated. You can put … 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

How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and … 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

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