Removing URL and adding container around image in the featured image metabox

I am not sure why you want to do this, but you can accomplish it with preg_replace(). Try adding this to your theme’s functions.php: add_filter( ‘admin_post_thumbnail_html’, ‘remove_featured_image_link’ ); function remove_featured_image_link($content) { $content_edit = preg_replace(‘/<a .*?class=”(.*?thickbox.*?)”>(.*?)<\/a>/’,'<div>$2</div>’,$content); return $content_edit; }

Override email_exists function

Note: The reason this doesn’t work for the OP is the use of woocommerce, otherwise, so in regards of core WordPress functionality, this should be working as described. Update: I assumed it is about emails on registration. Good thing you specified your needs. WordPress tries – several checks are performed – to add the new … Read more

Custom nav walker: How to acces the $args parameter?

WordPress Walkers aren’t using constructors. They are started up with walk() method which is passed arguments as third argument (confusingly not reflected in method signature). You can capture it into your object’s property with something like this: class Args_Walker extends Walker { public function walk( $elements, $max_depth ) { // we could declare above, but … Read more

How to query if meta_key does exist or not?

Adding a NOT EXISTS clause should force LEFT JOINs: ‘meta_query’ => array( ‘relation’ => ‘OR’, array(‘key’ => ‘file_gallery’, ‘value’ => ‘1’, ‘compare’ => ‘!=’), array(‘key’ => ‘file_gallery’, ‘compare’ => ‘NOT EXISTS’), ),

paginate_links() Change the order of links

You cannot do this with the default paginate_links() functions. Looking at the source code, there are no filters from which you can change the layout as you wish ALTERNATIVE SOLUTIONS Although you cannot do this by default, it doesn’t mean that you cannot get your desired output. Here is a couple of options to explore … Read more

Apply wordpress filter checking category

Thanks for the response David. I found the solution. I added the following code in functions.php add_filter(‘get_the_excerpt’, ‘process_excerpt’); function process_excerpt($param) { global $post; if(in_category(‘MY-CATEGORY-SLUG’,$post)) return ‘adding some data’.$param; else return $param; } This fixed my issue.

Remove comments validation (remove filter?)

If you take a look in source the condition for this message is get_option(‘require_name_email’). You can control it in Settings > Discussion > Comment author must fill out name and e-mail. The programmatic way could be add_filter( ‘pre_option_require_name_email’, ‘__return_null’ );

Problem with Class, Filters and Callbacks

Here’s a slightly modified version of your code snippet: add_action( ‘login_head’, [ ‘WPSE_Admin’, ‘plugin_setup’ ] ); class WPSE_Admin { public static function plugin_setup() { add_filter( ‘login_headerurl’, [ ‘WPSE_Admin’, ‘the_logo_url’ ] ); } public function the_logo_url() { return get_bloginfo(‘url’); } } The filter callbacks must be public, not private. The reason for this is that apply_filters()/apply_filters_ref_array() … Read more