PHP Class WPKB\Admin

显示文件 Open project: ibericode/wp-knowledge-base

Public Methods

Method Description
__construct ( Options $options ) Construct
add_hooks ( ) Add hooks
add_menu_items ( ) Add menu items
add_meta_box ( WP_Pos\WP_Post $post ) Add metabox with Article Settings to wpkb-article edit screen.
register_settings ( ) Register settings
sanitize_settings ( $settings ) : array
save_kb_article ( integer $post_id, WP_Pos\WP_Post $post ) : boolean Runs when saving a KB article
show_meta_box ( WP_Pos\WP_Post $post )
show_settings_page ( ) Render the settings page

Method Details

__construct() public method

Construct
public __construct ( Options $options )
$options Options

add_hooks() public method

Add hooks
public add_hooks ( )

add_menu_items() public method

Add menu items
public add_menu_items ( )

add_meta_box() public method

Add metabox with Article Settings to wpkb-article edit screen.
public add_meta_box ( WP_Pos\WP_Post $post )
$post WP_Pos\WP_Post

register_settings() public method

Register settings
public register_settings ( )

sanitize_settings() public method

public sanitize_settings ( $settings ) : array
$settings
return array

save_kb_article() public method

Runs when saving a KB article
public save_kb_article ( integer $post_id, WP_Pos\WP_Post $post ) : boolean
$post_id integer
$post WP_Pos\WP_Post
return boolean

show_meta_box() public method

public show_meta_box ( WP_Pos\WP_Post $post )
$post WP_Pos\WP_Post

show_settings_page() public method

Render the settings page
public show_settings_page ( )