PHP Класс Envato_Theme_Setup_Wizard

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$errors
$logs
$site_styles

Защищенные свойства (Protected)

Свойство Тип Описание
$envato_username Theme author username, used in check for oauth.
$oauth_script Full url to server-script.php (available from https://gist.github.com/dtbaker )
$page_parent string The slug name for the parent menu
$page_slug string The slug name to refer to this menu
$page_url string Complete URL to Setup Wizard
$plugin_path string Relative plugin path
$plugin_url string Relative plugin url for this plugin folder, used when enquing scripts
$step Current Step
$steps Steps for the setup wizard
$tgmpa_instance object TGMPA instance storage
$tgmpa_menu_slug string TGMPA Menu slug
$tgmpa_url string TGMPA Menu url
$theme_name Current theme name, used as namespace in actions.
$version string The class version number.

Открытые методы

Метод Описание
__construct ( ) A dummy constructor to prevent this class from being loaded more than once.
_content_install_settings ( )
_get_json ( $file )
admin_menus ( ) Add admin menus/screens.
admin_redirects ( )
ajax_content ( )
ajax_plugins ( )
cleanFilePath ( string $path ) Helper function Take a path and return it clean
cmpr_strlen ( $a, $b ) return the difference in length between two strings
elementor_post ( $post_id = false )
enqueue_scripts ( )
envato_market_admin_init ( )
envato_market_http_request_args ( $args, $url ) : mixed
envato_setup_color_style ( )
envato_setup_color_style_save ( ) Save logo & design options
envato_setup_customize ( )
envato_setup_default_content ( ) Page setup
envato_setup_default_plugins ( ) Page setup
envato_setup_help_support ( )
envato_setup_introduction ( ) Introduction step
envato_setup_introduction_save ( ) Handles save button from welcome page. This is to perform tasks when the setup wizard has already been run. E.g. reset defaults
envato_setup_logo_design ( ) Logo & Design
envato_setup_logo_design_save ( ) Save logo & design options
envato_setup_ready ( ) Final step
envato_setup_updates ( ) Payments Step
envato_setup_updates_save ( ) Payments Step save
error ( $message )
filter_options ( $options )
get_default_theme_style ( ) Get the default style. Can be overriden by theme init scripts.
get_header_logo_width ( ) Get the default style. Can be overriden by theme init scripts.
get_instance ( ) : Envato_Theme_Setup_Wizard
get_logo_image ( ) Get the default style. Can be overriden by theme init scripts.
get_next_step_link ( )
get_oauth_login_url ( $return ) we can update the token there.
get_step_link ( $step )
get_tgmpa_instanse ( ) Get configured TGMPA instance
init_actions ( ) Setup the hooks, actions and filters.
init_globals ( ) Setup the class globals.
init_wizard_steps ( ) : array Setup steps.
is_possible_upgrade ( ) We determine if the user already has theme content installed. This can happen if swapping from a previous theme or updated the current theme. We change the UI a bit when updating / swapping to a new theme.
is_submenu_page ( )
log ( $message )
render_oauth_login_description_callback ( )
render_oauth_login_fields_callback ( )
set_tgmpa_url ( ) Update $tgmpa_menu_slug and $tgmpa_parent_slug from TGMPA instance
setup_wizard ( ) Show the setup wizard
setup_wizard_content ( ) Output the content for the current step
setup_wizard_footer ( ) Setup Wizard Footer
setup_wizard_header ( ) Setup Wizard Header
setup_wizard_steps ( ) Output the steps
switch_theme ( )
tgmpa_load ( $status )
upgrader_post_install ( $return, $theme ) After a theme update we clear the setup_complete option. This prompts the user to visit the update page again.
vc_post ( $post_id = false )

Приватные методы

Метод Описание
_array_merge_recursive_distinct ( $array1, $array2 ) : mixed
_cleanup_imported_ids ( )
_content_default_get ( )
_content_install_type ( )
_content_install_widgets ( )
_delay_post_process ( $post_type, $post_data )
_elementor_id_import ( &$item, $key )
_fetch_remote_file ( $url, $post )
_get_plugins ( )
_get_sql ( $file )
_handle_delayed_posts ( $last_delay = false )
_handle_post_orphans ( )
_imported_post_id ( $original_id = false, $new_id = false )
_imported_term_id ( $original_term_id, $new_term_id = false )
_manage_oauth_token ( $token )
_parse_gallery_shortcode_content ( $content )
_post_orphans ( $original_id = false, $missing_parent_id = false )
_process_post_data ( $post_type, $post_data, $delayed, $debug = false )

Описание методов

__construct() публичный Метод

A dummy constructor to prevent this class from being loaded more than once.
См. также: Envato_Theme_Setup_Wizard::instance()
С версии: 1.1.1
public __construct ( )

_content_install_settings() публичный Метод

_get_json() публичный Метод

public _get_json ( $file )

admin_menus() публичный Метод

Add admin menus/screens.
public admin_menus ( )

admin_redirects() публичный Метод

public admin_redirects ( )

ajax_content() публичный Метод

public ajax_content ( )

ajax_plugins() публичный Метод

public ajax_plugins ( )

cleanFilePath() публичный статический Метод

Helper function Take a path and return it clean
С версии: 1.1.2
public static cleanFilePath ( string $path )
$path string

cmpr_strlen() публичный Метод

return the difference in length between two strings
public cmpr_strlen ( $a, $b )

elementor_post() публичный Метод

public elementor_post ( $post_id = false )

enqueue_scripts() публичный Метод

public enqueue_scripts ( )

envato_market_admin_init() публичный Метод

envato_market_http_request_args() публичный Метод

public envato_market_http_request_args ( $args, $url ) : mixed
$args
$url
Результат mixed Filter the WordPress HTTP call args. We do this to find any queries that are using an expired token from an oAuth bounce login. Since these oAuth tokens only last 1 hour we have to hit up our server again for a refresh of that token before using it on the Envato API. Hacky, but only way to do it.

envato_setup_color_style() публичный Метод

envato_setup_color_style_save() публичный Метод

Save logo & design options

envato_setup_customize() публичный Метод

envato_setup_default_content() публичный Метод

Page setup

envato_setup_default_plugins() публичный Метод

Page setup

envato_setup_help_support() публичный Метод

envato_setup_introduction() публичный Метод

Introduction step

envato_setup_introduction_save() публичный Метод

Handles save button from welcome page. This is to perform tasks when the setup wizard has already been run. E.g. reset defaults
С версии: 1.2.5

envato_setup_logo_design() публичный Метод

Logo & Design

envato_setup_logo_design_save() публичный Метод

Save logo & design options

envato_setup_ready() публичный Метод

Final step
public envato_setup_ready ( )

envato_setup_updates() публичный Метод

Payments Step

envato_setup_updates_save() публичный Метод

Payments Step save

error() публичный Метод

public error ( $message )

filter_options() публичный Метод

public filter_options ( $options )

get_default_theme_style() публичный Метод

Get the default style. Can be overriden by theme init scripts.
См. также: Envato_Theme_Setup_Wizard::instance()
С версии: 1.1.7

get_header_logo_width() публичный Метод

Get the default style. Can be overriden by theme init scripts.
См. также: Envato_Theme_Setup_Wizard::instance()
С версии: 1.1.9

get_instance() публичный статический Метод

С версии: 1.1.3
public static get_instance ( ) : Envato_Theme_Setup_Wizard
Результат Envato_Theme_Setup_Wizard

get_logo_image() публичный Метод

Get the default style. Can be overriden by theme init scripts.
См. также: Envato_Theme_Setup_Wizard::instance()
С версии: 1.1.9
public get_logo_image ( )

get_oauth_login_url() публичный Метод

we can update the token there.
public get_oauth_login_url ( $return )

get_tgmpa_instanse() публичный Метод

Get configured TGMPA instance
С версии: 1.1.2
public get_tgmpa_instanse ( )

init_actions() публичный Метод

Setup the hooks, actions and filters.
С версии: 1.1.1
public init_actions ( )

init_globals() публичный Метод

Setup the class globals.
С версии: 1.1.1
public init_globals ( )

init_wizard_steps() публичный Метод

Setup steps.
С версии: 1.1.1
public init_wizard_steps ( ) : array
Результат array

is_possible_upgrade() публичный Метод

We determine if the user already has theme content installed. This can happen if swapping from a previous theme or updated the current theme. We change the UI a bit when updating / swapping to a new theme.
С версии: 1.1.8
public is_possible_upgrade ( )

is_submenu_page() публичный Метод

public is_submenu_page ( )

log() публичный Метод

public log ( $message )

render_oauth_login_description_callback() публичный Метод

render_oauth_login_fields_callback() публичный Метод

set_tgmpa_url() публичный Метод

Update $tgmpa_menu_slug and $tgmpa_parent_slug from TGMPA instance
С версии: 1.1.2
public set_tgmpa_url ( )

setup_wizard() публичный Метод

Show the setup wizard
public setup_wizard ( )

setup_wizard_content() публичный Метод

Output the content for the current step

setup_wizard_header() публичный Метод

Setup Wizard Header
public setup_wizard_header ( )

setup_wizard_steps() публичный Метод

Output the steps
public setup_wizard_steps ( )

switch_theme() публичный Метод

public switch_theme ( )

tgmpa_load() публичный Метод

public tgmpa_load ( $status )

upgrader_post_install() публичный Метод

After a theme update we clear the setup_complete option. This prompts the user to visit the update page again.
С версии: 1.1.8
public upgrader_post_install ( $return, $theme )

vc_post() публичный Метод

public vc_post ( $post_id = false )

Описание свойств

$envato_username защищенное свойство

Theme author username, used in check for oauth.
protected $envato_username

$errors публичное свойство

public $errors

$logs публичное свойство

public $logs

$oauth_script защищенное свойство

Full url to server-script.php (available from https://gist.github.com/dtbaker )
protected $oauth_script

$page_parent защищенное свойство

The slug name for the parent menu
С версии: 1.1.2
protected string $page_parent
Результат string

$page_slug защищенное свойство

The slug name to refer to this menu
С версии: 1.1.1
protected string $page_slug
Результат string

$page_url защищенное свойство

Complete URL to Setup Wizard
С версии: 1.1.2
protected string $page_url
Результат string

$plugin_path защищенное свойство

Relative plugin path
С версии: 1.1.2
protected string $plugin_path
Результат string

$plugin_url защищенное свойство

Relative plugin url for this plugin folder, used when enquing scripts
С версии: 1.1.2
protected string $plugin_url
Результат string

$site_styles публичное свойство

С версии: 1.1.8
public $site_styles

$step защищенное свойство

Current Step
protected $step

$steps защищенное свойство

Steps for the setup wizard
protected $steps

$tgmpa_instance защищенное свойство

TGMPA instance storage
protected object $tgmpa_instance
Результат object

$tgmpa_menu_slug защищенное свойство

TGMPA Menu slug
protected string $tgmpa_menu_slug
Результат string

$tgmpa_url защищенное свойство

TGMPA Menu url
protected string $tgmpa_url
Результат string

$theme_name защищенное свойство

Current theme name, used as namespace in actions.
protected $theme_name

$version защищенное свойство

The class version number.
С версии: 1.1.1
protected string $version
Результат string