Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields
Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields
Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields
Assuming that if wp_sitemaps_enabled has a filter and it has that because we wanted to set it to false, otherwise it defaults to true for public sites. So I would just use and check whether it is filtered or not: add_filter( ‘wp_sitemaps_enabled’, ‘__return_false’ ); if (has_filter( ‘wp_sitemaps_enabled’) === true) { add_filter(‘option_home’, ‘any_callback_function’); } else { …
Oddly, the cause of the problem seems to be the quotation marks around the comparison parameter. For example filter[meta_query][0][compare]=%27=%27 now needs to be filter[meta_query][0][compare]==. When only matching one meta value, this is not necessary, when matching two, this is, now, necessary. :/ Update: I realised that my hosting provider changed the version of Linux on …
Change password reqts with NO plugin without breaking resetpass link?
Is it possible to dynamically change the “page_for_posts” option?
This is working perfectly for me but, is this an acceptable WP way to do it? If it works and you didn’t modify core or internal WP private objects then the way you did it is fine. I’m asking because somewhere I read you should not use wp_get_current_user for something like this but since it’s …
So you’re trying to call the hide_empty_fields() and maybe_add_disclaimer_and_courtesy() methods in the Register_Impress_Shortcodes class, from within a global function, and it’s not impossible to call class methods from within such global functions, but you cannot use $this in your function because $this is only available from within a class method which is called from within …
The wp_sitemaps_enabled filter is filtering the value returned by WP_Sitemaps::sitemaps_enabled(). You can get the global instance of WP_Sitemaps with wp_sitemaps_get_server, which means you can get the value of sitemaps_enabled() like this: $sitemaps = wp_sitemaps_get_server(); $enabled = $sitemaps->sitemaps_enabled(); if ( $enabled ) { }
I was looking into this because all of the text was not showing on my slider, and the slider had a height set with overflow: hidden. I didn’t think there was a simpler solution than to create a filter for the_content until I stumbled across this one… It’s a css solution 🙂 All I am …
Try: function allow_daniel_edit( $caps = array(), $cap = ”, $user_id = 0, $args = array() ) { if ($user_id == 59) { return array( ‘bp_moderate’ ); // or some other permission or additional permissions } return $caps; } add_filter( ‘map_meta_cap’, ‘allow_daniel_edit’, 999, 4 );