New answers tagged filters
0
votes
Add text below WooCommerce short description if metabox value is true
Following the suggestion by @1inmillion, I put the second filter inside the first IF statement, which works nicely.
This is the combined code:
// 1. Add text below short description
function ...
1
vote
Accepted
How to add a custom CSS class to core blocks in Gutenberg editor?
First, there's motion to potentially add this class by default in a future version of WordPress.
If you only need to add a class on the front-end of the site (the editor already has wp-block-list on ...
0
votes
Is there a hook that I can use when a fatal error occurs?
I figured it out with set_error_handler() rather than a hook:
/**
* Add user and url when an error occurs
*
* @param int $num
* @param string $str
* @param string $file
* @param string $line
* @...
0
votes
Is there a hook that I can use when a fatal error occurs?
Look into the WP_Fatal_Error_Handler class. I see a couple of filters in its display_default_error_template() method that might be helpful for you:
wp_php_error_args
wp_php_error_message
The entire ...
0
votes
coloring row's background based on custom field value
function add_custom_status_class( $classes, $class, $post_id ) {
if ( 'request' === get_post_type( $post_id ) ) {
$status = get_post_meta( $post_id, 'hrs_field_status', true );
if (...
0
votes
Accepted
WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
Resolved.
My error are there :
$FirstDayThisMonth[] = date('Y-m-01 00:00:01', mktime(0, 0, 0, $x, 1));
$LastDayThisMonth[] = date('Y-m-t 23:59:59', mktime(0, 0, 0, $x, 1));
instead of :
$...
1
vote
Accepted
How can I conditionally add the filter option_home?
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 ...
Top 50 recent answers are included
Related Tags
filters × 2947hooks × 471
functions × 313
actions × 310
plugins × 234
php × 217
custom-post-types × 204
plugin-development × 182
wp-query × 144
posts × 133
the-content × 125
woocommerce-offtopic × 121
categories × 119
customization × 98
shortcode × 93
menus × 92
images × 89
search × 82
theme-development × 78
custom-taxonomy × 77
custom-field × 71
loop × 61
wp-admin × 61
admin × 60
widgets × 57