Plugin Directory

Changeset 1052888


Ignore:
Timestamp:
12/23/2014 08:26:14 PM (11 years ago)
Author:
ssmwordpressdev
Message:

Changing shortcode to use a dash instead of underscore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • second-street-promotion/trunk/secondstreet-promotion.php

    r1051287 r1052888  
    44 * Description: Plugin will allow Second Street Affiliates to embed a Second Street Promotion within their WordPress site(s).
    55 * Version: 1.0
    6  * Author: Second Street
     6 * Author: Second Street (Heather McCarron)
    77 * Author URI: http://secondstreet.com
    88 * License: GPL2
    99 */
    10  
    11  /*  Copyright 2014  Second Street
     10
     11/*  Copyright 2014  Second Street | Heather McCarron  (email : [email protected])
    1212
    1313    This program is free software; you can redistribute it and/or modify
    14     it under the terms of the GNU General Public License, version 2, as 
     14    it under the terms of the GNU General Public License, version 2, as
    1515    published by the Free Software Foundation.
    1616
     
    2323    along with this program; if not, write to the Free Software
    2424    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    25 **************************************************************************/ 
    26  
    27     // Blocks direct access to plugin
    28     defined('ABSPATH') or die("Access Forbidden");
    29    
    30     defined('ABSPATH') or die("Access Forbidden"); // Blocks direct access to plugin
    31    
    32     // Define Second Street Plugin
    33     define('SECONDSTREET_PLUGIN', '1.0');
    34     define('SECONDSTREET_PLUGIN__MINIMUM_WP_VERSION', '3.1');
    35     define('SECONDSTREET_PLUGIN_URL', plugin_dir_url(__FILE__));
    36     define('SECONDSTREET_PLUGIN', plugin_dir_path( __FILE__ ));
    37    
    38     // [ss-promo] Code
    39     function ss_promo_func($atts, $content = null) {
    40         $a = shortcode_atts(array (
     25**************************************************************************/
     26
     27// Blocks direct access to plugin
     28defined( 'ABSPATH' ) or die( "Access Forbidden" );
     29
     30defined( 'ABSPATH' ) or die( "Access Forbidden" ); // Blocks direct access to plugin
     31
     32// Define Second Street Plugin
     33define( 'SECONDSTREET_PLUGIN_VERSION', '1.0' );
     34define( 'SECONDSTREET_PLUGIN__MINIMUM_WP_VERSION', '3.1' );
     35define( 'SECONDSTREET_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     36define( 'SECONDSTREET_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     37
     38// [ss-promo] Code
     39function ss_promo_func( $atts, $content = null ) {
     40    $a = shortcode_atts( array (
    4141            'op_id' => '',
    4242            'op_guid' => '',
    4343            'routing' => ''
    44         ), $atts);
    45        
    46         return '<script src="https://embed-' . $a['op_id'] . '.secondstreetapp.com/Scripts/dist/embed.js" data-ss-embed="promotion" data-opguid="' . $a['op_guid'] . '" data-routing="' . $a['routing'] . '"></script>';
    47    
    48     }
    49     add_shortcode( 'ss_promo', 'ss_promo_func' );
     44        ), $atts );
     45
     46    $ss_script_url = 'https://embed-' . $a['op_id'] . '.secondstreetapp.com/Scripts/dist/embed.js';
     47
     48    return '<script src="' . esc_url( $ss_script_url ) . '" data-ss-embed="promotion" data-opguid="' . esc_attr( $a['op_guid'] ) . '" data-routing="' . esc_attr( $a['routing'] ) . '"></script>';
     49
     50}
     51add_shortcode( 'ss-promo', 'ss_promo_func' );
Note: See TracChangeset for help on using the changeset viewer.