input( array( 'class' => 'cmb2-text-small', 'type' => 'number' ) ); } // sanitize the field add_filter( 'cmb2_sanitize_text_number', 'pmthemes_cmb2_sanitize_text_number', 10, 2 ); function pmthemes_cmb2_sanitize_text_number( $null, $new ) { $new = preg_replace( "/[^0-9]/", "", $new ); return $new; } // Mulitiple explodes // https://stackoverflow.com/questions/4955433/php-multiple-delimiters-in-explode function multiexplode($delimiters, $string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; } // Add Plugin Settings link on admin bar function pmthemes_ad_settings_node($wp_admin_bar){ $args = array( 'id' => 'pmthemes-ads', 'title' => 'Ad Settings', 'href' => '"' . esc_url( home_url() ) . '"/wp-admin/admin.php?page=pmthemes_ads', 'meta' => array( 'class' => 'pmthemes-ads-class' ) ); $wp_admin_bar->add_node($args); } add_action('admin_bar_menu', 'pmthemes_ad_settings_node', 100); // Check if any of the supported themes is active function pmthemes_check_supported_themes() { $theme = wp_get_theme(); if (( 'Genesis' == $theme->name || 'Genesis' == $theme->parent_theme ) || ( 'Newzline' == $theme->name || 'Newzline' == $theme->parent_theme ) || function_exists( 'pmthemes_setup' ) || function_exists( 'nichebarn_setup' )) { return true; } return false; }