PHP Class Admin_Apple_Index_Page, apple-news

Inheritance: extends Apple_News
Show file Open project: alleyinteractive/apple-news Class Usage Examples

Public Methods

Method Description
__construct ( $settings ) Constructor.
action_query_params ( string $action, string $url ) : string Helps build query params for each row action.
admin_page ( ) Decide which template to load for the Apple News admin page
export_action ( integer $id ) Handles an export action.
namespace_action ( string $action ) : string Adds a namespace to all actions
page_router ( ) : mixed Sets up all pages used in the plugin's admin page. Associate each route with an action. Actions are methods that end with "_action" and must perform a task and output HTML with the result.
setup_admin_page ( ) Sets up the admin page.
setup_assets ( string $hook ) Sets up admin assets.
show_post_list_action ( ) Shows the list of articles available for publishing to Apple News.

Private Methods

Method Description
delete_action ( integer $id ) Handles a delete from Apple News action.
do_redirect ( ) Performs the redirect after an action is complete.
download_json ( string $json, integer $id ) Downloads the JSON file for troubleshooting purposes.
get_setting ( string $name ) : mixed Gets a setting by name which was loaded from WordPress options.
notice_error ( string $message ) Shows an error message.
notice_success ( string $message ) Shows a success message.
push_action ( integer $id ) Handles a push to Apple News action.

Method Details

__construct() public method

Constructor.
public __construct ( $settings )

action_query_params() public static method

Helps build query params for each row action.
public static action_query_params ( string $action, string $url ) : string
$action string
$url string
return string

admin_page() public method

Decide which template to load for the Apple News admin page
public admin_page ( )

export_action() public method

Handles an export action.
public export_action ( integer $id )
$id integer

namespace_action() public static method

Adds a namespace to all actions
public static namespace_action ( string $action ) : string
$action string
return string

page_router() public method

FIXME: Regarding this class doing too much, maybe split all actions into their own class.
Since: 0.4.0
public page_router ( ) : mixed
return mixed

setup_admin_page() public method

Sets up the admin page.
public setup_admin_page ( )

setup_assets() public method

Sets up admin assets.
public setup_assets ( string $hook )
$hook string

show_post_list_action() public method

Shows the list of articles available for publishing to Apple News.