array(
'name' => esc_html__( 'Front Page Builder', 'bulk-one-page' ),
'active_filename' => 'front-page-builder/front-page-builder.php',
/* translators: %1$s "Elementor Page Builder" plugin name string */
'description' => sprintf( esc_attr__( 'To take full advantage of all the features this theme has to offer, please install and activate the %s plugin.', 'bulk-one-page' ), '' . esc_html__( 'Front Page Builder', 'bulk-one-page' ) . '' ),
),
) );
}
add_action( 'after_setup_theme', 'bulk_one_page_header_image' );
/**
* New header image
*/
function bulk_one_page_header_image() {
add_theme_support( 'custom-header', apply_filters( 'bulk_setup_args', array(
'default-image' => get_stylesheet_directory_uri( ) . '/img/header.jpg',
'width' => 2000,
'height' => 1200,
'flex-height' => true,
'video' => false,
) ) );
}
/**
* Remove unused customizer sections
*/
function bulk_one_page_customize_register() {
global $wp_customize;;
$wp_customize->remove_section( 'theme_demo_content' );
$wp_customize->remove_section( 'customizer-plugin-notice-section' );
}
add_action( 'customize_register', 'bulk_one_page_customize_register', 11 );
add_action( 'after_setup_theme', 'bulk_one_page_setup', 99 );
function bulk_get_actions_required() {
$actions = array();
$front_page = get_option( 'page_on_front' );
$actions[ 'recommend_plugins' ] = 'dismiss';
if ( 'page' != get_option( 'show_on_front' ) ) {
$front_page = 0;
}
if ( $front_page <= 0 ) {
$actions[ 'page_on_front' ] = 'dismiss';
$actions[ 'page_template' ] = 'dismiss';
} else {
if ( get_post_meta( $front_page, '_wp_page_template', true ) == 'template-parts/template-homepage.php' || get_post_meta( $front_page, '_wp_page_template', true ) == 'template-parts/template-woocommerce.php' ) {
$actions[ 'page_template' ] = 'dismiss';
} else {
$actions[ 'page_template' ] = 'dismiss';
}
}
$recommend_plugins = get_theme_support( 'recommend-plugins' );
if ( is_array( $recommend_plugins ) && isset( $recommend_plugins[ 0 ] ) ) {
$recommend_plugins = $recommend_plugins[ 0 ];
} else {
$recommend_plugins[] = array();
}
if ( !empty( $recommend_plugins ) ) {
foreach ( $recommend_plugins as $plugin_slug => $plugin_info ) {
$plugin_info = wp_parse_args( $plugin_info, array(
'name' => '',
'active_filename' => '',
) );
if ( $plugin_info[ 'active_filename' ] ) {
$active_file_name = $plugin_info[ 'active_filename' ];
} else {
$active_file_name = $plugin_slug . '/' . $plugin_slug . '.php';
}
if ( !is_plugin_active( $active_file_name ) ) {
$actions[ 'recommend_plugins' ] = 'active';
}
}
}
$actions = apply_filters( 'bulk_get_actions_required', $actions );
$hide_by_click = get_option( 'bulk_actions_dismiss' );
if ( !is_array( $hide_by_click ) ) {
$hide_by_click = array();
}
$n_active = $n_dismiss = 0;
$number_notice = 0;
foreach ( $actions as $k => $v ) {
if ( !isset( $hide_by_click[ $k ] ) ) {
$hide_by_click[ $k ] = false;
}
if ( $v == 'active' ) {
$n_active ++;
$number_notice ++;
if ( $hide_by_click[ $k ] ) {
if ( $hide_by_click[ $k ] == 'hide' ) {
$number_notice --;
}
}
} else if ( $v == 'dismiss' ) {
$n_dismiss ++;
}
}
$return = array(
'actions' => $actions,
'number_actions' => count( $actions ),
'number_active' => $n_active,
'number_dismiss' => $n_dismiss,
'hide_by_click' => $hide_by_click,
'number_notice' => $number_notice,
);
if ( $return[ 'number_notice' ] < 0 ) {
$return[ 'number_notice' ] = 0;
}
return $return;
}
/**
* Remove unused tabs
*/
add_action( 'admin_init', 'bulk_one_page_remove_action');
function bulk_one_page_remove_action() {
remove_action( 'bulk_import_title', 'bulk_recommended_import_construct' );
}