Remove image of srcset

If you look in core, that filter is applied like so: $image_meta = apply_filters( ‘wp_calculate_image_srcset_meta’, $image_meta, $size_array, $image_src, $attachment_id ); Instead of using __return_empty_array you need to add a custom function to that filter to remove the srcset size you are trying to get rid of. Something like this. function my_srcset_function($image_meta) { if (!is_array($image_meta)) { … Read more

filter out

Removing the action is really what I intended as I’m not replacing the title. changing my last line to this works for what I was intending. remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 );

create a shortcode with acf including a filter

This is not the full working code, just to illustrate how to add the shortcode and trigger the function. <?php // Check if ACF is available if(function_exists(‘get_field’)) { function modell_nach_personenzahl_variabel() { $args = array( ‘post_type’ => ‘womos’, ‘order’ => ‘ASC’, ‘orderby’ => ‘personen’, ‘field’ => $atts[‘personen’], ‘numberposts’ => -1, ‘meta_query’ => array ( array ( … Read more

How to add_filter only when content is not empty?

Based on your edits, you want one function to apply to two different filters. All you need to do is use the same function on both filters. I haven’t tested this, but it should work: function content_image_markup($content) { if( !empty($content) ) { // example of changing the content $content=$content . ‘ append this to content’; … Read more

How can I change the button text of a custom widget?

In the Widgets section, this particular btn_text is set to [and always will be] Download Latest Update. I have a function that collects some version information that I want to append after the default btn_text, ie. Download Latest Update **v1.0.11(2019)** The widget has a filter named button_text which you could utilize to customize the button … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)