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

Frontend post creation including image attachment

Well you have not mentioned whether your code worked or not because the blog you are following is amazing one. And you should have get the solution from that post. And regarding your question.. require_once(ABSPATH . ‘wp-admin/includes/image.php’); This is a core WordPress file which does all the manipulation on images and its meta data. Why … Read more

How to update the children of a post?

get_children returns an array of post objects by default: https://developer.wordpress.org/reference/functions/get_children/ So you would have to use ‘ID’ => $child->ID, in this case… also my want to wrap the foreach with if (count($children) > 0) {} to prevent possible errors where there are no children. ie: $children = get_children( $mainid ); if (count($children) > 0) { … Read more