how to output HTML tags in post_content and not as plain text
how to output HTML tags in post_content and not as plain text
how to output HTML tags in post_content and not as plain text
Instead of adding the filter inside of the add_action(), you need to call the filter directly. You have this in your functions.php file: function filter_after_setup_theme() { add_filter( ‘tc_bridge_for_woocommerce_content_order_table_is_after’, ‘__return_false’ ); } add_action(‘after_setup_theme’, ‘filter_after_setup_theme’); You are telling to WordPress to execute the filter when the action after_setup_theme happens (which is called before init hook, according to … Read more
My solution removes now all <link></link> tags and <style>@import url()</style> googleapi entries in the given HTML: add_action( ‘wp_footer’, ‘SPDSGVOPublic::removeGoogleFonts’ ); /** * Remove all occurrences of google fonts */ public static function removeGoogleFonts() { ob_start(); $content = ob_get_clean(); $patternImportUrl=”/(@import[\s]url\((?:”|\”)((?:https?:)?\/\/fonts\.googleapis\.com\/css(?:(?!\1).)+)(?:”|\’)\)\;)/’; $patternLinkTag = ‘/<link(?:\s+(?:(?!href\s*=\s*)[^>])+)?(?:\s+href\s*=\s*([\'”])((?:https?:)?\/\/fonts\.googleapis\.com\/css(?:(?!\1).)+)\1)(?:\s+[^>]*)?>/’; preg_match_all($patternImportUrl, $content, $matchesImportUrl); preg_match_all($patternLinkTag, $content, $matchesLinkTag); $matches = array_merge($matchesImportUrl,$matchesLinkTag); foreach( $matches as $match … Read more
I haven’t tested this, but I found a sample that was close. I have modified it to be similar to what you want. I’m not sure it is 100%, but it should get you really close: add_action(‘pre_get_posts’,’wpse_filter_parents_only’); function wpse_filter_parents_only($query){ if (!is_admin() && is_category(’26’)){ $query->set(‘post_parent’,0); } return $query; } This should update what WP_Query retrieves from … Read more
Maybe you can add a higher priority to your filter as the 3rd parameter of the hook: /** * Modify the data * * @param String $data * * @return String $data */ function change_title( $data ) { global $post; return ‘Page ID ‘ . $data; } add_filter( ‘the_title’, ‘change_title’, 15 ); The default priority … Read more
How can I filter same content in page
add_filter( ‘script_loader_tag’, function ( $tag, $handle ) { $handlesToDefer = array(‘jquery-migrate’, ‘bootstrap’, ‘jquery-core’); if ( !in_array($handle, $handlesToDefer) ) return $tag; return str_replace( ‘ src’, ‘ defer=”defer” src’, $tag );
Right filter for rewriting page statuscode
Here is the working solution: add_action( ‘elementor/query/my-custom-query’, function( $query ) { $meta_query = $query->get( ‘meta_query’ ); $query->set( ‘date_query’, array( array( ‘after’ => date(‘l, F jS, Y’, strtotime(‘+0 day’)), ) ) ); } ); You can change the strtotime (+1 day….+n day ….-n day) to fetch the event’s date you’re looking for. The date format here … Read more
If you want to remove some or all (default) help tabs, then you could do something like this inside your function. $current_screen = get_current_screen(); $white_list = array( ‘overview-link’, // If you want to keep default some tab title and content ); if ( $current_tabs = $current_screen->get_help_tabs() ) { foreach ($current_tabs as $tab_key => $tab_config) { … Read more