// Clean up HTML from blog posts function add_custom_cleanup_checkbox() { add_meta_box( ‘custom_cleanup_id’, // ID of the meta box ‘Custom Cleanup’, // Title of the meta box ‘custom_cleanup_checkbox_callback’, // Callback function ‘post’, // Post type ‘side’, // Context ‘high’ // Priority…Continue reading
add_filter( ‘charitable_report_overview_args’, ‘example_charitable_report_overview_defaults’, 999 ); function example_charitable_report_overview_defaults( $defaults = array() ) { // Defaults array contains: // start_date, end_date, filter, campaign_id, category_id. // The $defaults array contains the default values for the report overview. // You can modify these as…Continue reading
add_action( ‘after_setup_theme’, function() { remove_theme_support( ‘core-block-patterns’ ); });Continue reading
add_filter( ‘render_block_tasty-roundups/item’, function ( $block ) { $initial_block = $block; $block = preg_replace( ‘~Continue reading
/** * Add a custom product data tab */ add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs[‘test_tab’] = array( ‘title’ => __( ‘Shipping Info’, ‘woocommerce’ ), ‘priority’ => 50, ‘callback’ => ‘woo_new_product_tab_content’ );…Continue reading
/** * Avoid Typography Widows */ function kl_avoid_content_widows( $content ) { $pattern = ‘@(?:\s)([[:punct:][:word:]]+)(?:\s)(?!/>)([[:punct:][:word:]]+)(?:\s)([[:punct:][:word:]]+)@m’; $replacement = ‘ $1 $2 $3‘; $content = preg_replace( $pattern, $replacement, $content, -1 ); return $content; } add_filter( ‘the_content’, ‘kl_avoid_content_widows’ );Continue reading
function remove_noscript_tags($html) { return preg_replace(‘/(.*?)/is’, ”, $html); } add_filter(‘the_content’, ‘remove_noscript_tags’);Continue reading