Plugin Directory

Changeset 1057061


Ignore:
Timestamp:
12/30/2014 07:24:06 PM (11 years ago)
Author:
ciaranm
Message:

Fixing issue where shortcode links were displaying above page text.

Location:
pocket-wp/trunk
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • pocket-wp/trunk/pocket-wp.php

    r1057015 r1057061  
    44 * Plugin URI: http://ciaranmahoney.me/pocket-wp
    55 * Description: Adds a shortcode and widget which allows you to display your pocket links in a WordPress page/post.
    6  * Version: 0.3
     6 * Version: 0.4
    77 * Author: Ciaran Mahoney
    88 * Author URI: http://ciaranmahoney.me/
     
    3030// Set the version of this plugin
    3131if( ! defined( 'POCKET_WP' ) ) {
    32   define( 'POCKET_WP', '0.3' );
     32  define( 'POCKET_WP', '0.4' );
    3333}
    3434
     
    396396        // Loop through array and get link details.
    397397        foreach($pwp_items as $item){
    398             echo '<h3><a href="' . $item[0] . '" class="pwp_item_sc_link" target="_blank">' . $item[1] . '</a></h3>';
     398            $html[] = '<div class="pwp-links-shortcode">';
     399
     400            $html[] = '<h4><a href="' . $item[0] . '" class="pwp_item_sc_link" target="_blank">' . $item[1] . '</a></h4>';
    399401           
    400402            //Display excerpt if excerpt is not set to no. 
    401403            if (strtolower($excerpt) != 'no'){
    402                 echo '<p class="pwp_item_excerpt">' . $item[2] . '</p>';
     404                $html[] = '<p class="pwp_item_excerpt">' . $item[2] . '</p>';
    403405            }
    404406
    405407            // Display tag list if tag_list not set to no.
    406408            if(strtolower($tag_list) != 'no') {
    407                 echo '<p class="pwp_tag_list">';
     409                $html[] = '<p class="pwp_tag_list">';
    408410                foreach($item[3] as $tag) {
    409                     echo '<span class="pwp_tags">' . $tag['tag'] . '</span>';
     411                    $html[] = '<span class="pwp_tags">' . $tag['tag'] . '</span>';
    410412                }
    411                 echo'</p>';
     413                $html[] ='</p>';
    412414             }
    413415        }
     
    415417        if (strtolower($credit) == "yes") {
    416418            // Display author credit links
    417             echo '<p id="pwp_plugin_credit_sc"><a href="http://ciaranmahoney.me/code/pocket-wp/?utm_campaign=pocket-wp&utm_source=pwp-shortcode&utm_medium=wp-plugins" target="_blank">Pocket WP</a> by <a href="https://twitter.com/ciaransm" target="_blank">@ciaransm</a></p>';
     419            $html[] = '<p id="pwp_plugin_credit_sc"><a href="http://ciaranmahoney.me/code/pocket-wp/?utm_campaign=pocket-wp&utm_source=pwp-shortcode&utm_medium=wp-plugins" target="_blank">Pocket WP</a> by <a href="https://twitter.com/ciaransm" target="_blank">@ciaransm</a></p>';
    418420        } else {
    419421            // Do not show credit links unless user opts in.
    420422        }
     423
     424        return implode("\n", $html);
     425
    421426    } // end pwp_shortcode
    422427} // end pocketwp class
  • pocket-wp/trunk/readme.txt

    r1057023 r1057061  
    33Tags: links, pocket, shortcode, widget
    44Requires at least: 3.0.1
    5 Tested up to: 3.4
     5Tested up to: 4.1
    66Stable tag: trunk
    77License: GPLv2 or later
     
    7171== Changelog ==
    7272
     73= 0.4 =
     74* Fix so shortcode doesn't always display above text.
     75
    7376= 0.3 =
    7477* First public release
Note: See TracChangeset for help on using the changeset viewer.