Add a filter conditionally based on frontpage
Add a filter conditionally based on frontpage
Add a filter conditionally based on frontpage
Better way to change the default password reset url with the woocommerce one?
apply_filters( $tag, $value, $param, $otherparam ) This is how the apply_filters function work. By default, the value is printed if no function is hooked with the filter. It’s not clear what directorist_icon( ‘fas fa-chevron-right’, false ) prints here. But if it is showing “next” string at the output, the filter is working right. If you … Read more
WordPress wp_lazy_loading_enabled returns loading attribute set to lazy
add_action() and add_filter() are the same function. If you look at the source you’ll see that add_action() just calls add_filter(). So yes, this it is technically possible to register a filter callback with add_action(). The difference between an action and a filter is that filters expect a return value, while actions do not. This is … Read more
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