Plugin Directory

Changeset 1727679


Ignore:
Timestamp:
09/10/2017 03:24:50 PM (9 years ago)
Author:
softmixt
Message:

1.0.1

  • SFT Relations widget added
  • Custom container item title element added , now we can change post title element type if none set will be no element for title.
Location:
softmixt-relations/trunk
Files:
3 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • softmixt-relations/trunk/README.txt

    r1689256 r1727679  
    4040        $item_container          = $atts[ 'item_container' ];
    4141
     42        // Related item container title element (set on short code).
     43        $item_title_container          = $atts[ 'item_title_container' ];
     44
    4245        // Related item container class element (set on short code).
    4346        $item_container_class    = $atts[ 'item_container_class' ];
     
    7376
    7477This section describes how to install the plugin and get it working.
    75 
    76 e.g.
    77 
    78781. Upload the plugin files to the `/wp-content/plugins/softmixt-relations` directory, or install the plugin through the WordPress plugins screen directly.
    79791. Activate the plugin through the 'Plugins' screen in WordPress
     
    1021023. You can insert your connection into your post content by using the tinyMCE new button.
    103103
    104 4. When you click on tinyMCE connections button you will bring up a new popup where you can set :  "Container element", "Custom container class", "Item container element", "Custom class item", "Show post meta"
     1044. When you click on tinyMCE connections button you will bring up a new popup where you can set :  "Container element", "Custom container class", "Item container element", "Item container title element", "Custom class item", "Show post meta"
    105105
    1061065. After tinyMCE modal submitted  an a shortcode automatically created and  inserted to WP Content.
     
    110110== Changelog ==
    111111
    112 = 1.0 =
     112= 1.0.1 =
     113* SFT Relations widget added
     114* Custom container item title element added , now we can change post title element type if none set will be no element for title.
     115
     116= 1.0.0 =
    113117* First Stable Release
    114118
  • softmixt-relations/trunk/admin/assets/js/plugin-admin.js

    r1689232 r1727679  
    157157            {
    158158                $ ( post_to_connect + ' > [data-post-type="' + post_type + '"] ' ).show ();
    159 
    160159            }
    161160
     
    221220    }
    222221
    223 
    224222})
    225223( jQuery );
  • softmixt-relations/trunk/admin/assets/tinymce/plugins/sftrelations/plugin.js

    r1689232 r1727679  
    6868                                                    ] ,
    6969                                                    minWidth : 350
     70                                                } , {
     71                                                    type : 'listbox' ,
     72                                                    name : 'sft_item_title_element' ,
     73                                                    label : 'Item container title element' ,
     74                                                    values : [
     75                                                        { text : 'None' , value : 'none' } ,
     76                                                        { text : 'H1' , value : 'h1' } ,
     77                                                        { text : 'H2' , value : 'h2' } ,
     78                                                        { text : 'H3' , value : 'h3' } ,
     79                                                        { text : 'H4' , value : 'h4' } ,
     80                                                        { text : 'H5' , value : 'h5' } ,
     81                                                        { text : 'H6' , value : 'h6' } ,
     82                                                        { text : 'Paragraph' , value : 'p' } ,
     83                                                        { text : 'Span' , value : 'span' }
     84                                                    ] ,
     85                                                    minWidth : 350
    7086                                                } ,
    7187                                                {
     
    126142                                                var container_class         = e.data.sft_container_class ? 'container_class="' + e.data.sft_container_class + '" ' : '';
    127143                                                var item_container          = 'item_container="' + e.data.sft_item_container + '" ';
     144                                                var item_title_container    = 'item_title_container="' + e.data.sft_item_title_element + '" ';
    128145                                                var item_container_class    = e.data.sft_item_container_class ? 'item_container_class="' + e.data.sft_item_container_class + '" ' : '';
    129146                                                var item_show_title         = e.data.sft_item_show_title === true ? 'item_show_title="' + e.data.sft_item_show_title + '" ' : '';
     
    138155                                                                   container_class +
    139156                                                                   item_container +
     157                                                                   item_title_container +
    140158                                                                   item_container_class +
    141159                                                                   item_show_title +
  • softmixt-relations/trunk/admin/assets/tinymce/plugins/sftrelations/plugin.min.js

    r1689232 r1727679  
    1 (function(){tinymce.create("tinymce.plugins.sftrelations",{init:function(a,b){a.addButton("sftrelations",{title:"SFT Relations",cmd:"sftrelations",image:b+"/sftrelations.png"});a.addCommand("sftrelations",function(){a.windowManager.open({title:"Add related posts",body:[{type:"listbox",name:"sft_container",label:"Container element",values:[{text:"Div",value:"div"},{text:"Ul",value:"ul"},{text:"Section",value:"section"},{text:"Article",value:"article"}],minWidth:350},{type:"textbox",name:"sft_container_class",label:"Custom container class",placeholder:"Custom container class ...",multiline:false,minWidth:700,minHeight:50},{type:"listbox",name:"sft_item_container",label:"Item container element",values:[{text:"Div",value:"div"},{text:"Span",value:"span"},{text:"Section",value:"section"},{text:"Article",value:"article"},{text:"P",value:"p"}],minWidth:350},{type:"textbox",name:"sft_item_container_class",label:"Custom item class",placeholder:"Custom container item class ...",multiline:false,minWidth:700,minHeight:50},{label:"Show post meta",type:"checkbox",name:"sft_item_show_title",text:"Show post title",checked:true},{label:" ",text:"Show post date",type:"checkbox",name:"sft_item_show_date",checked:true},{label:" ",text:"Show post author",type:"checkbox",name:"sft_item_show_author",checked:false},{label:" ",text:"Show post feature image",type:"checkbox",name:"sft_item_show_feature_image",checked:false},{label:" ",text:"Show post excerpt",type:"checkbox",name:"sft_item_show_excerpt",checked:false},{label:" ",text:"Show post content",type:"checkbox",name:"sft_item_show_content",checked:false}],onsubmit:function(k){var m='container="'+k.data.sft_container+'" ';var g=k.data.sft_container_class?'container_class="'+k.data.sft_container_class+'" ':"";var d='item_container="'+k.data.sft_item_container+'" ';var j=k.data.sft_item_container_class?'item_container_class="'+k.data.sft_item_container_class+'" ':"";var h=k.data.sft_item_show_title===true?'item_show_title="'+k.data.sft_item_show_title+'" ':"";var l=k.data.sft_item_show_date===true?'item_show_date="'+k.data.sft_item_show_date+'" ':"";var n=k.data.sft_item_show_author===true?'item_show_author="'+k.data.sft_item_show_author+'" ':"";var c=k.data.sft_item_show_feature_image===true?'item_show_feature_image="'+k.data.sft_item_show_feature_image+'" ':"";var f=k.data.sft_item_show_excerpt===true?'item_show_excerpt="'+k.data.sft_item_show_excerpt+'" ':"";var i=k.data.sft_item_show_content===true?'item_show_content="'+k.data.sft_item_show_content+'" ':"";a.insertContent("[sftrelations "+m+g+d+j+h+l+n+c+f+i+"  ]")}})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Add related posts.",author:"softmixt",authorurl:"http://softmixt.com",infourl:"http://softmixt.com/wordpress/plugins/softmixt-relations/",version:"0.1"}}});tinymce.PluginManager.add("sftrelations",tinymce.plugins.sftrelations)})();
     1(function(){tinymce.create("tinymce.plugins.sftrelations",{init:function(a,b){a.addButton("sftrelations",{title:"SFT Relations",cmd:"sftrelations",image:b+"/sftrelations.png"});a.addCommand("sftrelations",function(){a.windowManager.open({title:"Add related posts",body:[{type:"listbox",name:"sft_container",label:"Container element",values:[{text:"Div",value:"div"},{text:"Ul",value:"ul"},{text:"Section",value:"section"},{text:"Article",value:"article"}],minWidth:350},{type:"textbox",name:"sft_container_class",label:"Custom container class",placeholder:"Custom container class ...",multiline:false,minWidth:700,minHeight:50},{type:"listbox",name:"sft_item_container",label:"Item container element",values:[{text:"Div",value:"div"},{text:"Span",value:"span"},{text:"Section",value:"section"},{text:"Article",value:"article"},{text:"P",value:"p"}],minWidth:350},{type:"listbox",name:"sft_item_title_element",label:"Item container title element",values:[{text:"None",value:"none"},{text:"H1",value:"h1"},{text:"H2",value:"h2"},{text:"H3",value:"h3"},{text:"H4",value:"h4"},{text:"H5",value:"h5"},{text:"H6",value:"h6"},{text:"Paragraph",value:"p"},{text:"Span",value:"span"}],minWidth:350},{type:"textbox",name:"sft_item_container_class",label:"Custom item class",placeholder:"Custom container item class ...",multiline:false,minWidth:700,minHeight:50},{label:"Show post meta",type:"checkbox",name:"sft_item_show_title",text:"Show post title",checked:true},{label:" ",text:"Show post date",type:"checkbox",name:"sft_item_show_date",checked:true},{label:" ",text:"Show post author",type:"checkbox",name:"sft_item_show_author",checked:false},{label:" ",text:"Show post feature image",type:"checkbox",name:"sft_item_show_feature_image",checked:false},{label:" ",text:"Show post excerpt",type:"checkbox",name:"sft_item_show_excerpt",checked:false},{label:" ",text:"Show post content",type:"checkbox",name:"sft_item_show_content",checked:false}],onsubmit:function(l){var n='container="'+l.data.sft_container+'" ';var h=l.data.sft_container_class?'container_class="'+l.data.sft_container_class+'" ':"";var d='item_container="'+l.data.sft_item_container+'" ';var f='item_title_container="'+l.data.sft_item_title_element+'" ';var k=l.data.sft_item_container_class?'item_container_class="'+l.data.sft_item_container_class+'" ':"";var i=l.data.sft_item_show_title===true?'item_show_title="'+l.data.sft_item_show_title+'" ':"";var m=l.data.sft_item_show_date===true?'item_show_date="'+l.data.sft_item_show_date+'" ':"";var o=l.data.sft_item_show_author===true?'item_show_author="'+l.data.sft_item_show_author+'" ':"";var c=l.data.sft_item_show_feature_image===true?'item_show_feature_image="'+l.data.sft_item_show_feature_image+'" ':"";var g=l.data.sft_item_show_excerpt===true?'item_show_excerpt="'+l.data.sft_item_show_excerpt+'" ':"";var j=l.data.sft_item_show_content===true?'item_show_content="'+l.data.sft_item_show_content+'" ':"";a.insertContent("[sftrelations "+n+h+d+f+k+i+m+o+c+g+j+"  ]")}})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Add related posts.",author:"softmixt",authorurl:"http://softmixt.com",infourl:"http://softmixt.com/wordpress/plugins/softmixt-relations/",version:"0.1"}}});tinymce.PluginManager.add("sftrelations",tinymce.plugins.sftrelations)})();
  • softmixt-relations/trunk/public/public.php

    r1689232 r1727679  
    4040            $atts    = shortcode_atts (
    4141                array (
    42                     'post_id'              => $post_id ,
    43                     'container'            => 'div' ,
    44                     'container_class'      => 'sft-rlp-container' ,
    45                     'item_container'       => 'div' ,
    46                     'item_container_class' => 'sft-rlp-itm-container' ,
    47 
     42                    'post_id'                 => $post_id ,
     43                    'container'               => 'div' ,
     44                    'container_class'         => 'sft-rlp-container' ,
     45                    'item_container'          => 'div' ,
     46                    'item_title_container'    => 'none' ,
     47                    'item_container_class'    => 'sft-rlp-itm-container' ,
    4848                    'item_show_title'         => 'true' ,
    4949                    'item_show_date'          => 'true' ,
     
    6060            $container_class         = $atts[ 'container_class' ];
    6161            $item_container          = $atts[ 'item_container' ];
     62            $item_title_container    = $atts[ 'item_title_container' ];
    6263            $item_container_class    = $atts[ 'item_container_class' ];
    6364            $item_show_title         = $atts[ 'item_show_title' ];
     
    8081                    if ( $item_show_title === 'true' )
    8182                    {
    82                         $title         = get_the_title ( $post_related_id );
    83                         $url           = get_permalink ( $post_related_id );
    84                         $itm_container .= "<h3 class=\"sft-rlp-title\"><a href=\"$url\">$title</a></h3>";
     83                        $title = get_the_title ( $post_related_id );
     84                        $url   = get_permalink ( $post_related_id );
     85
     86                        if ( $item_title_container == 'none' )
     87                        {
     88                            $itm_container .= "<a href=\"$url\">$title</a>";
     89                        }
     90                        else
     91                        {
     92                            $itm_container .= "<$item_title_container class=\"sft-rlp-title\"><a href=\"$url\">$title</a></$item_title_container>";
     93                        }
    8594                    }
    8695
  • softmixt-relations/trunk/softmixt-relations.php

    r1689254 r1727679  
    44 * Plugin URI:        https://wordpress.org/plugins/softmixt-relations/
    55 * Description:       Simple way for adding related posts .
    6  * Version:           1.0.0
     6 * Version:           1.0.1
    77 * Author:            Softmixt
    88 * Author URI:        http://softmixt.com/
     
    7777require_once ( dirname ( __FILE__ ) . '/public/public.php' );
    7878
     79// Include Default Widget
     80require ( dirname ( __FILE__ ) . '/widgets/default/SFT_DefaultWidget.php' );
     81
    7982/**---------------------------------------------------------------------------------------------------------------------------------
    8083 * RUN PLUGIN
Note: See TracChangeset for help on using the changeset viewer.