add_filter(‘the_content’, ‘method’) does not trigger my custom method
add_filter(‘the_content’, ‘method’) does not trigger my custom method
add_filter(‘the_content’, ‘method’) does not trigger my custom method
Footnotes with dynamic title attributes?
From what I’m seeing in the github repo. get_current_user doesn’t exist. What you do have is wp_get_current_user, this function does this return _wp_get_current_user(); So now I checked what _wp_get_current_user does. It checks a global variable $global_user, if it’s not empty, return an instance of it (didn’t find any actions for that). If empty it does … Read more
You can change the logo in the block editor or site editor using the SlotFill system. Have a look at the this example code taken from https://developer.wordpress.org/block-editor/reference-guides/slotfills/main-dashboard-button/ import { registerPlugin } from ‘@wordpress/plugins’; import { __experimentalMainDashboardButton as MainDashboardButton } from ‘@wordpress/edit-post’; const MainDashboardButtonTest = () => ( <MainDashboardButton> Custom main dashboard button content </MainDashboardButton> ); … Read more
You can’t modify the parameters of a filter like that, that’s not what they’re there for. In the source code it’ll look something like this: $cookie = apply_filters( $cookie, $user_id, $expiration, $scheme, $token ); It’s explicitly looking for the value of $cookie. If you return the value for $expiration, things will break. The extra parameters … Read more
How to add custom HTML attribute to reusable block div in WordPress admin
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
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
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.
There is a convenient helper function in WP core called wp_list_filter(). Easy as: $male = wp_list_filter( $list, [ ‘gender’ => ‘male’ ] );