Content Restriction but allow public REST API

You can use the REST_REQUEST constant to detect if this is a REST request, and if it’s not, apply your filter(s). Example: add_filter( ‘the_content’, ‘wpse418531_use_excerpt’ ); /** * Replaces the content with the excerpt, unless this is a REST request. * * @param string $content The post content. * @return string The filtered post content. … Read more

Limit ONE link per post

Take it as a starting point (not tested): /** * Limit links inside the content. * * @param (string) $content * @return (string) $content */ function wpse30754_limit_content_links( $content ) { // delete all <a> tags in the post $content = preg_replace( “/<a[^>]*><\\/a[^>]*>/”, ”, $content ); return $content; } add_filter( ‘the_content’, ‘wpse30754_limit_content_links’ ); What’s not yet … Read more

Editorial Process

Yes that’s the default behavior. When an “author” writes a post, he cannot publish it, only an “editor” (or higher) can do the publishing action. As for email notification, there are a couple of plugins for that, here are two : WP Status Notifier WP Pending Post Notifier

Set Value To Custom Field While Submit

Yes this is possible. If you’re adding a custom field by a meta box you could do like this: // add action to create your custom field add_action( ‘add_meta_boxes’, ‘create_meta_box’ ); // add a callback that will be called when saving the post add_filter( ‘save_post’, ‘save_meta_box’, 10, 2 ); // function that will create a … Read more

Trouble posting in Sub-Category

You have created a simple page name News from the Admin and displayed under the Blog Menu. You have to create a page template and use the WordPress loop to display your posts. You can use this code in your page template and select templates when you publish the page. $args = array( ‘post_type’ => … Read more

How to Query the Top 5 Posts of a specific category?

Well, depending on what you mean by top 5 posts. You can get top most read, top commented, most liked etc. For comments you can just make your query with argument orderby=comment_count If you want the most viewed, first you need to add the views counter like this: /********* Post Views counter ***********/ remove_action( ‘wp_head’, … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduseduseduseduedusedusedueduedus