Пример #1
0
function themify_admin_nav()
{
    $theme = wp_get_theme();
    add_menu_page('themify', $theme->display('Name'), 'manage_options', 'themify', 'themify_page', get_template_directory_uri() . '/themify/img/favicon.png', 50);
    add_submenu_page('themify', $theme->display('Name'), __('Settings', 'themify'), 'manage_options', 'themify', 'themify_page');
    if (Themify_Builder_Model::builder_check()) {
        add_submenu_page('themify', __('Builder Layouts', 'themify'), __('Builder Layouts', 'themify'), 'edit_posts', 'edit.php?post_type=tbuilder_layout');
        add_submenu_page('themify', __('Builder Layout Parts', 'themify'), __('Builder Layout Parts', 'themify'), 'edit_posts', 'edit.php?post_type=tbuilder_layout_part');
    }
    add_submenu_page('themify', 'themify_customize', __('Customize', 'themify'), 'manage_options', 'customize.php');
    add_submenu_page('themify', $theme->display('Name'), __('Documentation', 'themify'), 'manage_options', 'themify_docs', 'themify_docs');
}
Пример #2
0
function themify_builder_init()
{
    global $ThemifyBuilder, $Themify_Builder_Layouts;
    if (class_exists('Themify_Builder')) {
        if (Themify_Builder_Model::builder_check()) {
            $Themify_Builder_Layouts = new Themify_Builder_Layouts();
            $ThemifyBuilder = new Themify_Builder();
            $ThemifyBuilder->init();
            $themify_builder_plugin_compat = new Themify_Builder_Plugin_Compat();
            $themify_builder_import_export = new Themify_Builder_Import_Export();
        }
    }
    // class_exists check
    if (is_admin() && current_user_can('update_plugins')) {
        include THEMIFY_BUILDER_DIR . '/themify-builder-updater.php';
    }
}
Пример #3
0
function themify_admin_nav()
{
    $theme = wp_get_theme();
    $do = 'menu_page';
    /**
     * Add Themify menu entry
     * @since 2.0.2
     */
    call_user_func('add' . "_{$do}", 'themify', $theme->display('Name'), 'manage_options', 'themify', 'themify_page', get_template_directory_uri() . '/themify/img/favicon.png', '49.3');
    /**
     * Add Themify settings page
     * @since 2.0.2
     */
    call_user_func('add_sub' . $do, 'themify', $theme->display('Name'), __('Themify Settings', 'themify'), 'manage_options', 'themify', 'themify_page');
    if (Themify_Builder_Model::builder_check()) {
        /**
         * Add Themify Builder Layouts page
         * @since 2.0.2
         */
        call_user_func('add_sub' . $do, 'themify', __('Builder Layouts', 'themify'), __('Builder Layouts', 'themify'), 'edit_posts', 'edit.php?post_type=tbuilder_layout');
        /**
         * Add Themify Builder Layout Parts page
         * @since 2.0.2
         */
        call_user_func('add_sub' . $do, 'themify', __('Builder Layout Parts', 'themify'), __('Builder Layout Parts', 'themify'), 'edit_posts', 'edit.php?post_type=tbuilder_layout_part');
    }
    /**
     * Add Themify Customize submenu entry
     * @since 2.0.2
     */
    call_user_func('add_sub' . $do, 'themify', 'themify_customize', __('Customize', 'themify'), 'manage_options', 'customize.php');
    /**
     * Add submenu entry that redirects to Themify documentation site
     * @since 2.0.2
     */
    call_user_func('add_sub' . $do, 'themify', $theme->display('Name'), __('Documentation', 'themify'), 'manage_options', 'themify_docs', 'themify_docs');
}