add_filter( ‘aioseo_schema_output’, function ( $schema ) { foreach ( $schema as &$schemaItem ) { if ( isset( $schemaItem[‘@type’] ) && ‘Product’ === $schemaItem[‘@type’] ) { if(!empty($schemaItem[“offers”][“shippingDetails”])){ // Loop inside the Offers > shippingDetails schema foreach( $schemaItem[“offers”][“shippingDetails”] as &$schemaItemChild ){ //…Continue reading
/** * Disable the emojis in WordPress. */ add_action( ‘init’, function () { remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); remove_filter( ‘wp_mail’,…Continue reading
add_action( ‘wp’, ‘example_charitable_update_donation_fields’ ); function example_charitable_update_donation_fields() { // Get the donation fields. $fields = charitable()->donation_fields(); // Get the field we want to update. $field = $fields->get_field( ‘state’ ); // Update the field’s label to say “Province” on the donation form…Continue reading
add_filter( ‘display_post_states’, ‘bu_style_post_state_bricks’, 15, 2 ); function bu_style_post_state_bricks ($post_states, $post) { if( isset( $post_states[‘bricks’] ) ) { if( current_user_can( ‘edit_posts’, $post->ID ) ) { $bricks_edit_link = get_permalink($post->ID) . ‘?bricks=run’; $post_states[‘bricks’] = ‘‘ . $post_states[‘bricks’] . ‘‘; } else { $post_states[‘bricks’]…Continue reading
add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading
/* ————————————————————————- * * Gravity Form: Replace custom merge tags /* ————————————————————————- */ add_filter( ‘gform_replace_merge_tags’, function ( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) { if ( strpos( $text, ‘{current_hour}’ ) !== false ) { $text = str_replace( ‘{current_hour}’,…Continue reading
// Shortcode for the site title function site_title_shortcode() { $name = get_bloginfo(‘name’); return $name; } add_shortcode(‘site-title’, ‘site_title_shortcode’);Continue reading
// Shortcode for current year function year_shortcode() { $year = date_i18n(‘Y’); return $year; } add_shortcode(‘year’, ‘year_shortcode’);Continue reading
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );Continue reading