New answers tagged

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 ...
Dvaeer's user avatar
  • 619
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 ...
mrwweb's user avatar
  • 10.1k
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 * @...
Aristocles's user avatar
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 ...
Pat J's user avatar
  • 11.2k
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 (...
ammar alshmery's user avatar
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 : $...
imagIne's user avatar
  • 11
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 ...
Zollie's user avatar
  • 136

Top 50 recent answers are included