add_action(‘admin_init’, function () { global $wp_post_types; if (isset($wp_post_types[‘frm_display’])) { $post_type = $wp_post_types[‘frm_display’]; $post_type->public = true; $post_type->show_ui = true; $post_type->show_in_nav_menus = true; } });Continue reading
function acf_field_shortcode($atts) { $atts = shortcode_atts(array( ‘field’ => ”, ‘post_id’ => false, ), $atts, ‘acf’); if (function_exists(‘get_field’)) { $field_value = get_field($atts[‘field’], $atts[‘post_id’]); // If the field is an array (like a select, relationship, or taxonomy field) if (is_array($field_value)) { $output…Continue reading
add_action(‘template_redirect’, ‘rd_mobile_redirect’); function rd_mobile_redirect() { // 1. Don’t redirect if we are in the editor or doing ajax if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) return; if ( isset( $_GET[‘elementor-preview’] ) ) return; // 2. Detect Mobile Devices $is_mobile…Continue reading
/** * Gravity Wiz // Gravity Forms // Format Date Merge Tags * https://gravitywiz.com/gravity-forms-date-merge-tags/ * * Adds merge tag modifiers for formatting date merge tags using PHP Date Formats. * * Plugin Name: Gravity Forms — Format Date Merge Tags…Continue reading
add_filter( ‘fkcart_item_image_size’, function(){ return ‘thumbnail’; } );Continue reading
add_filter(‘pre_schedule_event’, function ($pre, $event /*, $wp_error */) { if (is_object($event) && isset($event->hook) && $event->hook === ‘siteground_optimizer_purge_cron_cache’) { $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 18); $lines = []; foreach ($bt as $f) { $fn = (isset($f[‘class’]) ? $f[‘class’] . ($f[‘type’] ?? ”) : ”)…Continue reading
function stq_change_auth_cookie_expiration_period( $expiration_period ) { $expiration_period = MONTH_IN_SECONDS; // 1 month return $expiration_period; } add_filter( ‘auth_cookie_expiration’, ‘stq_change_auth_cookie_expiration_period’ );Continue reading
/** * Hide “Back to WordPress Editor” button but preserve spacing. */ function my_hide_elementor_back_to_wp_button() { if ( is_admin() ) { ?>Continue reading
add_filter( ‘wp_inline_script_attributes’, function ( $attributes, $javascript ) { if ( strpos( $javascript, ‘gform.’ ) ) { $attributes[‘data-cfasync’] = ‘false’; } return $attributes; }, 10, 2 );Continue reading