function disable_dashboard_access() { $file = basename( $_SERVER[‘PHP_SELF’] ); if ( is_user_logged_in() && is_admin() && ! current_user_can( ‘edit_posts’ ) && $file != ‘admin-ajax.php’ ) { wp_redirect( home_url() ); exit; } } add_action( ‘init’, ‘disable_dashboard_access’ );Continue reading
remove_action( ‘wp_footer’, ‘wpcomsh_footer_rum_js’ ); // remove frontend // remove_action( ‘admin_footer’, ‘wpcomsh_footer_rum_js’ ); // remove backendContinue reading
/** * LexiPress: Dynamic External Retailer Button Injector * Pulls URLs from WooCommerce Custom Fields and renders a styled button grid. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } add_action( ‘woocommerce_single_product_summary’, ‘lexipress_render_retailer_buttons’, 30 ); function lexipress_render_retailer_buttons() {…Continue reading
add_shortcode(‘ptr_faqs’, function () { if (!function_exists(‘get_field’)) return ”; $faqs = get_field(‘faqs’, ‘option’); if (empty($faqs)) return ”; $out = ‘ ‘; foreach ($faqs as $i => $faq) { $q = isset($faq[‘question’]) ? $faq[‘question’] : ”; $a = isset($faq[‘answer’]) ? $faq[‘answer’] :…Continue reading
/** * Fix registered_at range filter when “Switch to website timezone” is enabled. */ add_filter( ‘wt_iew_user_export_args’, ‘wt_fix_registered_at_timezone_filter’, 20, 2 ); function wt_fix_registered_at_timezone_filter( $args, $form_data ) { $use_site_tz = class_exists( ‘Wt_Import_Export_For_Woo_Common_Helper’ ) && Wt_Import_Export_For_Woo_Common_Helper::get_advanced_settings( ‘default_time_zone’ ); if ( ! $use_site_tz ||…Continue reading
/** * Format exported user_registered in site timezone. */ add_filter( ‘hf_customer_csv_export_data’, ‘wt_format_exported_user_registered’, 10, 2 ); function wt_format_exported_user_registered( $row, $columns ) { if ( empty( $row[‘user_registered’] ) ) { return $row; } $use_site_tz = class_exists( ‘Wt_Import_Export_For_Woo_Common_Helper’ ) && Wt_Import_Export_For_Woo_Common_Helper::get_advanced_settings( ‘default_time_zone’ );…Continue reading
add_post_type_support( ‘page’, ‘excerpt’ );Continue reading
add_filter( ‘get_the_excerpt’, function( $excerpt ) { remove_filter( ‘the_content’, array( SiteOrigin_Panels::single(), ‘generate_post_content’ ) ); return $excerpt; } ); add_filter( ‘the_content’, function( $content ) { add_filter( ‘the_content’, array( SiteOrigin_Panels::single(), ‘generate_post_content’ ) ); return $content; }, 11 );Continue reading
add_action( ‘wp_head’, function() { if ( is_singular() ) { $banner_color = get_post_meta( get_the_ID(), ‘banner_color’, true ); if ( $banner_color ) { echo ‘ ‘; } } });Continue reading