You appear to be a bot. Output may be restricted
Description
Register a shortcode to shortcakeWe need to map our shortcode's syntax into shortcake's
[numberposts] => Array
- (
- [default] => 5
- [values] => numeric
- [notes] => number to return
- )
Usage
oik_register_shortcode_to_shortcake( $shortcode, $help, $syntax );
Parameters
- $shortcode
- ( string ) required – the shortcode tag
- $help
- ( string ) required – one line description of the shortcode
- $syntax
- ( string ) required – array of parameters – built using bw_skv helper function
Returns
voidSource
File name: oik/oik-shortcake.phpLines:
1 to 25 of 25
function oik_register_shortcode_to_shortcake( $shortcode, $help, $syntax ) { $attrs = array(); if ( is_array( $syntax ) && count( $syntax ) ) { foreach ( $syntax as $parameter => $data ) { $parameters = explode( ",", $parameter ); foreach ( $parameters as $parameter ) { $notes = $data['notes']; $default = $data['default']; list( $parameter ) = explode( "|", $parameter ); $attr = array( 'label' => "$parameter - $notes" , 'attr' => $parameter , 'type' => 'text' ); $attr = oik_map_skv_to_attr( $attr, $shortcode, $help, $parameter, $data ); $attrs[] = $attr; } } } $parm2 = array(); $parm2['label'] = $shortcode; // - $help"; $parm2['listItemImage'] = oik_select_shortcake_image( $shortcode, $help ); $parm2['attrs'] = $attrs; $parm2['inner_content'] = oik_shortcake_inner_content( $shortcode, $syntax ); shortcode_ui_register_for_shortcode( $shortcode, $parm2 ); }View on GitHub View on Trac