PHP 클래스 Shortcode_Button

파일 보기 프로젝트 열기: jtsternberg/Shortcode_Button 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_index
$args
$button_data
$buttons_data
$dir
$enqueued
$handle
$index
$scripts_url

공개 메소드들

메소드 설명
__construct ( string $button_slug, array $js_button_data, array $args = [] ) Button name
__get ( string $property ) : mixed Magic getter for our object.
add_button ( $plugin_array ) and tell tinymce where it lives
add_modal_form ( ) Include our button form in a modal
add_quicktag_button_script ( ) Enqueue our quicktag/general purpose button script, and localize our button data
ajax_parse_shortcode ( ) Parse shortcode for display within a TinyMCE view.
button_init ( ) Hook our buttons in to tinymce
do_cmb_form ( ) Use CMB2 cmb2_metabox_form to output form display
filter_form_fields ( $updated, $allvalues = [] ) : array Pass values through a variable filter hook before sending back to JS "{$button_slug}_shortcode_fields"
form_callback ( ) : mixed Check button data for form dislay callback
get_cmb_config ( ) : mixed Get the cmb config array from button args
get_cmb_object ( ) : mixed Use the passed-in CMB2 form args to retrieve a CMB2 object
hooks ( ) Hook it all in. non-ajax hooks check for a conditional callback
process_cmb_form ( array $fields ) CMB2 form processing.
process_form ( ) Ajax form processing.
register_button ( $buttons ) register it with tinymce
sanitize_cmb_fields ( array $fields ) : array Uses CMB2 field processing to sanitize fields (Only applies if cmb_metabox_config parameter exists)
send_json_success ( $send )
url ( string $path = '' ) : string Get script url

메소드 상세

__construct() 공개 메소드

Button name
부터: 0.1.0
public __construct ( string $button_slug, array $js_button_data, array $args = [] )
$button_slug string Button name/slug
$js_button_data array Button arguments passed to Javascript
$args array (optional) Override arguments

__get() 공개 메소드

Magic getter for our object.
부터: 0.1.0
public __get ( string $property ) : mixed
$property string Object property to retrieve
리턴 mixed

add_button() 공개 메소드

and tell tinymce where it lives
public add_button ( $plugin_array )

add_modal_form() 공개 메소드

Include our button form in a modal
부터: 0.1.0
public add_modal_form ( )

add_quicktag_button_script() 공개 정적인 메소드

Enqueue our quicktag/general purpose button script, and localize our button data
부터: 0.1.0
public static add_quicktag_button_script ( )

ajax_parse_shortcode() 공개 정적인 메소드

Parse shortcode for display within a TinyMCE view.
public static ajax_parse_shortcode ( )

button_init() 공개 메소드

Hook our buttons in to tinymce
부터: 0.1.0
public button_init ( )

do_cmb_form() 공개 메소드

Only applies if cmb_metabox_config parameter exists. CMB2 must be included prior to running this script.
부터: 0.1.0
public do_cmb_form ( )

filter_form_fields() 공개 메소드

Pass values through a variable filter hook before sending back to JS "{$button_slug}_shortcode_fields"
부터: 0.1.0
public filter_form_fields ( $updated, $allvalues = [] ) : array
리턴 array Filtered field values

form_callback() 공개 메소드

Check button data for form dislay callback
부터: 0.1.0
public form_callback ( ) : mixed
리턴 mixed Form display callback (or false)

get_cmb_config() 공개 메소드

Get the cmb config array from button args
부터: 0.1.0
public get_cmb_config ( ) : mixed
리턴 mixed CMB2 form args (or false)

get_cmb_object() 공개 메소드

Use the passed-in CMB2 form args to retrieve a CMB2 object
부터: 0.1.0
public get_cmb_object ( ) : mixed
리턴 mixed Returns a CMB2 object or null;

hooks() 공개 메소드

Hook it all in. non-ajax hooks check for a conditional callback
부터: 0.1.0
public hooks ( )

process_cmb_form() 공개 메소드

(Only applies if cmb_metabox_config parameter exists)
부터: 0.1.0
public process_cmb_form ( array $fields )
$fields array Field values to process

process_form() 공개 메소드

Uses dynamic filter before returning: "{$button_slug}_shortcode_fields"
부터: 0.1.0
public process_form ( )

register_button() 공개 메소드

register it with tinymce
public register_button ( $buttons )

sanitize_cmb_fields() 공개 메소드

Uses CMB2 field processing to sanitize fields (Only applies if cmb_metabox_config parameter exists)
부터: 0.1.0
public sanitize_cmb_fields ( array $fields ) : array
$fields array Field values to sanitize
리턴 array Array of sanitized fields

send_json_success() 공개 정적인 메소드

public static send_json_success ( $send )

url() 공개 정적인 메소드

Get script url
부터: 0.1.0
public static url ( string $path = '' ) : string
$path string Path to append to url
리턴 string Script url plus path if passed in

프로퍼티 상세

$_index 보호되어 있는 정적으로 프로퍼티

protected static $_index

$args 보호되어 있는 프로퍼티

protected $args

$button_data 보호되어 있는 프로퍼티

protected $button_data

$buttons_data 보호되어 있는 정적으로 프로퍼티

protected static $buttons_data

$dir 보호되어 있는 정적으로 프로퍼티

protected static $dir

$enqueued 보호되어 있는 정적으로 프로퍼티

protected static $enqueued

$handle 보호되어 있는 정적으로 프로퍼티

protected static $handle

$index 보호되어 있는 프로퍼티

protected $index

$scripts_url 보호되어 있는 정적으로 프로퍼티

protected static $scripts_url