How to use apply_filters(‘get_calendar’) to change get_calendar() output?

The get_calendar filter hook will allow you to modify the HTML generated by get_calendar() prior to displaying it. Duplicating the get_calendar() function in your functions.php file will throw a fatal error, since you’ll be redeclaring an existing function. (You can get around this by calling it something else, like function wpse410569_get_calendar(…), but I’d recommend using … Read more

How do you disable the verification process of user email changes?

As mentioned in the ticket #16470 this confirmation feature: prevents accidental or erroneous email address changes from potentially locking users out of their account. so it’s good to keep that in mind before removing this feature. Here’s a little proof of concept for (single site) test installs. We still want to run send_confirmation_on_profile_email() because it … Read more

str_replace css meta tag?

Don’t do that, use wp_enqueu_style with wp_register_style and wp_deregister_style http://codex.wordpress.org/Function_Reference/wp_enqueue_style http://codex.wordpress.org/Function_Reference/wp_register_style Also a $priority of 20k..why would you pick such an arbitrary number.

filter a list by gender

There is a convenient helper function in WP core called wp_list_filter(). Easy as: $male = wp_list_filter( $list, [ ‘gender’ => ‘male’ ] );

How to filter part of a variable if it is no array?

The documentation is well explicable of the topic, let’s have a look here https://developer.wordpress.org/reference/functions/apply_filters/. In your specific case my_filter is applied no matter what, even if there is no value it. To apply the filter only if is_array() you could insert a specific instruction directly into your filter like: function example_callback( $output ) { if(is_array($output)){ … Read more

NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]

There aren’t really any good filters/hooks that are going to allow you to place the custom drop down control where you’d like. What you should do instead is create a new template from an existing one, then add your widget code in. I’m going to edit “gallery.php”, but you must edit album.php or whichever gallery … Read more

Why does using excerpt_more filter change link location?

Filters are for modifying values before they are output. Typically the function is passed some value where you can modify it or overwrite it, then pass the result back. Your link is appearing out of place because you’re outputting the value directly, change it to return instead. Also note that most template tags have versions … Read more

Admin New Order: Autofocus on Search a product

This is a Backbone modal, wc-modal-add-products, defined in html-order-items.php and triggered by meta-boxes-order.js. You say you’ve marked the field autofocus. This StackOverflow answer proposed adding an onRender handler to the modal that finds autofocus and selects it: $(this.el).find(‘:input[autofocus]’).focus(); I don’t know where the best place to put this is, but if you find the WCBackboneModal … Read more

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