get( 'Version' ); $version_string = is_string( $theme_version ) ? $theme_version : false; /** * Add theme page */ function aploblocks_appearance_menu() { add_theme_page( esc_html__( 'AploBlocks', 'aploblocks' ), esc_html__( 'AploBlocks', 'aploblocks' ), 'edit_theme_options', 'aploblocks-theme', 'aploblocks_theme_page' ); } add_action( 'admin_menu', 'aploblocks_appearance_menu' ); /** * Display About page * * * * * Name ); ?> */ function aploblocks_theme_page() { $theme = wp_get_theme(); wp_enqueue_style( 'aploblocks-theme-admin', get_template_directory_uri() . '/assets/css/admin.css',array(),$version_string ); ?>

get( 'Version' ); ?>

get( 'Version' ); // check if we could display the notice bar if (!can_display_notice()) { return; } // already checked for 0, get state $notice_required = check_plugin_state(); wp_enqueue_style( 'aploblocks-theme-admin', get_template_directory_uri() . '/assets/css/admin.css',array(),$version_string ); wp_register_script( 'aploblocks-plugin-notice',get_template_directory_uri() . '/assets/js/admin.js',array('wp-api-fetch'),"0.9.5",true ); wp_enqueue_script( 'aploblocks-plugin-notice' ); wp_localize_script( 'aploblocks-plugin-notice', 'aploblocks', array( 'nonce' => wp_create_nonce( 'aploblocks-welcome-notice-nonce' ), 'ajaxUrl' => esc_url( admin_url( 'admin-ajax.php' ) ), 'pluginStatus' => $notice_required, 'pluginSlug' => 'aploblocks', 'activating' => __( 'Activating', 'aploblocks' ) . '…', 'installing' => __( 'Installing', 'aploblocks' ) . '…', 'respButtonOk' => __( 'Success', 'aploblocks' ), 'respButtonFail' => __( 'Error', 'aploblocks' ), 'respOk' => __( 'Aploblocks plugin successfully activated', 'aploblocks' ), 'respFail' => __( 'There was a problem setting up the plugin. Please attempt to setup through the plugin page', 'aploblocks' ), ) ); ?>

id, array( 'dashboard', 'themes','plugins' )) ) { return false; } if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return false; } if ( ! current_user_can( 'install_plugins' ) ) { return false; } return true; } // check the current state of the plugin function check_plugin_state() { if ( file_exists( ABSPATH . 'wp-content/plugins/aploblocks/aploblocks.php' ) ) { // is_plugin_active if (in_array( 'aploblocks/aploblocks.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )) { return 0; } else { return 1; } } return 2; }