Trigger a Link once a new post is Published

1- Just use jquery on form submit. jQuery(document).ready(function ($) { //default wordpress new post form id = #post $(“#post”).submit(function () { $.ajax({ url: “http://YOUR URL”, success: function (response) { console.log(“CALL OK!”); }, error: function () { console.log(“CALL FAILED!”); } }); }); }); 2- Put this code inside your theme: make new file, put the code … Read more

Will removing tags move Posts to Trash?

No, deleting tags, or any other terms, does not remove any posts. It shouldn’t even “touch” posts table. All it does is (you can see the code yourself: https://core.trac.wordpress.org/browser/tags/4.9.6/src/wp-includes/taxonomy.php#L1664): remove given term remove this term from all posts refresh caches But… There are some hooks in it, so some plugin or theme can modify this … Read more

add_rewrite_rules for type of post

the URL index.php?pagename=to-kill-a-mockingbird&post_type=book&book_type=fiction works only for simple post or page. when you have a custom post type, the URL is index.php?book=to-kill-a-mockingbird&book_type=fiction. then try this code : add_rewrite_rule( ‘^books/fiction/([^/]*)/?$’ , ‘index.php?book=$matches[1]&book_type=fiction’ , ‘top’ );

Duplicating Table of Contents for Paginated Post

You split post content into multiple pages with <!–nextpage–>, so you can use $page_number = get_query_var( ‘page’ ) to get current page number and global variable $numpages to get the number of pages in current post. Displaying table of content: global $numpages; $post_link = get_permalink(); $page_number = get_query_var( ‘page’ ); $toc = [ 1=>’Introduction’, ‘I2C … Read more

Reset Popular post query?

If you’re ok resetting it weekly – as in have views start from 0 every Monday – rather than trying to show the most read in the last 7 days, then the simplest change would be to have a different meta key for every week of the year. Then when you query the posts, you … Read more

Plain permalinks not working!

Plain permalinks of the form /?p=14523 (or /index.php?p=14523) don’t necessarily need any .htaccess file since they don’t require mod_rewrite to rewrite the URL (unlike the the custom permalinks you mention). However, for a URL of the form /?p=14523 (as opposed to /index.php?p=14523), where you don’t explicitly state the index document (ie. index.php) in the URL … Read more

How to disable edit post option 12 hours after post publication for contributors?

The other suggestions (and the accepted answer in your link) temporarily change a user’s capabilities globally. That is a hack. There is hook specifically designed for conditionally adjusting capabilities for specific content: map_meta_cap. When WordPress checks whether a user can edit a post, it checks if the user can edit_post. WordPress decides which actual capability … Read more