How to add a SAVE button to replace PUBLISH on a custom post type?

Not mine but modified from here. But if you pop this into functions.php or a plugin it will work. add_filter( ‘gettext’, ‘change_publish_button’, 10, 2 ); function change_publish_button( $translation, $text ) { if ( ‘yourcustomposttype’ == get_post_type()) if ( $text == ‘Publish’ ) return ‘Save’; return $translation; }

Every possible way to get data (posts) from WordPress

Since you aren’t able to use the out-of-the-box functionality (i.e. not publishing the posts!) you will inevitably have to cover yourself in a few different ways. You seem to have most of them covered – but a couple more ideas: The single post page itself. Assuming you are OK with the post never being visible … Read more

the_modified_date returns published date

I think that you are using Parsidate plugin to convert dates to Hijri date. The plugin since the current version(2.2.2) returns the published date for both the_date and the_modified_date functions. This is a bug that i reported it to them. For now, you can use the wp-jalali plugin instead, that solved the problem for me.

How to do conditional publishing?

That’s because the hook “transition_post_status” is called: After the post has been published or updated in the database After the status has been updated in the database. Based on your problem statement, I believe the hook you want is “pre_post_update”, as stated in relevant WordPress source code: /** * Fires immediately before an existing post … Read more

Posts created in a Custom Post Type are lost if published without a title

The function that’s in charge of saving posts on the database (wp_insert_post) requires at the minimum a title and content: http://codex.wordpress.org/Function_Reference/wp_insert_post Edit: I created a quick and dirty jquery solution. Input this in your functions file or in a plugin: <?php add_action(‘admin_head’, ‘post_title_check’); function post_title_check() { ?><script type=”text/javascript”> jQuery(document).ready(function($) { $(‘input[name=”save”]’).click(function() { if($(‘input[name=”post_title”]’).val() ===”) { … Read more

Unpublish all posts in a category

You need to get the published posts in the category then run wp_update_post() inserting the new status. Here is a quick function. I am attaching it to admin init. I would also turn it off after your statuses are updated. function wpse_55018_get_update() { for( $i = 0; $i < 10; $i++ ) { // Runs … Read more