What is the easiest way to create a custom field archive?

To create a custom field archive in WordPress where posts are filtered by a user_submit_name custom field, follow these steps: Register a Query Variable: This enables WordPress to recognize and use this variable in the URL. function register_query_vars( $vars ) { $vars[] = ‘user_submit_name’; return $vars; } add_filter( ‘query_vars’, ‘register_query_vars’ ); Modify the Archive Query: … Read more

Custom permalink for ‘post’ not working

Here are two ways to fix this: Use a Prefix for Single Posts: Modify your permalink structure for posts to include a prefix specifically for single posts. For example: guide/news/post/%postname%/ This way, single post URLs will look like site.com/guide/news/post/your-post-name/ and won’t match the blog list page pattern. Use a Separate Permalink Structure for the Blog … Read more

editPost without undo entry

Yes, editPost is a wrapper around editEntityRecord which according to the core/data docs takes an options object that supports undoIgnore: options Object: Options for the edit. options.undoIgnore [boolean]: Whether to ignore the edit in undo history or not. While you could use this, generally the need to use it implies a mistake or misunderstanding somewhere, … Read more

is_singular() in mu-plugins not working

When the active_plugins option is retrieved, WordPress does not yet know what page has been requested, so this approach will not work. In order to achieve your objective, you would selectively activate the plugin (rather than selectively deactivate the plugin), but this may cause problems and destabilize your site (untested): add_filter( ‘option_active_plugins’, static function ( … Read more