ID; /* Check that the user hasn't already clicked to ignore the message */ if( !get_user_meta( $user_id, 'business_press_ignore_notice' ) ) { echo '

'; printf( __( 'Thank you for activating Business Press theme. Let start from Documentation | Visit Demo | Hide it', 'business-press' ), 'https://ewptheme.com/business-press-free-wordpress-theme/', 'http://business-press.ewptheme.com/', '?business_press_notics_ignore=0' ); echo "

"; } } add_action( 'admin_notices', 'business_press_admin_notice' ); // if link of ignore notice clicked, store user meta function business_press_handle_notic() { global $current_user; $user_id = $current_user->ID; if( isset( $_GET['business_press_notics_ignore']) && '0' == $_GET['business_press_notics_ignore'] ) { add_user_meta( $user_id, 'business_press_ignore_notice', 'true', true ); } } add_action( 'admin_init', 'business_press_handle_notic' ); //delete handle_notic user meta data on theme switch function business_press_delete_user_meta_ignore_notice() { global $current_user; $user_id = $current_user->ID; if( get_user_meta( $user_id, 'business_press_ignore_notice' ) ) { delete_user_meta( $user_id, 'business_press_ignore_notice' ); } } add_action('switch_theme', 'business_press_delete_user_meta_ignore_notice'); /* Display a notice that can be dismissed END */ //custom excerpt length function business_press_custom_excerpt_length( $length ) { return absint( get_theme_mod( 'business_press_excerpt_length', '57' ) ); } add_filter( 'excerpt_length', 'business_press_custom_excerpt_length', 999 ); //custom excerpt last ...... replace function business_press_excerpt_more( $more ) { global $post; return ' ' . esc_attr__( 'Read more', 'business-press' ) . '…'; } add_filter( 'excerpt_more', 'business_press_excerpt_more', 1001 ); //add class="table table-bordered" to default calendar function business_press_calendar_modify( $html ) { return str_replace( 'id="wp-calendar"', 'id="wp-calendar" class="table table-bordered"', $html ); } add_filter( 'get_calendar', 'business_press_calendar_modify' ); function business_press_comment_form_fields( $fields ) { $commenter = wp_get_current_commenter(); $req = esc_attr( get_option( 'require_name_email' ) ); $aria_req = ( $req ? " aria-required='true'" : '' ); $html5 = current_theme_supports( 'html5', 'comment-form' ) ? 1 : 0; $fields = array( 'author' => '
' . ' ' . '
', 'email' => '
' . '
', 'url' => '
' . '
' ); return $fields; } add_filter( 'comment_form_default_fields', 'business_press_comment_form_fields' ); function business_press_comment_form( $args ) { $args['comment_field'] = '
'; $args['class_submit'] = 'bpressbtn'; // since WP 4.1 return $args; } add_filter( 'comment_form_defaults', 'business_press_comment_form' ); /* * @ add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function ); */ function business_press_theme_options_page() { add_theme_page( esc_attr__( 'Business Press Options', 'business-press') , esc_attr__( 'Business Press Options', 'business-press') , 'edit_theme_options', 'customize.php?autofocus[panel]=business_press_options', '' ); } add_action( 'admin_menu', 'business_press_theme_options_page' ); /* * Add Custom Shortcut Links to WordPress Toolbar */ function business_press_toolbar_link( $wp_admin_bar ) { // Don't display menu in admin bar if current_user_can not manage_options if( !current_user_can( 'manage_options' ) ) { return; } // Add main link $args = array( 'id' => 'business_press_toolbar_link_main', 'title' => __( 'Business Press Options', 'business-press' ), 'href' => get_dashboard_url() . 'customize.php?autofocus[panel]=business_press_options', ); $wp_admin_bar->add_node( $args ); // Add the first child link $args = array( 'id' => 'business_press_toolbar_link_pro', 'title' => 'Try Business Press Pro', 'href' => 'http://ewptheme.com/product/business-press-pro-wordpress-theme/', 'parent' => 'business_press_toolbar_link_main', 'meta' => array( 'target' => '_blank' ) ); $wp_admin_bar->add_node($args); } add_action( 'admin_bar_menu', 'business_press_toolbar_link', 999 ); function business_press_the_head_callbk() { ?> get_setting( 'custom_logo' )->transport = 'refresh'; } add_action( 'customize_register', 'business_press_logo_refresh' );