Plugin Directory

Changeset 749949


Ignore:
Timestamp:
08/02/2013 12:18:49 PM (13 years ago)
Author:
jhinson
Message:

Updated Plugin to 1.5.6 to fix has_shortcode issue.

Location:
mybooks-for-authors
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mybooks-for-authors/tags/1.5.6/css/ot-book-styles.css

    r706579 r749949  
    55.store-links{padding-bottom:2px;}
    66.booklinks{padding:5px 5px 0 5px;clear:both;border-top:3px double #DDD;border-bottom:3px double #DDD;}
     7.bookseller-links {display:block;}
    78.bookseller-links img{padding:5px;}
    89.buy-book-text{padding-left:5px;}
  • mybooks-for-authors/tags/1.5.6/ot-book-content.php

    r687083 r749949  
    3232    if ( stripos( $content, '<img') ) {
    3333        // if there is an image inserted into the content...continue inside here:
    34         if (has_shortcode('booklinks')) {
    35 //          echo "We have the image in the ontent, and the shortcode for booklinks has been added.";
     34        if (has_shortcode($content, 'booklinks')) {
     35//          echo "We have the image in the content, and the shortcode for booklinks has been added.";
    3636            $content = $content;
    3737        } else {
     
    4848    else
    4949    {
    50         if (has_shortcode('booklinks')) {
     50        if (has_shortcode($content, 'booklinks')) {
    5151//          echo "we don't have an image, but we do have the booklinks shortcode";
    5252            $content = $image . $content;
     
    6262    return $content;
    6363}
    64 ?>
  • mybooks-for-authors/tags/1.5.6/ot-functions.php

    r703082 r749949  
    2727    wp_enqueue_script( 'jquery-cycle', plugins_url( 'js/jquery.cycle.all.min.js', __FILE__ ));
    2828}
     29if (!function_exists('has_shortcode')) {
     30    function has_shortcode( $content, $tag ) {
     31        if ( shortcode_exists( $tag ) ) {
     32            preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
     33            if ( empty( $matches ) )
     34                return false;
    2935
    30 function has_shortcode( $shortcode = NULL ) {
     36            foreach ( $matches as $shortcode ) {
     37                if ( $tag === $shortcode[2] )
     38                    return true;
     39            }
     40        }
     41        return false;
     42    }
     43}
     44if (!function_exists('shortcode_exists')) {
     45    function shortcode_exists( $tag ) {
     46        global $shortcode_tags;
     47        return array_key_exists( $tag, $shortcode_tags );
     48    }
     49}
    3150
    32     $post_to_check = get_post( get_the_ID() );
    33 
    34     // false because we have to search through the post content first
    35     $found = false;
    36 
    37     // if no short code was provided, return false
    38     if ( ! $shortcode ) {
    39         return $found;
    40     }
    41     // check the post content for the short code
    42     if ( stripos( $post_to_check->post_content, '[' . $shortcode) !== FALSE ) {
    43         // we have found the short code
    44         $found = TRUE;
    45     }
    46 
    47     // return our final results
    48     return $found;
    49 }
    5051function ot_booklinks( $amazon = '', $bn = '', $ceoread = '', $ibooks = '', $indie = '', $itunes = '', $audible = '', $bam = '') { 
    5152    $booklinks = '';
     
    114115   
    115116}
    116 ?>
  • mybooks-for-authors/tags/1.5.6/readme.txt

    r708675 r749949  
    33Tags: books, authors, books widget, books plugin, books post type, author plugin, add books, display books, sell books
    44Requires at least: 3.1
    5 Tested up to: 3.4.1
    6 Stable tag: 1.5.5
     5Tested up to: 3.6
     6Stable tag: 1.5.6
    77License: GPLv2
    88
     
    4545
    4646== Changelog ==
     47
     48= 1.5.6 =
     49* Fixed plugin for WordPress 3.6 conflicting function (has_shortcode()) which caused a fatal error.
     50
    4751= 1.5.5 =
    4852* Fixed a css issue where some margin was removed on the buy links
  • mybooks-for-authors/trunk/css/ot-book-styles.css

    r706579 r749949  
    55.store-links{padding-bottom:2px;}
    66.booklinks{padding:5px 5px 0 5px;clear:both;border-top:3px double #DDD;border-bottom:3px double #DDD;}
     7.bookseller-links {display:block;}
    78.bookseller-links img{padding:5px;}
    89.buy-book-text{padding-left:5px;}
  • mybooks-for-authors/trunk/ot-book-content.php

    r687083 r749949  
    3232    if ( stripos( $content, '<img') ) {
    3333        // if there is an image inserted into the content...continue inside here:
    34         if (has_shortcode('booklinks')) {
    35 //          echo "We have the image in the ontent, and the shortcode for booklinks has been added.";
     34        if (has_shortcode($content, 'booklinks')) {
     35//          echo "We have the image in the content, and the shortcode for booklinks has been added.";
    3636            $content = $content;
    3737        } else {
     
    4848    else
    4949    {
    50         if (has_shortcode('booklinks')) {
     50        if (has_shortcode($content, 'booklinks')) {
    5151//          echo "we don't have an image, but we do have the booklinks shortcode";
    5252            $content = $image . $content;
     
    6262    return $content;
    6363}
    64 ?>
  • mybooks-for-authors/trunk/ot-functions.php

    r703082 r749949  
    2727    wp_enqueue_script( 'jquery-cycle', plugins_url( 'js/jquery.cycle.all.min.js', __FILE__ ));
    2828}
     29if (!function_exists('has_shortcode')) {
     30    function has_shortcode( $content, $tag ) {
     31        if ( shortcode_exists( $tag ) ) {
     32            preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
     33            if ( empty( $matches ) )
     34                return false;
    2935
    30 function has_shortcode( $shortcode = NULL ) {
     36            foreach ( $matches as $shortcode ) {
     37                if ( $tag === $shortcode[2] )
     38                    return true;
     39            }
     40        }
     41        return false;
     42    }
     43}
     44if (!function_exists('shortcode_exists')) {
     45    function shortcode_exists( $tag ) {
     46        global $shortcode_tags;
     47        return array_key_exists( $tag, $shortcode_tags );
     48    }
     49}
    3150
    32     $post_to_check = get_post( get_the_ID() );
    33 
    34     // false because we have to search through the post content first
    35     $found = false;
    36 
    37     // if no short code was provided, return false
    38     if ( ! $shortcode ) {
    39         return $found;
    40     }
    41     // check the post content for the short code
    42     if ( stripos( $post_to_check->post_content, '[' . $shortcode) !== FALSE ) {
    43         // we have found the short code
    44         $found = TRUE;
    45     }
    46 
    47     // return our final results
    48     return $found;
    49 }
    5051function ot_booklinks( $amazon = '', $bn = '', $ceoread = '', $ibooks = '', $indie = '', $itunes = '', $audible = '', $bam = '') { 
    5152    $booklinks = '';
     
    114115   
    115116}
    116 ?>
  • mybooks-for-authors/trunk/readme.txt

    r708675 r749949  
    33Tags: books, authors, books widget, books plugin, books post type, author plugin, add books, display books, sell books
    44Requires at least: 3.1
    5 Tested up to: 3.4.1
    6 Stable tag: 1.5.5
     5Tested up to: 3.6
     6Stable tag: 1.5.6
    77License: GPLv2
    88
     
    4545
    4646== Changelog ==
     47
     48= 1.5.6 =
     49* Fixed plugin for WordPress 3.6 conflicting function (has_shortcode()) which caused a fatal error.
     50
    4751= 1.5.5 =
    4852* Fixed a css issue where some margin was removed on the buy links
Note: See TracChangeset for help on using the changeset viewer.