Beispiel #1
0
/**
 * Initialize anything needed for admin panel to run.
 *
 * @since 2.0.0
 */
function themeblvd_admin_init()
{
    // Allow theme options page to run if framework filters
    // have don't have it hidden it and user is capable.
    if (themeblvd_supports('admin', 'options') && current_user_can(themeblvd_admin_module_cap('options'))) {
        // Access Options API, instance should already be created.
        $api = Theme_Blvd_Options_API::get_instance();
        // Option ID the theme options are registered and
        // saved to. -- i.e. get_option( $option_name )
        $option_id = $api->get_option_id();
        // All options constructed from framework and
        // potentially added to by client API.
        $options = $api->get_formatted_options();
        // Arguments for theme options admin page.
        // Filterable with "themeblvd_theme_options_args"
        $args = $api->get_args();
        // Theme Options Page
        $options_page = new Theme_Blvd_Options_Page($option_id, $options, $args);
    }
}
 /**
  * Allow "refresh" transport type settings to
  * work right in the Customizer.
  *
  * Note: Hooked to "wp_loaded".
  *
  * @since 2.3.0
  */
 function themeblvd_customizer_preview()
 {
     global $wp_customize;
     // Check if customizer is running.
     if (!is_a($wp_customize, 'WP_Customize_Manager')) {
         return;
     }
     // Reset themeblvd settings after Customizer
     // has applied filters.
     if ($wp_customize->is_preview()) {
         $api = Theme_Blvd_Options_API::get_instance();
         $api->set_settings();
     }
 }
Beispiel #3
0
 /**
  * For each theme, we use a unique identifier to store
  * the theme's options in the database based on the current
  * name of the theme. This is can be filtered with
  * "themeblvd_option_id".
  *
  * @since 2.1.0
  */
 function themeblvd_get_option_name()
 {
     $api = Theme_Blvd_Options_API::get_instance();
     return $api->get_option_id();
 }
Beispiel #4
0
/**
 * Get current page identifiers and keys for what we consider
 * admin modules. By default, this includeds:
 * 1) Theme Options
 * 2) Layout Builder 	(plugin)
 * 3) Widget Areas 		(plugin)
 * 4) Sliders 			(plugin)
 *
 * @since 2.3.0
 */
function themeblvd_get_admin_modules()
{
    // Options page
    $api = Theme_Blvd_Options_API::get_instance();
    $args = $api->get_args();
    $options_page = sprintf('%s?page=%s', $args['parent'], $args['menu_slug']);
    // Admin modules
    $modules = array('options' => $options_page, 'builder' => 'admin.php?page=themeblvd_builder', 'sidebars' => 'themes.php?page=themeblvd_widget_areas', 'sliders' => 'admin.php?page=themeblvd_sliders');
    return apply_filters('themeblvd_admin_modules', $modules);
}