Changeset 1738911
- Timestamp:
- 09/30/2017 05:37:34 PM (9 years ago)
- Location:
- bkc-wp-shortcodes/trunk
- Files:
-
- 4 edited
-
bkc-wp-shortcodes.php (modified) (1 diff)
-
classes/class-bkc-wp-shortcodes-loader.php (modified) (1 diff)
-
classes/class-bkc-wp-shortcodes.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bkc-wp-shortcodes/trunk/bkc-wp-shortcodes.php
r1738641 r1738911 3 3 * Plugin Name: Shortcodes 4 4 * Description: This Plugin provides multiple wordpress core shortcodes. 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: Dinesh Chouhan 7 7 * Author URI: http://dineshchouhan.com -
bkc-wp-shortcodes/trunk/classes/class-bkc-wp-shortcodes-loader.php
r1738641 r1738911 55 55 public function __construct() { 56 56 57 define( 'BKC_WP_SHORTCODES_VER', '1.0. 1' );57 define( 'BKC_WP_SHORTCODES_VER', '1.0.2' ); 58 58 define( 'BKC_WP_SHORTCODES_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'bkc-wp-shortcodes.php' ); 59 59 define( 'BKC_WP_SHORTCODES_BASE', plugin_basename( BKC_WP_SHORTCODES_FILE ) ); -
bkc-wp-shortcodes/trunk/classes/class-bkc-wp-shortcodes.php
r1738641 r1738911 785 785 $func_args = []; 786 786 foreach ( $args as $key => $value ) { 787 if ( 0 === strpos( $value, '{{' ) ) { 788 $value = get_shortcode_from_attr( $value ); 789 } 787 790 array_push( $func_args , $value ); 788 791 } … … 801 804 802 805 /** 806 * Gets the shortcode from attribute. 807 * 808 * @since 1.0.2 809 * @param string $value The value. 810 * @return string 811 */ 812 public function get_shortcode_from_attr( $value ) { 813 $shortcode = str_replace( '}}', '', str_replace( '{{', '', $value ) ); 814 $shortcode = explode( ' ', $shortcode ); 815 $shortcode = $shortcode[0]; 816 if ( shortcode_exists( $shortcode ) ) { 817 $actual_shortcode = str_replace( '}}', ']', str_replace( '{{', '[', $value ) ); 818 $value = do_shortcode( $actual_shortcode, true ); 819 } 820 return $value; 821 } 822 823 /** 803 824 * wp_get_option shortcode callback. 804 825 * -
bkc-wp-shortcodes/trunk/readme.txt
r1738641 r1738911 24 24 4. [wp_get_the_thumbnail] 25 25 Ex. [wp_get_the_thumbnail] 26 27 5. Use of shortcode as parameter of another shortcode. 28 Ex. [wp_get_the_post_thumbnail post={{wp_get_the_ID}} size="medium" ] 29 "wp_get_the_ID" is a shortcode to get current post id which is is passed to post parameter of "wp_get_the_post_thumbnail" shortcode. To pass shortcode as parameter value you need to use {{shortcode}} syntax instead of [shortcode]. 26 30 == Installation == 27 31 … … 38 42 = 1.0.1 = 39 43 * Shortcodes generator array updated. 44 45 = 1.0.2 = 46 * Added support for shortcode as parameter of another shortcode.
Note: See TracChangeset
for help on using the changeset viewer.