Overview

Namespaces

  • None
  • PHP

Classes

  • Sidecar
  • Sidecar_Admin_Page
  • Sidecar_Admin_Tab
  • Sidecar_Field
  • Sidecar_Form
  • Sidecar_Form_Settings
  • Sidecar_Plugin_Base
  • Sidecar_Plugin_Settings
  • Sidecar_Settings_Base
  • Sidecar_Shortcode
  • Sidecar_Singleton_Base

Functions

  • body
  • format_gmt_string
  • headers
  • output_css
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Class Sidecar_Plugin_Base

Sidecar_Singleton_Base
Extended by Sidecar_Plugin_Base
Located at classes/class-plugin-base.php
Methods summary
public
# set_api_loader( mixed $class_name, mixed $filepath )

Parameters

$class_name
mixed
$class_name
$filepath
mixed
$filepath
public boolean
# has_api( )

Returns

boolean
public boolean|RESTian_Client
# get_api( )

Returns a RESTian_Client object if set_api_loader() has previously been called with correct info, false otherwise.

Returns a RESTian_Client object if set_api_loader() has previously been called with correct info, false otherwise.

Returns

boolean|RESTian_Client
public
# set_api( RESTian_Client $api )

Parameters

$api
RESTian_Client
$api
public
# is_saving_widget( )
public
# on_load( array $args = array() )

Parameters

$args
array
$args
public
# _save_post( mixed $post_id )

Delete the flag indicating that a post needs external files (CSS styles and JS scripts) for each shortcode we have in case the newly saved post now has changed the use of the shortcodes.

Delete the flag indicating that a post needs external files (CSS styles and JS scripts) for each shortcode we have in case the newly saved post now has changed the use of the shortcodes.

public boolean
# is_confirm_plugin_deletion( )

Used to check if we are on a plugin page that is asking about deletion.

Used to check if we are on a plugin page that is asking about deletion.

Returns

boolean
public boolean
# is_verified_plugin_deletion( )

Used to check if we are on a plugin page that is deleting (a) plugin(s).

Used to check if we are on a plugin page that is deleting (a) plugin(s).

Returns

boolean
public boolean
# is_plugin_deletion( )

Used to check if we are a plugin page askin about deletion or processing deletion request.

Used to check if we are a plugin page askin about deletion or processing deletion request.

Returns

boolean
public static
# uninstall( )
public boolean
# is_plugin_page( )

Used to check if we are in an activation callback on the Plugins page.

Used to check if we are in an activation callback on the Plugins page.

Returns

boolean
public boolean
# is_plugin_page_action( )

Used to check if we are in an activation callback on the Plugins page.

Used to check if we are in an activation callback on the Plugins page.

Returns

boolean
public
# _activate_plugin( )

This is used for the "activate_{$this->plugin_id}" hook when $this->is_plugin_page_action().

This is used for the "activate_{$this->plugin_id}" hook when $this->is_plugin_page_action().

public
# _plugins_loaded( )

This is used for the "activate_{$this->plugin_id}" hook when $this->is_plugin_page_action().

This is used for the "activate_{$this->plugin_id}" hook when $this->is_plugin_page_action().

public array|boolean
# get_forms( )

Returns

array|boolean
public boolean
# has_forms( )

Returns

boolean
public
# _wp_print_styles( )
public boolean
# has_admin_pages( )

Returns

boolean
public boolean
# has_form( string $form_name )

Parameters

$form_name
string
$form_name

Returns

boolean
public
# initialize( )
public array
# get_default_settings_values( )

Returns

array
public
# update_settings_values( array $settings_values )

Parameters

$settings_values
array
$settings_values
public array
# get_form_settings_value( string|Sidecar_Form $form, string $setting_name )

Parameters

$form
string|Sidecar_Form
$form
$setting_name
string
$setting_name

Returns

array
public array
# update_form_settings_value( string|Sidecar_Form $form, string $setting_name, string $value )

Parameters

$form
string|Sidecar_Form
$form
$setting_name
string
$setting_name
$value
string
$value

Returns

array
public boolean
# has_required_settings( )

Returns

boolean
public
# set_settings( Sidecar_Settings $settings )

Parameters

$settings
Sidecar_Settings
$settings
public Sidecar_Plugin_Settings
# get_settings( )

Returns

Sidecar_Plugin_Settings
public mixed|Sidecar_Form_Settings
# get_form_field_values( string|Sidecar_Form $form )

Parameters

$form
string|Sidecar_Form
$form

Returns

mixed|Sidecar_Form_Settings
public mixed|Sidecar_Form_Settings
# get_form_field_value( string|Sidecar_Form $form, string $field_name )

Parameters

$form
string|Sidecar_Form
$form
$field_name
string
$field_name

Returns

mixed|Sidecar_Form_Settings
public mixed|Sidecar_Form_Settings
# set_form_field_values( string|Sidecar_Form $form, array $field_values )

Parameters

$form
string|Sidecar_Form
$form
$field_values
array
$field_values

Returns

mixed|Sidecar_Form_Settings
public mixed|Sidecar_Form_Settings
# get_form_settings( string|Sidecar_Form $form )

Parameters

$form
string|Sidecar_Form
$form

Returns

mixed|Sidecar_Form_Settings
public mixed|Sidecar_Form_Settings
# set_form_settings( string|Sidecar_Form $form, mixed $setting_value )

Parameters

$form
string|Sidecar_Form
$form
$setting_value
mixed
$setting_value

Returns

mixed|Sidecar_Form_Settings
public boolean
# delete_settings( )

Delete the persisted settings on disk.

Delete the persisted settings on disk.

Returns

boolean
public
# _wp_loaded( )
public
# _admin_notices( )
public array
# _plugin_action_links( mixed $links, mixed $file )

Parameters

$links
mixed
$links
$file
mixed
$file

Returns

array
public boolean|string|
# get_settings_url( )

Returns

boolean|string|
public array
# _plugin_meta_links( array $links, string $file )

Parameters

$links
array
$links
$file
string
$file

Returns

array
public
# _the_content( mixed $content )

Parameters

$content
mixed
$content
public
# _init( )
public array
# transform_form_fields_to( string $to, Sidecar_Form $form, array $fields )

Parameters

$to
string
$to 'api_vars' or 'fields'
$form
Sidecar_Form
$form
$fields
array
$fields

Returns

array
public array
# transform_shortcode_attributes_to( string $to, Sidecar_Shortcode $shortcode, array $attributes )

Parameters

$to
string
$to 'api_vars' or 'settings'
$shortcode
Sidecar_Shortcode
$shortcode
$attributes
array
$attributes

Returns

array
public
# initialize_form( Sidecar_Form $form )

Parameters

$form
Sidecar_Form
$form
public
# initialize_shortcodes( )
public
# initialize_postback( )
public
# initialize_template( )
public
# uninstall_plugin( )
public
# initialize_plugin( )

Throws

Exception
public
# initialize_admin( )

Throws

Exception
public
# initialize_admin_page( Sidecar_Admin_Page $admin_page )

Parameters

$admin_page
Sidecar_Admin_Page
$admin_page

Throws

Exception
public
# initialize_shortcode( Sidecar_Shortcode $shortcode )

Parameters

$shortcode
Sidecar_Shortcode
$shortcode

Throws

Exception
public string
# do_shortcode( Sidecar_Shortcode $shortcode, array() $attributes, string $content = null )

Parameters

$shortcode
Sidecar_Shortcode
$shortcode
$attributes
array()
$attributes
$content
string
$content

Returns

string

Throws

Exception
public mixed
# add_default_button( array $args = array() )

Parameters

$args
array
$args

Returns

mixed
public mixed
# add_button( string $button_name, string $button_text, array $args = array() )

Parameters

$button_name
string
$button_name
$button_text
string
$button_text
$args
array
$args

Returns

mixed
public mixed
# add_admin_page( mixed $page_name, array $args = array() )

Parameters

$page_name
mixed
$page_name
$args
array
$args

Returns

mixed
public
# add_meta_link( string $link_text, string $url, array $args = array() )

Parameters

$link_text
string
$link_text
$url
string
$url
$args
array
$args
public Sidecar_Admin_Page
# get_admin_page( string $page_name )

Parameters

$page_name
string
$page_name

Returns

Sidecar_Admin_Page
public
# add_default_shortcode( )
public
# add_shortcode( mixed $shortcode_name, array $args = array() )

Parameters

$shortcode_name
mixed
$shortcode_name
$args
array
$args
public array|boolean
# get_shortcodes( )

Returns

array|boolean
public Sidecar_Shortcode
# get_shortcode( boolean|string $shortcode_name = false )

Parameters

$shortcode_name
boolean|string
$shortcode_name

Returns

Sidecar_Shortcode
public boolean|Sidecar_Shortcode
# get_shortcode_attributes( boolean|string $shortcode_name = false )

Parameters

$shortcode_name
boolean|string
$shortcode_name

Returns

boolean|Sidecar_Shortcode
public
# register_url( string $url_name, string $url_template, array $args = array() )

Parameters

$url_name
string
$url_name
$url_template
string
$url_template
$args
array
$args
public boolean
# has_url( string $url_name )

Parameters

$url_name
string
$url_name

Returns

boolean
public string
# get_url( mixed $url_name, mixed|array $values = array() )

Get by name a previously registered URL with optional variable value replacement

Get by name a previously registered URL with optional variable value replacement

Parameters

$url_name
mixed
$url_name
$values
mixed|array
$values

Returns

string

Example:

$this->register_url( 'my_named_url', 'https://example.com/?item={item_id}&color={color}' ); $this->get_url( 'my_named_url', 1234, 'red' ); $this->get_url( 'my_named_url', array( 2345, 'red' ) ); $this->get_url( 'my_named_url', array( 'color' => 'red', 'item_id' => 3456 ) );
public boolean
# get_link_text( mixed $url_name )

Parameters

$url_name
mixed
$url_name

Returns

boolean
public boolean
# get_link_class( mixed $url_name )

Parameters

$url_name
mixed
$url_name

Returns

boolean
public
# register_image( string $image_name, string $image_url, array $args = array() )

Parameters

$image_name
string
$image_name
$image_url
string
$image_url
$args
array
$args
public boolean
# has_image( string $image_name )

Parameters

$image_name
string
$image_name

Returns

boolean
public string
# get_image_url( mixed $image_name, mixed|array $values = array() )

Get by name a previously registered image with optional variable value replacement

Get by name a previously registered image with optional variable value replacement

Parameters

$image_name
mixed
$image_name
$values
mixed|array
$values

Returns

string

Example:

$this->register_image( 'my_logo', 'my-logo.png' ); echo $this->my_logo_image_url; $this->register_image( 'my_icon', '{icon_type}.png' ); echo $this->get_image_url( 'my_icon', 'pdf' ); echo $this->get_image_url( 'my_icon', array('pdf') ); echo $this->get_image_url( 'my_icon', array('icon_type' => 'pdf') );
public Sidecar_Form
# the_form( boolean|Sidecar_Form $form = false )

Echo the current or specified form.

Echo the current or specified form.

Parameters

$form
boolean|Sidecar_Form
$form

Returns

Sidecar_Form
public Sidecar_Form
# promote_form( array $form )

Parameters

$form
array
$form

Returns

Sidecar_Form
public
# the_form_section( array $args )

Parameters

$args
array
$args
public Sidecar_Field
# get_form_field( mixed $field_name, mixed $form_name )

Parameters

$field_name
mixed
$args
$form_name

Returns

Sidecar_Field
public
# get_form_field_html( array $field_name, mixed $form_name )

Parameters

$field_name
array
$args
$form_name
public
# the_form_field( array $field_name, mixed $form_name )

Parameters

$field_name
array
$args
$form_name
public boolean
# has_shortcode( string $shortcode_name )

Parameters

$shortcode_name
string
$shortcode_name

Returns

boolean
public array|Sidecar_Form
# get_form( string|Sidecar_Form $form )

Parameters

$form
string|Sidecar_Form
$form

Returns

array|Sidecar_Form
public
# add_form( string $form_name, array $args = array() )

Parameters

$form_name
string
$form_name
$args
array
$args
public Sidecar_Field
# add_field( string $form_name, array $args = array() )

Parameters

$form_name
string
$form_name
$args
array
$args

Returns

Sidecar_Field
public boolean
# is_authenticated( )

This function name will be more logical to people, but underneath it is 'has_grant()'

This function name will be more logical to people, but underneath it is 'has_grant()'

Returns

boolean
public boolean
# has_grant( )

Determines if the currently stored settings contain a grant to access the API.

Determines if the currently stored settings contain a grant to access the API.

Returns

boolean
public boolean
# needs_grant( )

Returns

boolean
public array
# get_grant( )

Get grant from the currently stored account settings

Get grant from the currently stored account settings

Returns

array
public array
# get_credentials( )

Get credentials from the currently stored account settings

Get credentials from the currently stored account settings

Returns

array
public Sidecar_Admin_Page
# get_current_admin_page( )

Returns

Sidecar_Admin_Page
public
# set_current_admin_page( Sidecar_Admin_Page $current_admin_page )

Parameters

$current_admin_page
Sidecar_Admin_Page
$current_admin_page
public Sidecar_Form
# get_current_form( )

Returns

Sidecar_Form
public
# set_current_form( Sidecar_Admin_Page $current_form )

Parameters

$current_form
Sidecar_Admin_Page
$current_form
public array
# _pre_update_option( array $new_value, array $old_value )

Capture values from form but cause update_option() to be bypassed. We'll update in the shutdown hook.

Capture values from form but cause update_option() to be bypassed. We'll update in the shutdown hook.

Parameters

$new_value
array
$new_value
$old_value
array
$old_value

Returns

array
public
# _activate( )

Todo

Decide if trigger_error() is the best for error messages
public
# _initialize_admin( )
public Sidecar_Form
# get_auth_form( )

Returns

Sidecar_Form
public boolean|string
# __get( mixed $property_name )

Parameters

$property_name
mixed
$property_name

Returns

boolean|string
Methods inherited from Sidecar_Singleton_Base
__construct(), _get_called_class(), add_action(), add_filter(), call(), get(), this()
Properties summary
public string $plugin_class
#
public string $plugin_class_base
#
public string $plugin_name
#
public string $plugin_slug
#

Dashed version of $this->plugin_name

Dashed version of $this->plugin_name

public string $plugin_id
#

ID of plugin used by WordPress in get_option('active_plugins')

ID of plugin used by WordPress in get_option('active_plugins')

public string $plugin_version
#
public string $plugin_title
#
public string $plugin_label
#
public string $css_base
#
public string $plugin_file
#
public string $plugin_path
#
public string $min_php '5.2.4'
#

Minimum PHP version, defaults to min version for WordPress

Minimum PHP version, defaults to min version for WordPress

public string $min_wp '3.2'
#

Minimum WordPress version, defaults to first version requiring PHP 5.2.4.

Minimum WordPress version, defaults to first version requiring PHP 5.2.4.

protected array $_urls array()
#

Array of URLs defined for handle use by plugin.

Array of URLs defined for handle use by plugin.

protected array $_images array()
#

Array of Image file names defined for handle use by plugin.

Array of Image file names defined for handle use by plugin.

protected boolean|array $_shortcodes false
#
protected boolean|array $_forms false
#
protected boolean|array $_admin_pages array()
#
protected array $_meta_links array()
#

Array of Meta Links for the WordPress plugin page.

Array of Meta Links for the WordPress plugin page.

protected boolean|array|RESTian_Client $_api false
#
protected Sidecar_Admin_Page $_current_admin_page
#
protected Sidecar_Form $_current_form
#
protected boolean $_initialized false
#
protected Sidecar_Plugin_Settings $_plugin_settings
#
protected mixed $_default_settings_values
#
public string $option_name
#
public string $needs_ajax false
#
public boolean $needs_settings true
#
protected boolean $_admin_initialized false
#
API documentation generated by ApiGen 2.8.0