Different permalink for posts and authors

I would just change the author_base on the global $wp_rewrite object. Also add a field to the Permalink options page, so you can change it at will. To start: a class to wrap everything up. <?php class Custom_Author_Base { const SETTING = ‘author_base’; private static $ins = null; public static function instance() { is_null(self::$ins) && … Read more

Use an attachment in multiple posts

When inside of the media uploaded in the post edit screen, just search for your previously attached media and embed it in your new post. The relationship between posts and attachments is preserved in the database. While an attachment can only belong to one post, it can still be embedded in many posts without worry.

How can I see a list of pages and post where my custom Gutenberg block is used?

General block name search One can e.g. use the general search in the /wp-admin backend to find some text within the post’s content that stores the blocks: We can search for a prefixed block name wp:my-plugin/my-block within the posts: example.com/wp-admin/edit.php ?s=wp:my-plugin%2Fmy-block%20&post_type=post where we have an extra space (url encoded as %20and / as %2F) after … Read more

Highlight a Featured Post?

Use the “sticky” feature. In the “Page Attributes” metabox (labelled as Publish), if you click the “edit” link next to the Visibility option, there is a checkbox which allows you to “Stick this post to the front page”. Unless a theme overrides the default query, that post will show up above all the others. In … Read more

Disallow Same Post Title

Main Code Please check the auxiliary code after this block /* * Prevent Duplicated Titles * */ if( is_admin() ) // check if we are in the administrative area { add_action( ‘save_post’, ‘wpse_54258_check_for_duplicate_title’, 11, 2 ); add_action( ‘admin_head-post.php’, ‘wpse_54258_check_for_notice’ ); } /* * Checks for more than one post with the same title * * … Read more

Category checkbox list tree changes when editing a post

Category-list uses the function wp_terms_checklist() in wp-admin/includes/template.php on row 90. The parameter “checked_ontop” is set to true. So the checked checkboxes will be on top. This is only happening when editing a post, when I add a new one everything is fine and dandy Thats because when you create a post, none of the categories … Read more