WordPress.org

Plugin Directory

Changeset 554874


Ignore:
Timestamp:
06/08/12 14:34:36 (23 months ago)
Author:
wpsmith
Message:
 
Location:
genesis-shortcodes/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • genesis-shortcodes/trunk/genesis-shortcodes.php

    r517579 r554874  
    55Plugin URI: http://www.wpsmith.net/genesis-shortcodes 
    66Description: Provides commonly used shortcodes for the Genesis Framework 
    7 Version: 0.2 
     7Version: 0.3 
    88Author: Travis Smith 
    99Author URI: http://www.wpsmith.net/ 
     
    126126 * @return string Shortcode output 
    127127 */ 
    128 add_shortcode( 'post_field', 'wps_post_field_shortcode' ); 
    129  
    130 function wps_post_field_shortcode( $atts ) { 
     128add_shortcode( 'post_field', 'gsc_post_field_shortcode' ); 
     129 
     130function gsc_post_field_shortcode( $atts ) { 
    131131  
    132132    $defaults = array( 
     
    145145 */ 
    146146 
    147 add_shortcode( 'uploads' , 'wps_uploads_shortcode' ); 
    148  
    149 function wps_uploads_shortcode( $atts ) { 
     147add_shortcode( 'uploads' , 'gsc_uploads_shortcode' ); 
     148 
     149function gsc_uploads_shortcode( $atts ) { 
    150150    $upload_dir = wp_upload_dir(); 
    151151    return $upload_dir['baseurl'];  
     
    159159 */ 
    160160 
    161 add_shortcode( 'url' , 'wps_url_shortcode' ); 
    162  
    163 function wps_url_shortcode( $atts ) { 
     161add_shortcode( 'url' , 'gsc_url_shortcode' ); 
     162 
     163function gsc_url_shortcode( $atts ) { 
    164164    return get_bloginfo( 'url' ); 
    165165} 
     
    172172 */ 
    173173 
    174 add_shortcode( 'wpurl' , 'wps_wpurl_shortcode' ); 
    175  
    176 function wps_wpurl_shortcode( $atts ) { 
     174add_shortcode( 'wpurl' , 'gsc_wpurl_shortcode' ); 
     175 
     176function gsc_wpurl_shortcode( $atts ) { 
    177177    return get_bloginfo( 'wpurl' ); 
    178178} 
     
    185185 */ 
    186186 
    187 add_shortcode( 'child_url', 'wps_child_shortcode' ); 
    188  
    189 function wps_child_shortcode( $atts ) { 
     187add_shortcode( 'child_url', 'gsc_child_shortcode' ); 
     188 
     189function gsc_child_shortcode( $atts ) { 
    190190    return get_bloginfo( 'stylesheet_directory' ); 
     191} 
     192 
     193add_shortcode( 'site_url' , 'gsc_site_url_shortcode' ); 
     194/** 
     195 * URL Shortcode 
     196 * 
     197 * @param   null 
     198 * @return  string  Site URL 
     199 */ 
     200function gsc_site_url_shortcode( $atts ) { 
     201     extract(  
     202        shortcode_atts( 
     203            array( 
     204              'site'   => '', 
     205              'path'   => '', 
     206              'scheme' => null, 
     207            ),  
     208            $atts 
     209        ) 
     210    ); 
     211      
     212    return get_site_url( $site, $path, $scheme ); 
    191213} 
    192214 
     
    198220 */ 
    199221  
    200 add_shortcode ('genesis_comments', 'wps_genesis_comments_shortcode'); 
    201  
    202 function wps_genesis_comments_shortcode() { 
     222add_shortcode ('genesis_comments', 'gsc_genesis_comments_shortcode'); 
     223 
     224function gsc_genesis_comments_shortcode() { 
    203225    ob_start(); 
    204226    genesis_get_comments_template(); 
     
    215237 */ 
    216238 
    217 add_shortcode( 'one_half', 'wps_one_half_shortcode' ); 
    218 add_shortcode( 'two_fourths', 'wps_one_half_shortcode' ); 
    219 add_shortcode( 'three_sixths', 'wps_one_half_shortcode' ); 
    220  
    221 function wps_one_half_shortcode( $atts , $content ) { 
     239add_shortcode( 'one_half', 'gsc_one_half_shortcode' ); 
     240add_shortcode( 'two_fourths', 'gsc_one_half_shortcode' ); 
     241add_shortcode( 'three_sixths', 'gsc_one_half_shortcode' ); 
     242 
     243function gsc_one_half_shortcode( $atts , $content ) { 
    222244 
    223245    //extract short code attr 
     
    238260 */ 
    239261 
    240 add_shortcode( 'one_half_first', 'wps_one_half_first_shortcode' ); 
    241 add_shortcode( 'two_fourths_first', 'wps_one_half_first_shortcode' ); 
    242 add_shortcode( 'three_sixths_first', 'wps_one_half_first_shortcode' ); 
    243  
    244 function wps_one_half_first_shortcode( $atts , $content ) { 
     262add_shortcode( 'one_half_first', 'gsc_one_half_first_shortcode' ); 
     263add_shortcode( 'two_fourths_first', 'gsc_one_half_first_shortcode' ); 
     264add_shortcode( 'three_sixths_first', 'gsc_one_half_first_shortcode' ); 
     265 
     266function gsc_one_half_first_shortcode( $atts , $content ) { 
    245267 
    246268    //extract short code attr 
     
    261283 */ 
    262284 
    263 add_shortcode( 'one_third', 'wps_one_third_shortcode' ); 
    264 add_shortcode( 'two_sixths', 'wps_one_third_shortcode' ); 
    265  
    266 function wps_one_third_shortcode( $atts , $content ) { 
     285add_shortcode( 'one_third', 'gsc_one_third_shortcode' ); 
     286add_shortcode( 'two_sixths', 'gsc_one_third_shortcode' ); 
     287 
     288function gsc_one_third_shortcode( $atts , $content ) { 
    267289     
    268290    $return_html = '<div class="one-third">' . do_shortcode ( $content ) . '</div>'; 
     
    278300 */ 
    279301 
    280 add_shortcode( 'one_third_first', 'wps_one_third_first_shortcode' ); 
    281 add_shortcode( 'two_sixths_first', 'wps_one_third_first_shortcode' ); 
    282  
    283 function wps_one_third_first_shortcode( $atts , $content ) { 
     302add_shortcode( 'one_third_first', 'gsc_one_third_first_shortcode' ); 
     303add_shortcode( 'two_sixths_first', 'gsc_one_third_first_shortcode' ); 
     304 
     305function gsc_one_third_first_shortcode( $atts , $content ) { 
    284306     
    285307    $return_html = '<div class="one-third first">' . do_shortcode ( $content ) . '</div>'; 
     
    295317 */ 
    296318 
    297 add_shortcode( 'two_thirds', 'wps_two_thirds_shortcode' ); 
    298 add_shortcode( 'four_sixths', 'wps_two_thirds_shortcode' ); 
    299  
    300 function wps_two_thirds_shortcode( $atts , $content ) { 
     319add_shortcode( 'two_thirds', 'gsc_two_thirds_shortcode' ); 
     320add_shortcode( 'four_sixths', 'gsc_two_thirds_shortcode' ); 
     321 
     322function gsc_two_thirds_shortcode( $atts , $content ) { 
    301323     
    302324    $return_html = '<div class="two-thirds">' . do_shortcode ( $content ) . '</div>'; 
     
    312334 */ 
    313335 
    314 add_shortcode( 'two_thirds_first', 'wps_two_thirds_first_shortcode' ); 
    315 add_shortcode( 'four_sixths_first', 'wps_two_thirds_first_shortcode' ); 
    316  
    317 function wps_two_thirds_first_shortcode( $atts , $content ) { 
     336add_shortcode( 'two_thirds_first', 'gsc_two_thirds_first_shortcode' ); 
     337add_shortcode( 'four_sixths_first', 'gsc_two_thirds_first_shortcode' ); 
     338 
     339function gsc_two_thirds_first_shortcode( $atts , $content ) { 
    318340     
    319341    $return_html = '<div class="two-thirds first">' . do_shortcode ( $content ) . '</div>'; 
     
    329351 */ 
    330352 
    331 add_shortcode( 'one_fourth', 'wps_one_fourth_shortcode' ); 
    332  
    333 function wps_one_fourth_shortcode( $atts , $content ) { 
     353add_shortcode( 'one_fourth', 'gsc_one_fourth_shortcode' ); 
     354 
     355function gsc_one_fourth_shortcode( $atts , $content ) { 
    334356     
    335357    $return_html = '<div class="one-fourth">' . do_shortcode ( $content ) . '</div>'; 
     
    345367 */ 
    346368 
    347 add_shortcode( 'one_fourth_first', 'wps_one_fourth_first_shortcode' ); 
    348  
    349 function wps_one_fourth_first_shortcode( $atts , $content ) { 
     369add_shortcode( 'one_fourth_first', 'gsc_one_fourth_first_shortcode' ); 
     370 
     371function gsc_one_fourth_first_shortcode( $atts , $content ) { 
    350372     
    351373    $return_html = '<div class="one-fourth first">' . do_shortcode ( $content ) . '</div>'; 
     
    361383 */ 
    362384 
    363 add_shortcode( 'three_fourths', 'wps_three_fourth_shortcode' ); 
    364  
    365 function wps_three_fourth_shortcode( $atts , $content ) { 
     385add_shortcode( 'three_fourths', 'gsc_three_fourth_shortcode' ); 
     386 
     387function gsc_three_fourth_shortcode( $atts , $content ) { 
    366388     
    367389    $return_html = '<div class="three-fourths">' . do_shortcode ( $content ) . '</div>'; 
     
    377399 */ 
    378400 
    379 add_shortcode( 'three_fourths_first', 'wps_three_fourths_first_shortcode' ); 
    380  
    381 function wps_three_fourths_first_shortcode( $atts , $content ) { 
     401add_shortcode( 'three_fourths_first', 'gsc_three_fourths_first_shortcode' ); 
     402 
     403function gsc_three_fourths_first_shortcode( $atts , $content ) { 
    382404     
    383405    $return_html = '<div class="three-fourths first">' . do_shortcode ( $content ) . '</div>'; 
     
    393415 */ 
    394416 
    395 add_shortcode( 'one_fifth', 'wps_one_fifth_shortcode' ); 
    396  
    397 function wps_one_fifth_shortcode( $atts , $content ) { 
     417add_shortcode( 'one_fifth', 'gsc_one_fifth_shortcode' ); 
     418 
     419function gsc_one_fifth_shortcode( $atts , $content ) { 
    398420     
    399421    $return_html = '<div class="one-fifth">' . do_shortcode ( $content ) . '</div>'; 
     
    409431 */ 
    410432 
    411 add_shortcode( 'one_fifth_first', 'wps_one_fifth_first_shortcode' ); 
    412  
    413 function wps_one_fifth_first_shortcode( $atts , $content ) { 
     433add_shortcode( 'one_fifth_first', 'gsc_one_fifth_first_shortcode' ); 
     434 
     435function gsc_one_fifth_first_shortcode( $atts , $content ) { 
    414436     
    415437    $return_html = '<div class="one-fifth first">' . do_shortcode ( $content ) . '</div>'; 
     
    425447 */ 
    426448 
    427 add_shortcode( 'two_fifths', 'wps_two_fifths_shortcode' ); 
    428  
    429 function wps_two_fifths_shortcode( $atts , $content ) { 
     449add_shortcode( 'two_fifths', 'gsc_two_fifths_shortcode' ); 
     450 
     451function gsc_two_fifths_shortcode( $atts , $content ) { 
    430452     
    431453    $return_html = '<div class="two-fifths">' . do_shortcode ( $content ) . '</div>'; 
     
    441463 */ 
    442464 
    443 add_shortcode( 'two_fifths_first', 'wps_two_fifths_first_shortcode' ); 
    444  
    445 function wps_two_fifths_first_shortcode( $atts , $content ) { 
     465add_shortcode( 'two_fifths_first', 'gsc_two_fifths_first_shortcode' ); 
     466 
     467function gsc_two_fifths_first_shortcode( $atts , $content ) { 
    446468     
    447469    $return_html = '<div class="two-fifths first">' . do_shortcode ( $content ) . '</div>'; 
     
    457479 */ 
    458480 
    459 add_shortcode( 'three_fifths', 'wps_three_fifths_shortcode' ); 
    460  
    461 function wps_three_fifths_shortcode( $atts , $content ) { 
     481add_shortcode( 'three_fifths', 'gsc_three_fifths_shortcode' ); 
     482 
     483function gsc_three_fifths_shortcode( $atts , $content ) { 
    462484     
    463485    $return_html = '<div class="three-fifths">' . do_shortcode ( $content ) . '</div>'; 
     
    473495 */ 
    474496 
    475 add_shortcode( 'three_fifths_first', 'wps_three_fifths_first_shortcode' ); 
    476  
    477 function wps_three_fifths_first_shortcode( $atts , $content ) { 
     497add_shortcode( 'three_fifths_first', 'gsc_three_fifths_first_shortcode' ); 
     498 
     499function gsc_three_fifths_first_shortcode( $atts , $content ) { 
    478500     
    479501    $return_html = '<div class="three-fifths first">' . do_shortcode ( $content ) . '</div>'; 
     
    489511 */ 
    490512 
    491 add_shortcode( 'four_fifths', 'wps_four_fifths_shortcode' ); 
    492  
    493 function wps_four_fifths_shortcode( $atts , $content ) { 
     513add_shortcode( 'four_fifths', 'gsc_four_fifths_shortcode' ); 
     514 
     515function gsc_four_fifths_shortcode( $atts , $content ) { 
    494516     
    495517    $return_html = '<div class="four-fifths">' . do_shortcode ( $content ) . '</div>'; 
     
    505527 */ 
    506528 
    507 add_shortcode( 'four_fifths_first', 'wps_four_fifths_first_shortcode' ); 
    508  
    509 function wps_four_fifths_first_shortcode( $atts , $content ) { 
     529add_shortcode( 'four_fifths_first', 'gsc_four_fifths_first_shortcode' ); 
     530 
     531function gsc_four_fifths_first_shortcode( $atts , $content ) { 
    510532     
    511533    $return_html = '<div class="four-fifths first">' . do_shortcode ( $content ) . '</div>'; 
     
    521543 */ 
    522544 
    523 add_shortcode( 'one_sixth', 'wps_one_sixth_shortcode' ); 
    524  
    525 function wps_one_sixth_shortcode( $atts , $content ) { 
     545add_shortcode( 'one_sixth', 'gsc_one_sixth_shortcode' ); 
     546 
     547function gsc_one_sixth_shortcode( $atts , $content ) { 
    526548     
    527549    $return_html = '<div class="one-sixth">' . do_shortcode ( $content ) . '</div>'; 
     
    537559 */ 
    538560 
    539 add_shortcode( 'one_sixth_first', 'wps_one_sixth_first_shortcode' ); 
    540  
    541 function wps_one_sixth_first_shortcode( $atts , $content ) { 
     561add_shortcode( 'one_sixth_first', 'gsc_one_sixth_first_shortcode' ); 
     562 
     563function gsc_one_sixth_first_shortcode( $atts , $content ) { 
    542564     
    543565    $return_html = '<div class="one-sixth first">' . do_shortcode ( $content ) . '</div>'; 
     
    553575 */ 
    554576 
    555 add_shortcode( 'five_sixths', 'wps_five_sixths_shortcode' ); 
    556  
    557 function wps_five_sixths_shortcode( $atts , $content ) { 
     577add_shortcode( 'five_sixths', 'gsc_five_sixths_shortcode' ); 
     578 
     579function gsc_five_sixths_shortcode( $atts , $content ) { 
    558580     
    559581    $return_html = '<div class="five-sixths">' . do_shortcode ( $content ) . '</div>'; 
     
    569591 */ 
    570592 
    571 add_shortcode( 'five_sixths_first', 'wps_five_sixths_first_shortcode' ); 
    572  
    573 function wps_five_sixths_first_shortcode( $atts , $content ) { 
     593add_shortcode( 'five_sixths_first', 'gsc_five_sixths_first_shortcode' ); 
     594 
     595function gsc_five_sixths_first_shortcode( $atts , $content ) { 
    574596     
    575597    $return_html = '<div class="five-sixths first">' . do_shortcode ( $content ) . '</div>'; 
  • genesis-shortcodes/trunk/readme.txt

    r534809 r554874  
    1212== Description == 
    1313 
    14 This file creates all the shortcodes used throughout a site. While there is an array of shortcodes that are packaged with Genesis, this plugin provides a few more shortcodes that are used for the purpose of developing sites and migrating sites. It also enables code to execute shortcodes in the text widget. Contains the following shortcodes: [post_field], [child_url], [wpurl], [url], [uploads], [genesis_comments] & content columns shortcodes: 
     14This file creates all the shortcodes used throughout a site. While there is an array of shortcodes that are packaged with Genesis, this plugin provides a few more shortcodes that are used for the purpose of developing sites and migrating sites. It also enables code to execute shortcodes in the text widget. Contains the following shortcodes: [post_field], [child_url], [wpurl], [url], [site_url], [uploads], [genesis_comments] & content columns shortcodes. 
     15 
     16MultiSite Shortcode: 
     17 
     18 *   e.g. [site_url] 
     19 *   e.g. [site_url site="1"] 
     20 *   e.g. [site_url site="1" scheme="admin"] 
     21 *   e.g. [site_url site="1" path="/sample/"] 
     22 *   e.g. [site_url site="{optional_ID}" path="/path/relative/to/site/url" scheme="http|login|login_post|admin"] 
     23  
     24Content Columns Shortcodes 
    1525 
    1626 *   e.g. [one_half_first]CONTENT[/one_half_first][one_half]CONTENT[/one_half] 
     
    5161== Changelog == 
    5262 
     63= 0.3 = 
     64*   Added [site_url] for MS 
     65 
    5366= 0.2 = 
    5467*   Initial Release 
Note: See TracChangeset for help on using the changeset viewer.