Plugin Directory

Changeset 1240232


Ignore:
Timestamp:
09/07/2015 11:14:01 PM (11 years ago)
Author:
boyevul
Message:
  • (added) [mom_categories] shortcode (parent category display)
  • [mom_embed] imgur album/gallery display code update to current (official) embed code
  • Customize shortcode [code] (some restrictions may apply, with regards to words WordPress uses internally)
Location:
my-optional-modules/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • my-optional-modules/trunk/admin.settings-page-content.php

    r1233006 r1240232  
    33 * ADMIN Settings Page Content
    44 *
    5  * File last update: 10.1.0.2
     5 * File last update: 10.1.3
    66 *
    77 * Content of the /wp-admin/ SETTINGS PAGE for this plugin
     
    189189                        ' Disable Plugin CSS <em>Keeps this plugins CSS from enqueueing. You will need to manually style all plugin elements yourself.</em>' ,
    190190                        ' Disable Plugin Script <em>Keeps this plugins main jquery script from loading. You will lose some functionality.</em>' ,
    191                         ' Disable Plugin Shortcodes <em>You may choose to disable the file class.myoptionalmodules-shortcodes.php in its entirety. [mom_embed], [mom_hidden], and [mom_charts] will no longer work.</em>' ,
     191                        ' Disable Plugin Shortcodes <em>You may choose to disable the file class.myoptionalmodules-shortcodes.php in its entirety. [mom_embed], [mom_hidden], [mom_charts], and [mom_categories] will no longer work.</em>' ,
    192192                        ' Disable Comment form <em>Removes the comment form from every portion of your site, and replaces it with a blank template.</em>' ,
    193193                        ' Remove Unnecessary Code <em>Removes the XHTML generator, CSS and JS ids, feed links, Really Simple Discovery link, WLW Manifest link, adjacent posts links, and other such code clutter.</em>' ,
     
    256256                        'myoptionalmodules_sharelinks_text' ,
    257257                        'myoptionalmodules_google' ,
     258                        'myoptionalmodules_custom_embed' ,
     259                        'myoptionalmodules_custom_hidden' ,
     260                        'myoptionalmodules_custom_charts' ,
     261                        'myoptionalmodules_custom_categories' ,                     
    258262                        'myoptionalmodules_verification' ,
    259263                        'myoptionalmodules_alexa' ,
     
    264268                        'myoptionalmodules_disqus' ,
    265269                        'myoptionalmodules_miniloopstyle' ,
    266                         'myoptionalmodules_miniloopamount'
     270                        'myoptionalmodules_miniloopamount' 
    267271                    );
    268272                    $options_exclude = array (
     
    537541                                echo '
    538542                                </select></section>';
    539                                 $google = $previousclass = $nextclass = $readmore = $randompost = null;
    540                                 $google             = sanitize_text_field ( get_option ( 'myoptionalmodules_google' ) );
    541                                 $verification       = sanitize_text_field ( get_option ( 'myoptionalmodules_verification' ) );
    542                                 $alexa              = sanitize_text_field ( get_option ( 'myoptionalmodules_alexa' ) );
    543                                 $bing               = sanitize_text_field ( get_option ( 'myoptionalmodules_bing' ) );
    544                                 $previousclass      = sanitize_text_field ( get_option ( 'myoptionalmodules_previouslinkclass' ) );
    545                                 $nextclass          = sanitize_text_field ( get_option ( 'myoptionalmodules_nextlinkclass' ) );
    546                                 $randompost         = sanitize_text_field ( get_option ( 'myoptionalmodules_randompost' ) );
    547                                 $miniloop_meta      = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopmeta' ) );
    548                                 $miniloop_style     = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopstyle' ) );
    549                                 $miniloop_amount    = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopamount' ) );                                       
    550                                 $disqus             = sanitize_text_field ( get_option ( 'myoptionalmodules_disqus' ) );
     543                                $google               = $verification     = $alexa            =
     544                                $bing                 = $randompost       = $miniloop_meta    =
     545                                $miniloop_style       = $miniloop_amount  = $disqus           =
     546                                $shortcode_embed      = $shortcode_hidden = $shortcode_charts =
     547                                $shortcode_categories = null;
     548                               
     549                                $google               = sanitize_text_field ( get_option ( 'myoptionalmodules_google' ) );
     550                                $verification         = sanitize_text_field ( get_option ( 'myoptionalmodules_verification' ) );
     551                                $alexa                = sanitize_text_field ( get_option ( 'myoptionalmodules_alexa' ) );
     552                                $bing                 = sanitize_text_field ( get_option ( 'myoptionalmodules_bing' ) );
     553                                $randompost           = sanitize_text_field ( get_option ( 'myoptionalmodules_randompost' ) );
     554                                $miniloop_meta        = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopmeta' ) );
     555                                $miniloop_style       = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopstyle' ) );
     556                                $miniloop_amount      = sanitize_text_field ( get_option ( 'myoptionalmodules_miniloopamount' ) );                                     
     557                                $disqus               = sanitize_text_field ( get_option ( 'myoptionalmodules_disqus' ) );
     558                                $shortcode_embed      = sanitize_text_field ( get_option ( 'myoptionalmodules_custom_embed' ) );
     559                                $shortcode_hidden     = sanitize_text_field ( get_option ( 'myoptionalmodules_custom_hidden' ) );
     560                                $shortcode_charts     = sanitize_text_field ( get_option ( 'myoptionalmodules_custom_charts' ) );
     561                                $shortcode_categories = sanitize_text_field ( get_option ( 'myoptionalmodules_custom_categories' ) );
     562                               
    551563                                echo "
     564                                <section><hr /><strong>Shortcode Customization</strong></section>
     565                                <section>
     566                                    <label for='myoptionalmodules_custom_embed'>Embed shortcode parameter <small>&mdash; default: mom_embed</small>
     567                                    <input class='full-text' type='text' id='myoptionalmodules_custom_embed' name='myoptionalmodules_custom_embed' value='{$shortcode_embed}' />
     568                                </section>
     569                                <section>
     570                                    <label for='myoptionalmodules_custom_hidden'>Hidden shortcode parameter <small>&mdash; default: mom_hidden</small>
     571                                    <input class='full-text' type='text' id='myoptionalmodules_custom_hidden' name='myoptionalmodules_custom_hidden' value='{$shortcode_hidden}' />
     572                                </section>
     573                                <section>
     574                                    <label for='myoptionalmodules_custom_charts'>Charts shortcode parameter <small>&mdash; default: mom_charts</small>
     575                                    <input class='full-text' type='text' id='myoptionalmodules_custom_charts' name='myoptionalmodules_custom_charts' value='{$shortcode_charts}' />
     576                                </section>
     577                                <section>
     578                                    <label for='myoptionalmodules_custom_categories'>Categories shortcode parameter <small>&mdash; default: mom_categories</small>
     579                                    <input class='full-text' type='text' id='myoptionalmodules_custom_categories' name='myoptionalmodules_custom_categories' value='{$shortcode_categories}' />
     580                                </section>
     581                                <section><hr /></section>
     582                               
     583                               
     584                               
    552585                                <section>
    553586                                    <label for='myoptionalmodules_disqus'>Disqus Shortname <small>&mdash; <strong>this</strong>.disqus.com</small> <em>Enables Disqus comments for your posts.</em></label>
  • my-optional-modules/trunk/class.mom-mediaembed.php

    r1233006 r1240232  
    33 * CLASS mom_mediaEmbed()
    44 *
    5  * File last update: 10.0.9.5
     5 * File last update: 10.1.3
    66 *
    77 * Create a media embed from a URL in a template (or other) by passing a
     
    131131                    $url = sanitize_text_field ( $url );
    132132                    if ( strpos ( $path , '/a/' ) !== false ):
    133                         $output .= "<iframe class='imgur-album' src='//imgur.com/a/{$url}/embed'></iframe>";
     133                        $output .= "<blockquote class='imgur-embed-pub' lang='en' data-id='a/{$url}'></blockquote><script async src='//s.imgur.com/min/embed.js' charset='utf-8'></script>";
    134134                    elseif ( strpos ( $path , '/gallery/' ) !== false ):
    135135                        $url = str_replace ( 'imgur.com/gallery/' , '' , $url );
    136                         $output .= "<div class='imgur-iframe'><blockquote class='imgur-embed-pub' lang='en' data-id='{$url}' data-context='false'><a rel='nofollow' href='//imgur.com/{$url}'>View post on imgur.com</a></blockquote><script async src='//s.imgur.com/min/embed.js' charset='utf-8'></script></div>";
     136                        $output .= "<blockquote class='imgur-embed-pub' lang='en' data-id='a/{$url}'></blockquote><script async src='//s.imgur.com/min/embed.js' charset='utf-8'></script>";
    137137                    else:
    138138                        $ext = pathinfo($url, PATHINFO_EXTENSION);
     
    265265            endif;
    266266           
    267             if ( $gumboard_user_disable_img ):
    268                 echo "<div class='{$class}'>";
    269                     echo "<p><a rel='nofollow' href='{$original_url}'>Attachment</a> <small>&mdash; you currently have embeds turned off.</small></p>";
    270                     $output = null;
     267            if ( $output ):
     268                if ( 'user_info_image' != $class ):
     269                    echo "<div class='embed'>";
     270                    echo $output;
     271                else:
     272                    echo '<div class="user_info_image">';
     273                    echo $output;
     274                endif;
    271275                echo '</div>';
    272276            else:
    273                 if ( $output ):
    274                     if ( 'user_info_image' != $class ):
    275                         echo "<div class='embed'>";
    276                         echo $output;
    277                     else:
    278                         echo '<div class="user_info_image">';
    279                         echo $output;
    280                     endif;
    281                     echo '</div>';
    282                 else:
    283                     echo "<div class='gumboard_content_comment'><p><a rel='nofollow' href='{$url}'>Attached link</a> <small>(<a href='//{$host}'>{$host}</a>)</small></p></div>";
    284                 endif;
    285             endif;
     277                echo "<div class='gumboard_content_comment'><p><a rel='nofollow' href='{$url}'>Attached link</a> <small>(<a href='//{$host}'>{$host}</a>)</small></p></div>";
     278            endif;
     279
    286280           
    287281        endif;
  • my-optional-modules/trunk/class.myoptionalmodules-shortcodes.php

    r1222674 r1240232  
    33 * CLASS myoptionalmodules_shortcodes()
    44 *
    5  * File last update: 10.0.9.6
     5 * File update: 10.1.3
    66 *
    77 * All shortcodes for My Optional Modules
     
    1515
    1616    function __construct() {
    17         remove_shortcode ( 'mom_embed' );
    18         remove_shortcode ( 'mom_hidden' );
    19         remove_shortcode ( 'mom_charts' );
    20 
    21         add_shortcode    ( 'mom_embed' , array ( $this , 'embed' ) );
    22         add_shortcode    ( 'mom_hidden' , array ( $this , 'hidden' ) );
    23         add_shortcode    ( 'mom_charts' , array ( $this , 'charts' ) );
     17       
     18        /**
     19         * Customize shortcode code
     20         */
     21       
     22        global $myoptionalmodules_custom_embed;
     23        global $myoptionalmodules_custom_hidden;
     24        global $myoptionalmodules_custom_charts;
     25        global $myoptionalmodules_custom_categories;
     26       
     27        if( !$myoptionalmodules_custom_embed ){
     28            $myoptionalmodules_custom_embed = 'mom_embed';
     29        }
     30        if( !$myoptionalmodules_custom_hidden ){
     31            $myoptionalmodules_custom_hidden = 'mom_hidden';
     32        }
     33        if( !$myoptionalmodules_custom_charts ){
     34            $myoptionalmodules_custom_charts = 'mom_charts';
     35        }
     36        if( !$myoptionalmodules_custom_categories ){
     37            $myoptionalmodules_custom_categories = 'mom_categories';
     38        }   
     39       
     40        remove_shortcode ( $myoptionalmodules_custom_embed );
     41        remove_shortcode ( $myoptionalmodules_custom_hidden );
     42        remove_shortcode ( $myoptionalmodules_custom_charts );
     43        remove_shortcode ( $myoptionalmodules_custom_categories );
     44        add_shortcode    ( $myoptionalmodules_custom_embed , array ( $this , 'embed' ) );
     45        add_shortcode    ( $myoptionalmodules_custom_hidden , array ( $this , 'hidden' ) );
     46        add_shortcode    ( $myoptionalmodules_custom_charts , array ( $this , 'charts' ) );
     47        add_shortcode    ( $myoptionalmodules_custom_categories , array ( $this , 'categories' ) );
    2448    }
    2549   
     
    85109    }
    86110   
    87     function charts ( $atts ) {
     111    function charts( $atts ) {
    88112
    89113        /*
     
    163187        }
    164188        return $output;
    165     }       
     189    }
     190   
     191    function categories() {
     192        $output = null;
     193        $output .= '<div class="mom_cat-container">';
     194        $args = array(
     195            'orderby' => 'name',
     196            'parent' => 0
     197        );
     198        $categories = get_categories( $args );
     199        foreach ( $categories as $category ) {
     200            $link = get_category_link( $category->term_id );
     201            $output .= "<div class='mom_cat-containers'><span><strong><a href='{$link}'>{$category->name}</a></strong></span>{$category->description}</div>";
     202        }
     203        $output .= '</div>';
     204       
     205        return $output;
     206    }
    166207}
    167208$myoptionalmodules_shortcodes = new myoptionalmodules_shortcodes();
  • my-optional-modules/trunk/includes/css/myoptionalmodules10.css

    r1229384 r1240232  
    1 .mom_minilist *:before, .mom_minilist *:after, .mom_minilist *,#mom_onthisday *:before,#mom_onthisday *:after, #mom_onthisday *,.mom_postrotation *:before, .mom_postrotation *:after, .mom_postrotation * {
    2     box-sizing: border-box;
    3     -moz-box-sizing: border-box;
    4     -webkit-box-sizing: border-box;
    5 }
     1/**
     2 * [mom_categories]
     3 */
     4.mom_cat-container {
     5    clear: both;
     6    display: block;
     7    font-size: 1rem;
     8    margin: 20px auto;
     9    overflow-x: hidden;
     10    overflow-y: auto;
     11    padding: 5% 10%;
     12}
     13    .mom_cat-container span {
     14        font-weight: 700;
     15    }
     16    .mom_cat-container a,
     17    .mom_cat-container span {
     18        border-bottom: 1px solid rgba(0,0,0,0);
     19        clear: both;
     20        display: block;
     21        margin: 5px 0;
     22    }
     23    .mom_cat-container a:hover {
     24        border-bottom: 1px solid rgba(0,0,0,.1);
     25    }
     26    .mom_cat-containers {
     27        float: left;
     28        padding: 10px 10px 20px;
     29        width: 25%;
     30    }
     31
    632
    733/**
     
    671697    z-index: 0!important;
    672698}
     699
     700@media screen and (max-width: 55.250em) {
     701.mom_cat-container {
     702    clear: both;
     703    display: block;
     704    font-size: 1rem;
     705    margin: auto;
     706    overflow-x: hidden;
     707    overflow-y: auto;
     708    padding: 4.5454% 9.0909%;
     709}
     710    .mom_cat-container span {
     711        clear: both;
     712        display: block;
     713        margin: 5px 0;
     714    }
     715    .mom_cat-containers {
     716        width: 33%;
     717    }
     718}
     719
     720@media screen and (max-width: 31.250em ) {
     721.mom_cat-container {
     722    clear: both;
     723    display: block;
     724    font-size: 1rem;
     725    margin: auto;
     726    overflow-x: hidden;
     727    overflow-y: auto;
     728    padding: 10px 35px;
     729}
     730    .mom_cat-container span {
     731        clear: both;
     732        display: block;
     733        margin: 5px 0;
     734    }
     735    .mom_cat-containers {
     736        width: 50%;
     737    }
     738}
     739
     740@media screen and (max-width: 21.250em ) {
     741.mom_cat-container {
     742    clear: both;
     743    display: block;
     744    font-size: 1rem;
     745    margin: auto;
     746    overflow-x: hidden;
     747    overflow-y: auto;
     748    padding: 10px;
     749}
     750    .mom_cat-container span {
     751        clear: both;
     752        display: block;
     753        margin: 5px 0;
     754    }
     755    .mom_cat-containers {
     756        width: 100%;
     757    }
     758}
  • my-optional-modules/trunk/plugin.php

    r1233006 r1240232  
    44Plugin URI:
    55Description: Optional modules and additions for Wordpress.
    6 Version: 10.1.0.2
     6Version: 10.1.3
    77Author: boyevul
    88Author URI:
     
    6262$myoptionalmodules_exclude_usersuserswed               = $myoptionalmodules_exclude_usersusersthu               = $myoptionalmodules_exclude_usersusersfri              =
    6363$myoptionalmodules_exclude_usersuserssat               = $myoptionalmodules_disqus                              = $myoptionalmodules_pluginscript                       =
    64 $myoptionalmodules_analyticspostsonly                  = $myoptionalmodules_pluginshortcodes                    = null;
     64$myoptionalmodules_analyticspostsonly                  = $myoptionalmodules_pluginshortcodes                    =
     65$myoptionalmodules_custom_embed                        = $myoptionalmodules_custom_hidden                       = $myoptionalmodules_custom_charts                      =
     66$myoptionalmodules_custom_categories                   = null;
    6567
    6668
     
    167169    if( $name == 'myoptionalmodules_verification' && $value ):                        $myoptionalmodules_verification                         = $value; endif;
    168170    if( $name == 'myoptionalmodules_randompost' && $value ):                          $myoptionalmodules_randompost                           = esc_html ( $value ); endif;
    169      
     171   
     172    if( $name == 'myoptionalmodules_custom_embed' && $value ):                        $myoptionalmodules_custom_embed                         = $value; endif;
     173    if( $name == 'myoptionalmodules_custom_hidden' && $value ):                       $myoptionalmodules_custom_hidden                        = $value; endif;
     174    if( $name == 'myoptionalmodules_custom_charts' && $value ):                       $myoptionalmodules_custom_charts                        = $value; endif;
     175    if( $name == 'myoptionalmodules_custom_categories' && $value ):                   $myoptionalmodules_custom_categories                    = $value; endif;
     176   
    170177    // Exclude Posts     
    171178    if( $name == 'myoptionalmodules_exclude_categories_level0categories' && $value ): $myoptionalmodules_exclude_categories_level0categories  = $value; endif;
  • my-optional-modules/trunk/readme.txt

    r1233006 r1240232  
    44Requires at least: 4.1
    55Tested up to: 4.3
    6 Stable tag: 10.1.0.2
     6Stable tag: 10.1.3
    77
    88An assortment of functions to enhance WordPress.
     
    9090while overall determines if the overall score is to be displayed.
    9191
     92= [mom_categories] =
     93Creates a display column(s) of all parent categories, with links, and descriptions of each.
     94
    9295== Screenshots ==
    93961.  A horizontal gallery in a post.
     
    9598
    9699== Changelog ==
     100= 10.1.3 =
     101*   *Release Date - 7th, September, 2015*
     102*   (added) [mom_categories] shortcode (parent category display)
     103*   [mom_embed] imgur album/gallery display code update to current (official) embed code
     104*   Customize shortcode [code] (some restrictions may apply, with regards to words WordPress uses internally)
     105
    97106= 10.1.0.2 =
    98107*   *Release Date - 28th, August, 2015*
Note: See TracChangeset for help on using the changeset viewer.