PHP Class WPDKServiceShortcodes

## Overview These are the low-level shortcode for WordPress with prefix wpdk_. TODO To complete
Author: =undo= ([email protected])
Inheritance: extends WPDKShortcodes
Mostra file Open project: wpxtreme/wpdk

Public Methods

Method Description
admin_head ( ) Fires in for all admin pages.
admin_print_footer_scripts ( ) Prints any scripts and data queued for the footer.
admin_print_scripts ( ) Fires when scripts are printed for all admin pages.
getInstance ( ) : WPDKServiceShortcodes Create or return a singleton instance of WPDKServiceShortcodes
init ( ) : WPDKServiceShortcodes Alias of getInstance();
mce_buttons ( array $buttons ) Filter the first-row list of TinyMCE buttons (Visual tab).
mce_external_plugins ( $plugin_array ) Filter the list of TinyMCE external plugins.
wpdk_geo ( array $atts, string $content = null ) : boolean | string Display a content of shortcode only if the user geo localization info rispect the shortcodes params.
wpdk_gist ( array $atts, string $content = null ) : string Return the GitHub include script Gist. Use [wpdk_gist id="762771662"]
wpdk_is_user_logged_in ( array $atts, string $content = null ) : boolean | string Display a content of shortcode only if the user is logged in. In addition you can set below attributes:
wpdk_is_user_not_logged_in ( array $attrs, string $content = null ) : boolean | string Display a content of shortcode only if the user is NOT logged in.

Protected Methods

Method Description
shortcodes ( ) : array Return a Key value pairs array with key as shortcode name and value TRUE/FALSE for turn on/off the shortcode.

Method Details

admin_head() public method

Fires in for all admin pages.
public admin_head ( )

admin_print_scripts() public method

Fires when scripts are printed for all admin pages.
public admin_print_scripts ( )

getInstance() public static method

Create or return a singleton instance of WPDKServiceShortcodes
public static getInstance ( ) : WPDKServiceShortcodes
return WPDKServiceShortcodes

init() public static method

Alias of getInstance();
public static init ( ) : WPDKServiceShortcodes
return WPDKServiceShortcodes

mce_buttons() public method

Filter the first-row list of TinyMCE buttons (Visual tab).
public mce_buttons ( array $buttons )
$buttons array First-row list of buttons.

mce_external_plugins() public method

The filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'. The url should be absolute, and should include the js filename to be loaded. For example: 'myplugin' => 'http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js'. If the external plugin adds a button, it should be added with one of the 'mce_buttons' filters.
public mce_external_plugins ( $plugin_array )

shortcodes() protected method

Return a Key value pairs array with key as shortcode name and value TRUE/FALSE for turn on/off the shortcode.
protected shortcodes ( ) : array
return array Shortcode array

wpdk_geo() public method

[wpdk_geo city="Rome"] Only for Rome [/wpdk_geo] [wpdk_geo city="rome"] Only for Rome [/wpdk_geo] [wpdk_geo city="rome,london"] Only for Rome and Landon [/wpdk_geo] [wpdk_geo region="lazio"] Only for region (Italy) Lazio [/wpdk_geo] [wpdk_geo country_code="IT"] Italian only [/wpdk_geo] [wpdk_geo country="italy"] Italian only [/wpdk_geo]
public wpdk_geo ( array $atts, string $content = null ) : boolean | string
$atts array Attribute into the shortcode
$content string Optional. $content HTML content
return boolean | string

wpdk_gist() public method

Return the GitHub include script Gist. Use [wpdk_gist id="762771662"]
public wpdk_gist ( array $atts, string $content = null ) : string
$atts array Attribute into the shortcode
$content string Optional. $content HTML content
return string

wpdk_is_user_logged_in() public method

roles - A list of roles string, comma separated. Eg: administrator, subscriber caps - A list of capabilities string, comma separated. Eg. read, level_0 emails - A list of emails string, comma separated. Eg. [email protected], [email protected] ids - A list of user id, comma separated. Eg. 12,13,14 For instance: [wpdk_is_user_logged_in roles='subscriber'] [wpdk_is_user_logged_in roles='subscriber' caps="adv_perm, adv_read"] [wpdk_is_user_logged_in emails='[email protected]' caps="adv_perm, adv_read"] [wpdk_is_user_logged_in ids='134']
public wpdk_is_user_logged_in ( array $atts, string $content = null ) : boolean | string
$atts array Attribute into the shortcode
$content string Optional. $content HTML content
return boolean | string

wpdk_is_user_not_logged_in() public method

Display a content of shortcode only if the user is NOT logged in.
public wpdk_is_user_not_logged_in ( array $attrs, string $content = null ) : boolean | string
$attrs array Attribute into the shortcode
$content string Optional. $content HTML content
return boolean | string