From 1ac90e03e3f30f1406eae2476978e1e5ec4eb15d Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Sun, 24 Jul 2022 17:05:32 +0200 Subject: [PATCH] first commit to repo --- README.md | 94 +++++ admin.php | 64 ++++ assets/images/index.html | 11 + assets/images/layout-one.png | Bin 0 -> 3858 bytes assets/images/layout-two.png | Bin 0 -> 1925 bytes assets/images/tm-btn.png | Bin 0 -> 1944 bytes assets/index.html | 12 + assets/pft-custom.js | 21 ++ assets/pft-style.css | 88 +++++ assets/shortcode-PFT-btn.js | 108 ++++++ functions.php | 37 ++ index.php | 1 + languages/PFT-de_DE.mo | Bin 0 -> 2174 bytes languages/PFT-de_DE.po | 137 +++++++ languages/PFT-ro_RO.mo | Bin 0 -> 2108 bytes languages/PFT-ro_RO.po | 136 +++++++ languages/PFT.mo | Bin 0 -> 503 bytes languages/PFT.pot | 135 +++++++ languages/index.html | 15 + languages/index.php | 1 + post-from-tag.php | 711 +++++++++++++++++++++++++++++++++++ readme.txt | 94 +++++ 22 files changed, 1665 insertions(+) create mode 100644 README.md create mode 100644 admin.php create mode 100644 assets/images/index.html create mode 100644 assets/images/layout-one.png create mode 100644 assets/images/layout-two.png create mode 100644 assets/images/tm-btn.png create mode 100644 assets/index.html create mode 100644 assets/pft-custom.js create mode 100644 assets/pft-style.css create mode 100644 assets/shortcode-PFT-btn.js create mode 100644 functions.php create mode 100644 index.php create mode 100644 languages/PFT-de_DE.mo create mode 100644 languages/PFT-de_DE.po create mode 100644 languages/PFT-ro_RO.mo create mode 100644 languages/PFT-ro_RO.po create mode 100644 languages/PFT.mo create mode 100644 languages/PFT.pot create mode 100644 languages/index.html create mode 100644 languages/index.php create mode 100644 post-from-tag.php create mode 100644 readme.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc40054 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +=== Posts From Tag === +Contributors: jorge-vitrubio +Tags: posts from tag, tag listing, post list from tag, widget, plugin, post listing widget, plugin to list posts, list posts from specific tag, post, sidebar, post from tag, list tag post, tag posts +Version: 1.0.0 +Requires at least: 5.0 +Tested up to: 6.0 +Requires PHP: 5.6.20 +Stable tag: 1.0.0 +License: GNU General Public License v2 or later +License URI: https://www.gnu.org/licenses/gpl-2.0.html + +== Description == + +This plugin is a fork of [Post From Category](https://wordpress.org/plugins/posts-from-category/) by [Manesh Timilsina](https://profiles.wordpress.org/maneshtimilsina/). + +Plugin to display posts from specific tag. It comes with multiple layout option to display post list. Option to select tag or exclude post is available which provide advance filter to your requirement. You can enable or disable posted date, thumbnail, read more button and more easily from widget. + +Following features are offered by plugin: + +* Multiple layout options to list posts +* Title field for your listing +* Select tag from dropdown +* Order posts by author, title, id, date, number of comments, menu order or random +* Order posts in Ascending or Descending order +* Select number of posts to display +* Exclude posts from listing +* Change word length of excerpt +* Enable/Disable featured image +* Select size of featured image +* Enable/Disable publish date +* Enable/Disable read more button and its text + += Useage of Shortcode: = + +You can use shortcode to display your posts in the content area of your website. It is supported by Gutenberg Block, Page Builders like Elementor and more. + +
[pft layout="layout-one" tag="0" order_by="date" order="DESC" post_number="5" length="10" readmore="Read More" show_date="true" show_image="true" image_size="full"]
+ +Parameters supported by this plugin are explained below: + +* layout: Supports 2 layouts (layout-one and layout-two) +* tag: Tag ID +* order_by: Order your posts by author, title, ID, date, menu_order, comment_count, rand +* order: DESC or ASC +* post_number: Number of posts to show +* length: Length of excerpt. Set 0 to hide excerpt +* readmore: Read More text +* show_date: true or false +* show_image: true or false +* image_size: Supports thumbnail, medium, large, full or any size defined by the theme + += Other Useful Plugins = + +- [Post from Tag](https://wordpress.org/plugins/advanced-google-recaptcha/) + + +== Installation == + +1. Download the plugin from plugin directory + +2. Extract the file contents + +3. Upload the directory to your WordPress plugins' directory ( /wp-content/plugins/ ) + +4. Activate the plugin from the WordPress Dashboard + +5. Go to Widgets, add 'Post From Tag' widget to your desire sidebar + +6. Fill in the desired fields and we're good to go + +== Frequently Asked Questions == + += Does this plugin provide shortcode ? = + +Yes, you can find PFT shortcode icon at the top bar of WP Editor. Click on it to insert shortcode. + += Can I use this plugin using Gutenberg block or Elementor widget ? = + +Yes, you can use the shortcode block of Gutenberg (and shortcode in Elementor widget) to show your posts. + += Where can I find setting for plugin? = + +This plugin do not have separate setting page. You can provide necessary details in widgets. + + +== Screenshots == + +1. Backend View +2. Frontend View + +== Changelog == + += 1.0.0 = +- First publicly distributable version diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..4e6760d --- /dev/null +++ b/admin.php @@ -0,0 +1,64 @@ + + +
+

+ +
+ +
+ +

+ + + +

+ +
+
+

+
    +
  1. > Widgets', 'PFT' ); ?>
  2. +
  3. +
  4. +
  5. +
+
+ +
+

+ [pft layout="layout-one" tag="0" order_by="date" order="DESC" post_number="5" length="10" readmore="Read More" show_date="true" show_image="true" image_size="full"] +

+
+ +
+

+
    +
  1. +
+
+ +
+ +
+ - Revision 2760784: /posts-from-tag/trunk/assets/images + +

- Revision 2760784: /posts-from-tag/trunk/assets/images

+ +
Powered by Apache Subversion version 1.9.5 (r1770682). + \ No newline at end of file diff --git a/assets/images/layout-one.png b/assets/images/layout-one.png new file mode 100644 index 0000000000000000000000000000000000000000..46c8764808026d3a74f5a93eaac65bdbb8ce26c0 GIT binary patch literal 3858 zcmV+t5AE=YP)00001b5ch_0Itp) z=>Px@%t=H+RCodH+y`$PM-v8M%3*qOdP9nxg8cvAlLYBNklw2keSFq_?;EY}NZwJV zEJOoPyE}bnXDex+{QK{}r<>0TJn+B+t@P*g^mKJ{a?;xBK>HfzPd@pieL@H^ZHy7V z)E9^8-_@oc#Uw-=`V8 zN-&5N_$-AM)iEW(VbI^S88R&Jrpwfni9_VhbUB0!RX=R#yOc&p%C=-AS%TDNou@{t zd9s;)@m{agIS^W8|NQgMRz-XK@yAWu^_k>CjdJB((ztOu2USAFXsQ*O8AQ4BGj<)V5zWoWAb3i_EjrDzJ@P9v2_skP?3V04>J zIL^b!+UbVEfF8)Ar=EJMq5k;ekCoXjb;Tat0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cSo_*8C%r1O_vwmVl0v7g)j1lX4yHxq9Q* zT%Xd9C2~okeSKwXmyCY!rSfiMZhwOv;w~lI91`?&I(&WS6U@++WGX)Ol;}Ml+L#=C zJ;2pIMi;*DM=xCEZNDSMBx_B-r4Xgctc!Fp99nb-m(qa8 zQM}<-;z>fJq$hm69DX>w(W4F@d%?$_+McRc+mTcD_$nV-#nt*z-gc_9>KrgY)>3P3 z)@5sR9>}bvKGxi<=i1g`L9_-7GCI7+I5SU&?E(IoK06r*b`yN{`vHy;e4XyWOv^^t z2POPU!L0X%WK%ZBWK!K<;KIjl1|Yn>FBjE5O7LqSYDZ-#=!4R?4b&L)e0`hDl{K8@C7i;)k;v(m+z&1I$ zwb9sOALQ}PMGsA1*u&!ka_7*_GEI)H?0fOa<&Z5OkB06dAS**V=QHGkX(`m;$MNXW z4#Y5=bH2+Gr{TkwPQV!yodNudZb7JR_4r?Tsy#XqJbFQugL7j}P|@ka0|%z$3{w0K zPZEV}d`e&GI?5%Bp+JJ6%}Gw}f-#B?Hx8rAAzuLd)2JV2btKW>wbWv1iuC$orbg7<^&MD zvd<)^i3)<~Yq=hJIeazfJ-wGdcKay7ubt`x(6=k^RDEBW@THv6cTxDGt@#(#!TZ_n zRq!uxbXxFDOPkjr8&cNSdb-fB`*q4+V9W>8?QJL5=|h4g=>54if$#By_5XO~e?~Gz U6Ygr`2LJ#707*qoM6N<$f-p43E&u=k literal 0 HcmV?d00001 diff --git a/assets/images/layout-two.png b/assets/images/layout-two.png new file mode 100644 index 0000000000000000000000000000000000000000..4f1795bd6ca6eaf3d3fdede4f29e22f26a35b160 GIT binary patch literal 1925 zcmV;02YUF4P)00001b5ch_0Itp) z=>Px+KS@MERCodHoZC(tI~0Z!2#2<6K~$A!dsXrNk3@S_0RnC)qNQrPcRs^ET3NMc zJehG0d)rc2_B#9b@*ESU|IFK@N1LJh`Sa(f3BIP&>4I!$VU#iGZ7^jHzkmO3LdVh| zu=v3sBa=pD11B9)IzB!Qlm7GPPo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*nhub4P%_Uu?nsCSTHE*==7K{P?SnKEUH zC*fH*Q?68~krHD2-*?dTTIbK*7oPCmNhM zaiXUhu1*qjt5&US)~s2sLB3nxzI|&WM~ - Revision 2760784: /posts-from-tag/trunk/assets + +

- Revision 2760784: /posts-from-tag/trunk/assets

+ +
Powered by Apache Subversion version 1.9.5 (r1770682). + diff --git a/assets/pft-custom.js b/assets/pft-custom.js new file mode 100644 index 0000000..b845a84 --- /dev/null +++ b/assets/pft-custom.js @@ -0,0 +1,21 @@ +( function( $ ) { + + $( document ).ready(function( $ ) { + + $(".pft-posts-main .pft-post.layout-one").each(function(){ + + var thumbHeight = $(this).find('.news-thumb img').height(); + + var infoHeight = $(this).find('.news-text-wrap').height(); + + if( thumbHeight != null && infoHeight != null && thumbHeight > infoHeight ){ + + $(this).find('.news-text-wrap').css( 'min-height', thumbHeight+'px'); + + } + + }); + + }); + +} )( jQuery ); diff --git a/assets/pft-style.css b/assets/pft-style.css new file mode 100644 index 0000000..b76bdce --- /dev/null +++ b/assets/pft-style.css @@ -0,0 +1,88 @@ +/* + * Plugin Name: Posts From Tag + * Version: 1.0.0 + * Plugin URI: http://wordpress.org/plugins/posts-from-tag/ + * Description: Plugin to display posts from specific tag. It comes with multiple layout option to display post list. Option to select tag or exclude post is available wgich provide advance filter to your requirement. You can enable or disable posted date, thumbnail, read more button and more easily from widget. + * Author: Jorge - vitrubio.net + * Author URI: https://vitrubio.net/ + * Original Author: Manesh Timilsina + * Original Author URI: https://wpmanesh.com/ + * License: GNU/GPL http://www.gnu.org/copyleft/gpl.html + */ + + .pft-posts-main{ + margin-bottom: 10px; + } + +.pft-posts-main .pft-post { + float: none; + display: inline-block; + padding-right: 15px; + padding-left: 15px; + vertical-align: top; + margin-left: -3px; + position: relative; + margin-bottom: 20px; +} + +.pft-posts-main .pft-post .news-text-wrap { + padding-top: 10px; +} + +.pft-posts-main .pft-post .news-text-wrap h2 { + margin-bottom: 5px; + margin-top: 0; + padding-top: 0; +} + +.pft-posts-main .pft-post { + margin-left: 0px; + padding-left: 0px; + padding-right: 0px; + width: 100%; +} + +.pft-posts-main .pft-post .news-text-wrap p, +.pft-posts-main .news-text-wrap .read-more { + margin-bottom: 0px; + margin-top: 5px; +} + +.pft-posts-main .news-text-wrap .posted-date, +.pft-posts-main .news-text-wrap .read-more{ + display: inline-block; + width: 100%; +} + +.pft-posts-main .pft-post:last-child { + margin-bottom: 0px; +} + +.pft-posts-main .news-thumb a img { + max-width: 100%; + height: auto; +} + +/* layout one css starts */ +.pft-posts-main .pft-post.layout-one .news-thumb { + float: left; + width: 115px; + position: absolute; +} + +.pft-posts-main .layout-one .news-text-wrap { + float: left; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 135px; + min-height: 80px; +} + +.pft-posts-main .layout-one .news-text-wrap.info-without-space{ + padding-left: 0px; +} + +/* layout two css starts */ +.pft-posts-main .pft-post.layout-two .news-thumb { + width: 100%; +} diff --git a/assets/shortcode-PFT-btn.js b/assets/shortcode-PFT-btn.js new file mode 100644 index 0000000..e4c7d56 --- /dev/null +++ b/assets/shortcode-PFT-btn.js @@ -0,0 +1,108 @@ +(function() { + tinymce.PluginManager.add('pftbutton', function( editor, url ) { + editor.addButton( 'pftbutton', { + text: tinyMCE_object_PFC.button_name, + title: tinyMCE_object_PFC.button_title, + icon: true, + image: url + '/images/tm-btn.png', + onclick: function() { + editor.windowManager.open( { + title: tinyMCE_object_PFC.button_title, + body: [ + { + type : 'listbox', + name : 'layout', + label : 'Select Layout', + values : [ + { text: 'Layout One', value: 'layout-one' }, + { text: 'Layout Two', value: 'layout-two' }, + ], + value : 'layout-one' // Sets the default + }, + { + type : 'listbox', + name : 'post_tag', + label : 'Select Tag', + values : tinyMCE_object_PFC.post_tag_list, + + }, + { + type : 'listbox', + name : 'orderby', + label : 'Order By', + values : [ + { text: 'Author', value: 'author' }, + { text: 'Post Title', value: 'title' }, + { text: 'Post ID', value: 'ID' }, + { text: 'Posted Date', value: 'date' }, + { text: 'Menu Order', value: 'menu_order' }, + { text: 'Comment Count', value: 'comment_count' }, + { text: 'Random', value: 'rand' }, + ], + value : 'date' // Sets the default + }, + { + type : 'listbox', + name : 'order', + label : 'Order', + values : [ + { text: 'DESC', value: 'DESC' }, + { text: 'ASC', value: 'ASC' }, + ], + value : 'DESC' // Sets the default + }, + + { + type : 'textbox', + name : 'post_number', + label : 'Post Number', + tooltip: 'Use Numeric Value Only', + value : 5 + }, + + { + type : 'textbox', + name : 'length', + label : 'Excerpt Length', + tooltip: 'Use Numeric Value Only. Leave empty to hide excerpt', + value : 10 + }, + + { + type : 'textbox', + name : 'readmore', + label : 'Read More Text', + tooltip: 'Leave empty to hide read more button', + value : 'Read More' + }, + { + type : 'checkbox', + name : 'show_date', + label : 'Show Posted Date', + checked : true + }, + { + type : 'checkbox', + name : 'show_image', + label : 'Show Thumbnail Image', + checked : true + }, + + { + type : 'listbox', + name : 'image_size', + label : 'Select Image Size', + values : tinyMCE_object_PFC.image_sizes, + + } + + ], + onsubmit: function( e ) { + editor.insertContent( '[pft layout="' + e.data.layout + '" tag="' + e.data.post_tag + '" order_by="' + e.data.orderby + '" order="' + e.data.order + '" post_number="' + e.data.post_number + '" length="' + e.data.length + '" readmore="' + e.data.readmore + '" show_date="' + e.data.show_date + '" show_image="' + e.data.show_image + '" image_size="' + e.data.image_size + '"]'); + } + }); + }, + }); + }); + +})(); diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..bce4057 --- /dev/null +++ b/functions.php @@ -0,0 +1,37 @@ +post_content; + + if ( ! empty( $post_object->post_excerpt ) ) { + $source_content = $post_object->post_excerpt; + } + + $source_content = strip_shortcodes( $source_content ); + $trimmed_content = wp_trim_words( $source_content, $length, '...' ); + return $trimmed_content; + } + +endif; \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..e71af0e --- /dev/null +++ b/index.php @@ -0,0 +1 @@ +J`DCi*1rut4c-CS&tD+t{dc*( z2R?!IDFkQv7|8z4gHM95f;-508a#{jbvWVu&q{s?a-0+JIq)X<4EQTJ0p0;Q{%IsN z3yy>1U;~6p5rX&=3I4I)41|gJ2;}~K0zM0V4zk~yAm{N5$o1bY*MF4zcfpq+zX!6P zaWsYXFMyoq>md7i6FdjLQ*sY{0qX$dBj#M#j?W$~%Fl@F;FwU!Yh`~tI1bzLKv;ox z<%9F!!Et!Jj33A5JJlcDV?IwF+!yW%*Uf|P37-wu&u8-@euJ@)`lN$Mcf>;GLSx0U zawL{%AYP8rZmf=E!=z3Yo26u%R3NvEg?cIJLMN4NYZ94KOunN)`ta8=_NcFPc_-hI z%`i*$wTfb~q8(YuwlWG}*i{xbfjo#@D1DP8N;)Iy(2ui#WRk@$>c*5Cq++EMb9$** z&Eighe>hmP>F=8dgIQdl7|R{$DO036{zA<$}$~ z#gtD|xyp4e^~>8vo3NmdRT$?9b6i|kg>Tr1bPxou zISQ#X+cDNf$Vp4B{IJLb{o+qUzntDJd|Hr|joR-1REubXo?Oe?3JH%i7srz3%|nrc i-f?65!qGO0-d7`m_If{B{(?q{Y~t#`1}SJ%Fa8DO`8fOl literal 0 HcmV?d00001 diff --git a/languages/PFT-de_DE.po b/languages/PFT-de_DE.po new file mode 100644 index 0000000..7f6c052 --- /dev/null +++ b/languages/PFT-de_DE.po @@ -0,0 +1,137 @@ +msgid "" +msgstr "" +"Project-Id-Version: Posts From Tag\n" +"POT-Creation-Date: 2014-09-11 21:23+0100\n" +"PO-Revision-Date: 2014-09-11 21:34+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: de_DE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.9\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" +"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" +"_nx_noop:3c,1,2;__ngettext_noop:1,2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SearchPath-0: .\n" + +#: post-from-tag.php:31 +msgid "Display posts from selected tag" +msgstr "Zeige Beiträge aus der gewählten Kategorie" + +#: post-from-tag.php:34 +msgid "Posts From Tag" +msgstr "Beiträge aus der Kategorie" + +#: post-from-tag.php:93 post-from-tag.php:105 +#: post-from-tag.php:123 +msgid "Go to" +msgstr "Gehe zu" + +#: post-from-tag.php:123 +msgid "Read More" +msgstr "Weiterlesen" + +#: post-from-tag.php:190 +msgid "Title" +msgstr "Überschrift" + +#: post-from-tag.php:196 +msgid "Select Tag" +msgstr "Kategorie auswählen" + +#: post-from-tag.php:198 post-from-tag.php:215 +#: post-from-tag.php:240 +msgid "Select" +msgstr "Auswählen" + +#: post-from-tag.php:212 +msgid "Order By" +msgstr "Sortieren nach" + +#: post-from-tag.php:218 +msgid "Author" +msgstr "Autor" + +#: post-from-tag.php:219 +msgid "Post Title" +msgstr "Beitragsüberschrift" + +#: post-from-tag.php:220 +msgid "Post ID" +msgstr "Beitrags ID" + +#: post-from-tag.php:221 +msgid "Date" +msgstr "Datum" + +#: post-from-tag.php:222 +msgid "Menu Order" +msgstr "Menü Reiehnfolge" + +#: post-from-tag.php:223 +msgid "Number of Comments" +msgstr "Anzahl der Kommentare" + +#: post-from-tag.php:224 +msgid "Random" +msgstr "Zufall" + +#: post-from-tag.php:237 +msgid "Order" +msgstr "Reihenfolge" + +#: post-from-tag.php:243 +msgid "Ascending" +msgstr "aufsteigend" + +#: post-from-tag.php:244 +msgid "Descending" +msgstr "absteigend" + +#: post-from-tag.php:257 +msgid "Number of Post" +msgstr "Anzahl der Beiträge" + +#: post-from-tag.php:264 +msgid "Exclude Posts" +msgstr "Beiträge ausschließen" + +#: post-from-tag.php:266 +msgid "Enter post id separated with comma to exclude multiple posts" +msgstr "Beitrags ID mit Komma trennen um mehrere auszuschließen" + +#: post-from-tag.php:272 +msgid "Words of Excerpt" +msgstr "Wörter im Textausschnitt" + +#: post-from-tag.php:279 +msgid "Display/Select Thumbnail" +msgstr "Vorschaubild zeigen" + +#: post-from-tag.php:283 +msgid "Thumbnail" +msgstr "Vorschaubild" + +#: post-from-tag.php:284 +msgid "Medium" +msgstr "Mittel" + +#: post-from-tag.php:285 +msgid "Large" +msgstr "Groß" + +#: post-from-tag.php:286 +msgid "Full" +msgstr "Voll" + +#: post-from-tag.php:300 +msgid "Display Post Date" +msgstr "Beitragsdatum anzeigen" + +#: post-from-tag.php:305 +msgid "Display Read More" +msgstr "Weiterlesen anzeigen" diff --git a/languages/PFT-ro_RO.mo b/languages/PFT-ro_RO.mo new file mode 100644 index 0000000000000000000000000000000000000000..bc54191d575fac8cab3165d4a08d946b80215e36 GIT binary patch literal 2108 zcmZvcO>7%Q6vu~9zTEN^D4(GWs03SRlXX%gv&NLvPAZFpSc#!X9Kv*WVh>vHtY&BP zr5=!S;KB*Pq2dBUaN$-VA#p4LMdFG$A&wQ|#u34R|Jz-AOJU^Q-_Dyi?`!7y*Xa`< zGmJBMX7HT4jjk_!yTNb4yTI>2(*F^B2>cl&JHLYz z_aDXlFYtcMr{J9A(;(TK0UrRL1%E@%iy+yXfe~7N9)yTFAjQ7`J^{W8QoY^=9dHkP z8vGKx1pWX%44y%dw0{vi2{wv(2PFGlko>QMkAUxhv~L&0k9~j_<^NH^&q1ooHIVeb z2PvOl3i%C?>hotYpTdOlISrCO4xR>QK{{fRQCyS@N|fbDbtIoq$$Zd$8c2yfo_*!9 z;fS;GWWiGfp8~Voi#dUEq_}B3iic`K_l5@D6FM7;i*lj*PR3H=%P3IMfGwqVs154~ zD_KWQ#2uByq1fj=omieP7LpAq0=}jV)C)-rorG^2J>rQBrEg`xeb^glvp-gv-^^Bc zf0&LgM?!^cIkM7l+RIgdjj=G;6YyPShuqhrk>FNyx#x#zAo(Z_t%^gLZAjR1A*S#W zwvvV+yQrbhR)rZzwk89Wj({lT>n4zfy$-i@yxYmy zS2mQ{XTnz~&-OUI4G{%;#LA-Nd9otiiC&p^ZtIdZK|B!4+b*Qe+xSW;Vdf#aqDJ&EmIv0;Gxb+tux8W=_c)jkq=U#9ZT^EYZhTKtP=zsMV z8oA!8hz6+`NT)Bw$m5l@?%Hx0L4D4xv^7pDvQB?LhBqts>^!c9ikjRX3X@3NdZWMM zG)g@qqGVedXF2jU-7$|hE-PDk%eg2ci9^=L!@a^0Sze!O%$>tZK6PG``@2+_Rh3we zZ#4(flD{#xBCX@*)>d;%mU}J;x;u90@wv*XNDwFa4|6w_UYHsYIxE_Y5|2l5HceWK zO`dCRljh+E(wet&Jy;f_&OI|XM8(qe+ zDTVQeJw)QTh-GdbKf2ww93aE#CH~PNszAM$x1Pva@1})qb$nGEf1-FGtl+{}1|%9ve8=QD%^a2r9-^F)0_5&Mks3TX@{OWOb4m>xC*p!=igh z9tyT5@E4OcGPS0Pq~PdVl@$T4dvs_J5B?|MPZ*^_RB|Gom_@;g&1_Q}i@FIOq%o53 zc1q{aqOSaRerzeP`Yi=yOCh>X819)||((n%100==0)&&(n!=0)))?2:1));\n" +"Language: ro\n" +"X-Poedit-SearchPath-0: ../../post-from-tag\n" + +#: ../../post-from-tag/post-from-tag.php:31 +msgid "Display posts from selected tag" +msgstr "Afișeaza articolele din categoria selectată" + +#: ../../post-from-tag/post-from-tag.php:34 +msgid "Posts From Tag" +msgstr "Articole din categoria" + +#: ../../post-from-tag/post-from-tag.php:93 +#: ../../post-from-tag/post-from-tag.php:105 +#: ../../post-from-tag/post-from-tag.php:119 +msgid "Go to" +msgstr "Mergeți la" + +#: ../../post-from-tag/post-from-tag.php:119 +msgid "Read More" +msgstr "Citește mai multe" + +#: ../../post-from-tag/post-from-tag.php:186 +msgid "Title" +msgstr "Titlu" + +#: ../../post-from-tag/post-from-tag.php:193 +msgid "Select Tag" +msgstr "Alegeți categoria" + +#: ../../post-from-tag/post-from-tag.php:195 +#: ../../post-from-tag/post-from-tag.php:212 +#: ../../post-from-tag/post-from-tag.php:237 +msgid "Select" +msgstr "Alegeți" + +#: ../../post-from-tag/post-from-tag.php:209 +msgid "Order By" +msgstr "Sorteaza după" + +#: ../../post-from-tag/post-from-tag.php:215 +msgid "Author" +msgstr "Autor" + +#: ../../post-from-tag/post-from-tag.php:216 +msgid "Post Title" +msgstr "Titlul articolului" + +#: ../../post-from-tag/post-from-tag.php:217 +msgid "Post ID" +msgstr "ID articolului" + +#: ../../post-from-tag/post-from-tag.php:218 +msgid "Date" +msgstr "Data" + +#: ../../post-from-tag/post-from-tag.php:219 +msgid "Menu Order" +msgstr "Ordinea meniului" + +#: ../../post-from-tag/post-from-tag.php:220 +msgid "Number of Comments" +msgstr "Numărul comentariilor" + +#: ../../post-from-tag/post-from-tag.php:221 +msgid "Random" +msgstr "Aleatoriu" + +#: ../../post-from-tag/post-from-tag.php:234 +msgid "Order" +msgstr "Ordinea" + +#: ../../post-from-tag/post-from-tag.php:240 +msgid "Ascending" +msgstr "Crescător" + +#: ../../post-from-tag/post-from-tag.php:241 +msgid "Descending" +msgstr "Descrescător" + +#: ../../post-from-tag/post-from-tag.php:254 +msgid "Number of Post" +msgstr "Numărul articolului" + +#: ../../post-from-tag/post-from-tag.php:261 +msgid "Exclude Posts" +msgstr "Excludeți articolul" + +#: ../../post-from-tag/post-from-tag.php:263 +msgid "Enter post id separated with comma to exclude multiple posts" +msgstr "Introduceți id-ul articolului separat prin virgulă pentru a exclude articole multiple" + +#: ../../post-from-tag/post-from-tag.php:269 +msgid "Words of Excerpt" +msgstr "Cuvintele rezumatului" + +#: ../../post-from-tag/post-from-tag.php:276 +msgid "Display/Select Thumbnail" +msgstr "Afișeaza/Selectați pictograma" + +#: ../../post-from-tag/post-from-tag.php:280 +msgid "Thumbnail" +msgstr "Pictograma" + +#: ../../post-from-tag/post-from-tag.php:281 +msgid "Medium" +msgstr "Mediu" + +#: ../../post-from-tag/post-from-tag.php:282 +msgid "Large" +msgstr "Mare" + +#: ../../post-from-tag/post-from-tag.php:283 +msgid "Full" +msgstr "Plin" + +#: ../../post-from-tag/post-from-tag.php:297 +msgid "Display Post Date" +msgstr "Afișați data articolului" + +#: ../../post-from-tag/post-from-tag.php:302 +msgid "Display Read More" +msgstr "Afișează Citește mai mult" diff --git a/languages/PFT.mo b/languages/PFT.mo new file mode 100644 index 0000000000000000000000000000000000000000..8eb2720983cb197f86004f16006c043478260023 GIT binary patch literal 503 zcmaJ;K~BRk5Cp*~N6s94;08{U(xTP{geV17v=Bi++@dAfrbdY!*)CB2!E^WuZ(&14 zb7SSvYInxovHiWX{kcK0N!TUq5w-{iggSbJFCzPtYt1?$qhBy}e4Oz|G*)UQ7-XeX zJY86)OZkDui*92+GzgApegO^zYX@P62VLIov#>1=!~LM!>5`D&;j65V`Bygq>v(KH z*#ew4f=xl8owHb$vanJCJGSL-s~rTLv%CaZ_^B>Wy$Ps%0Xgy*p%iRg3#Kr+iM;7} zI%;kb`hhpp%Aulh%ZhwEe0Qy?0I3EnorAIHP9EY*-fMKVtr;3VQmM|Q$_48^OXofD zD^zG!ej|;UbS(6b{4O!8l3(NUO`FV4q;-NNgB)Ew?=L4x>uQiBg9MvB=U}k{Hy6xr fn)e7Mok!H>0TF(SR;B69W=5Ahr60((S$Z2kXY!S3 literal 0 HcmV?d00001 diff --git a/languages/PFT.pot b/languages/PFT.pot new file mode 100644 index 0000000..d8fb1cb --- /dev/null +++ b/languages/PFT.pot @@ -0,0 +1,135 @@ +msgid "" +msgstr "" +"Project-Id-Version: post-from-tag\n" +"POT-Creation-Date: 2014-05-29 12:31+0545\n" +"PO-Revision-Date: 2014-05-29 12:31+0545\n" +"Last-Translator: Manesh Timilsina \n" +"Language-Team: \n" +"Language: ne_NP\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.5\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ../../post-from-tag\n" + +#: ../../post-from-tag/post-from-tag.php:31 +msgid "Display posts from selected tag" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:34 +msgid "Posts From Tag" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:93 +#: ../../post-from-tag/post-from-tag.php:105 +#: ../../post-from-tag/post-from-tag.php:119 +msgid "Go to" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:119 +msgid "Read More" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:186 +msgid "Title" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:193 +msgid "Select Tag" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:195 +#: ../../post-from-tag/post-from-tag.php:212 +#: ../../post-from-tag/post-from-tag.php:237 +msgid "Select" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:209 +msgid "Order By" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:215 +msgid "Author" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:216 +msgid "Post Title" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:217 +msgid "Post ID" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:218 +msgid "Date" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:219 +msgid "Menu Order" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:220 +msgid "Number of Comments" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:221 +msgid "Random" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:234 +msgid "Order" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:240 +msgid "Ascending" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:241 +msgid "Descending" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:254 +msgid "Number of Post" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:261 +msgid "Exclude Posts" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:263 +msgid "Enter post id separated with comma to exclude multiple posts" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:269 +msgid "Words of Excerpt" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:276 +msgid "Display/Select Thumbnail" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:280 +msgid "Thumbnail" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:281 +msgid "Medium" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:282 +msgid "Large" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:283 +msgid "Full" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:297 +msgid "Display Post Date" +msgstr "" + +#: ../../post-from-tag/post-from-tag.php:302 +msgid "Display Read More" +msgstr "" diff --git a/languages/index.html b/languages/index.html new file mode 100644 index 0000000..fb60efb --- /dev/null +++ b/languages/index.html @@ -0,0 +1,15 @@ + - Revision 2760784: /posts-from-tag/trunk/languages + +

- Revision 2760784: /posts-from-tag/trunk/languages

+ +
Powered by Apache Subversion version 1.9.5 (r1770682). + \ No newline at end of file diff --git a/languages/index.php b/languages/index.php new file mode 100644 index 0000000..e71af0e --- /dev/null +++ b/languages/index.php @@ -0,0 +1 @@ + 'pft-widget', + 'description' => esc_html__( 'Display posts from selected tag', 'PFT') + ); + + parent::__construct('PFTWidget', esc_html__( 'MT: Posts From Tag', 'PFT' ), $widget_ops, $control_ops); + + $this->alt_option_name = 'widget_pft'; + } + + function pft_load_frontend_scripts() { + + wp_enqueue_style( 'pft-style', rtrim( plugin_dir_url( __FILE__ ), '/' ) . '/assets/pft-style.css' ); + + wp_enqueue_script( 'pft-custom', rtrim( plugin_dir_url( __FILE__ ), '/' ) . '/assets/pft-custom.js', array( 'jquery' ), '5.0.1' ); + } + + /** + * Displays the Widget + * + */ + function widget($args, $instance){ + + $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); + + $layout = ! empty( $instance['layout'] ) ? $instance['layout'] : ''; + + $post_tag = ! empty( $instance['post_tag'] ) ? $instance['post_tag'] : 0; + + $post_order_by = ! empty( $instance['post_order_by'] ) ? $instance['post_order_by'] : ''; + + $post_order = ! empty( $instance['post_order'] ) ? $instance['post_order'] : ''; + + $post_num = ! empty( $instance['post_num'] ) ? $instance['post_num'] : 5; + + $post_exclude = ! empty( $instance['post_exclude'] ) ? $instance['post_exclude'] : ''; + + $post_length = !empty( $instance['post_length'] ) ? $instance['post_length'] : ''; + + $readmore_text = ! empty( $instance['readmore_text'] ) ? $instance['readmore_text'] : ''; + + // $show_posttitle = ! empty( $instance['show_posttitle'] ) ? $instance['show_posttitle'] : true; + + $date = ! empty( $instance['date'] ) ? $instance['date'] : false; + + $thumbnail = ! empty( $instance['thumbnail'] ) ? $instance['thumbnail'] : false; + + $post_thumbs = ! empty( $instance['post_thumbs'] ) ? $instance['post_thumbs'] : ''; + + echo $args['before_widget']; ?> + +
+ + + +
+ + +
+
+ '', + 'layout' => 'layout-one', + 'post_tag' => '', + 'post_order_by' => 'date', + 'post_order' => 'DESC', + 'post_num' => 5, + 'post_exclude' => '', + 'post_length' => 10, + 'readmore_text' => esc_html__( 'Read More', 'PFT' ), + // 'show_posttitle' => true, + 'date' => true, + 'thumbnail' => true, + 'post_thumbs' => 'thumbnail', + ) + ); + ?> + +

+ + +

+ +

+ +

+ +

+ id="get_field_id( 'layout-one' ); ?>" name="get_field_name('layout'); ?>" value="layout-one" /> + + + id="get_field_id( 'layout-two' ); ?>" name="get_field_name('layout'); ?>" value="layout-two" /> + +

+ + +

+ + 'name', + 'hide_empty' => 1, + 'class' => 'widefat', + 'taxonomy' => 'post_tag', + 'name' => $this->get_field_name( 'post_tag' ), + 'id' => $this->get_field_id( 'post_tag' ), + 'selected' => absint( $instance['post_tag'] ), + 'show_option_all' => esc_html__( 'All Categories','PFT' ), + ); + wp_dropdown_categories( $cat_args ); + ?> +

+ +

+ + dropdown_post_order_by( array( + 'id' => $this->get_field_id( 'post_order_by' ), + 'name' => $this->get_field_name( 'post_order_by' ), + 'selected' => esc_attr( $instance['post_order_by'] ), + ) + ); + ?> +

+ +

+ + dropdown_post_order( array( + 'id' => $this->get_field_id( 'post_order' ), + 'name' => $this->get_field_name( 'post_order' ), + 'selected' => esc_attr( $instance['post_order'] ), + ) + ); + ?> +

+ +

+ + +

+ +

+ + + +

+ +

+ + + +

+ +

+ + + +

+ +

+ id="get_field_id( 'date' ) ); ?>" name="get_field_name( 'date' ) ); ?>" /> + +

+ +

+ id="get_field_id( 'thumbnail' ) ); ?>" name="get_field_name( 'thumbnail' ) ); ?>" /> + +

+ +

+ dropdown_post_thumbnail( array( + 'id' => $this->get_field_id( 'post_thumbs' ), + 'name' => $this->get_field_name( 'post_thumbs' ), + 'selected' => esc_attr( $instance['post_thumbs'] ), + ) + ); + ?> +

+ + '', + 'class' => 'widefat', + 'name' => '', + 'selected' => 0, + ); + + $r = wp_parse_args( $args, $defaults ); + $output = ''; + + $choices = array( + 'author' => esc_html__('Author', 'PFT'), + 'title' => esc_html__('Post Title', 'PFT'), + 'ID' => esc_html__('Post ID', 'PFT'), + 'date' => esc_html__('Date', 'PFT'), + 'menu_order' => esc_html__('Menu Order', 'PFT'), + 'comment_count' => esc_html__('Number of Comments', 'PFT'), + 'rand' => esc_html__('Random', 'PFT') + ); + + if ( ! empty( $choices ) ) { + + $output = "\n"; + } + + echo $output; + } + + function dropdown_post_order( $args ) { + $defaults = array( + 'id' => '', + 'class' => 'widefat', + 'name' => '', + 'selected' => 0, + ); + + $r = wp_parse_args( $args, $defaults ); + $output = ''; + + $choices = array( + 'ASC' => esc_html__('Ascending', 'PFT'), + 'DESC' => esc_html__('Descending', 'PFT') + ); + + if ( ! empty( $choices ) ) { + + $output = "\n"; + } + + echo $output; + } + + function dropdown_post_thumbnail( $args ) { + $defaults = array( + 'id' => '', + 'class' => 'widefat', + 'name' => '', + 'selected' => 0, + ); + + $r = wp_parse_args( $args, $defaults ); + + $output = ''; + + global $_wp_additional_image_sizes; + + $get_intermediate_image_sizes = get_intermediate_image_sizes(); + + $choices = array( + 'thumbnail' => esc_html__('Thumbnail', 'PFT'), + 'medium' => esc_html__('Medium', 'PFT'), + 'large' => esc_html__('Large', 'PFT'), + 'full' => esc_html__('Full (Original)', 'PFT') + ); + + $show_dimension = true; + + if ( true === $show_dimension ) { + foreach ( array( 'thumbnail', 'medium', 'large' ) as $key => $_size ) { + $choices[ $_size ] = $choices[ $_size ] . ' (' . get_option( $_size . '_size_w' ) . 'x' . get_option( $_size . '_size_h' ) . ')'; + } + } + + if ( ! empty( $_wp_additional_image_sizes ) && is_array( $_wp_additional_image_sizes ) ) { + foreach ( $_wp_additional_image_sizes as $key => $size ) { + $choices[ $key ] = $key; + if ( true === $show_dimension ) { + $choices[ $key ] .= ' (' . $size['width'] . 'x' . $size['height'] . ')'; + } + } + } + + if ( ! empty( $allowed ) ) { + foreach ( $choices as $key => $value ) { + if ( ! in_array( $key, $allowed ) ) { + unset( $choices[ $key ] ); + } + } + } + + if ( ! empty( $choices ) ) { + + $output = "\n"; + } + + echo $output; + } + +}// END class + +/** +* Register widget. +* +* Calls 'widgets_init' action after widget has been registered. +*/ +function pftwidget_init() { + + register_widget('PFTWidget'); + +} + +add_action('widgets_init', 'pftwidget_init'); + +// Shortcode added +function pft_init_shortcode( $atts ) { + + extract( shortcode_atts( + array( + 'layout' => 'layout-one', + 'cat' => '', + 'order_by' => 'date', + 'order' => 'DESC', + 'post_number' => 5, + 'exclude' => '', + 'length' => 10, + 'readmore' => esc_html__('Read More', 'PFT'), + 'show_date' => true, + 'show_image' => true, + 'image_size' => 'thumbnail', + ), + $atts + )); + + ob_start(); + + pft_call_shortcode_details( $layout, $cat, $order_by, $order, $post_number, $exclude, $length, $readmore, $show_date, $show_image, $image_size ); + + return ob_get_clean(); +} + +add_shortcode( 'pft', 'pft_init_shortcode' ); + +// Shortcode function details +function pft_call_shortcode_details( $layout, $post_tag, $order_by, $order, $post_num, $exclude, $desc_length, $readmore_text, $show_date, $show_thumbnail, $thumb_size ){ + + if( 'layout-one' == $layout ){ + + $layout_class = 'layout-one'; + + }else{ + + $layout_class = 'layout-two'; + + } + + $exclude_id = explode(',', $exclude); + + $p_args = array( + 'orderby' => $order_by, + 'order' => $order, + 'no_found_rows' => true, + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => true, + 'post_status' => 'publish', + 'posts_per_page' => absint( $post_num ), + 'post__not_in' => $exclude_id + ); + + if ( absint( $post_tag ) > 0 ) { + + $p_args['cat'] = absint( $post_tag ); + + } + + $p_query = new WP_Query( $p_args ); + + if($p_query->have_posts()){ ?> + +
+ + have_posts()){ + + $p_query->the_post(); ?> + +
+ + + +
+ + + +
+ + +
+ +

+ + + + + + + +
+ +
+ + + +
+ + 'name', + 'hide_empty' => 1, + 'taxonomy' => 'post_tag', + ); + + $cat_count = 1; + + $cat_params[0] = array( + 'text' => esc_html__( 'Select Tag', 'PFT' ), + 'value' => 0 + ); + + $post_tags = get_categories( $cat_args ); + + foreach ( $post_tags as $cat ) { + + $cat_params[$cat_count]['text'] = $cat->name; + + $cat_params[$cat_count]['value'] = $cat->term_id; + + $cat_count++; + } + + //For image sizes + $image_size[0] = array( + 'text' => esc_html__( 'Select Image Size', 'PFT' ), + 'value' => '' + ); + + global $_wp_additional_image_sizes; + + $get_intermediate_image_sizes = get_intermediate_image_sizes(); + + $choices = array( + 'thumbnail' => esc_html__('Thumbnail', 'PFT'), + 'medium' => esc_html__('Medium', 'PFT'), + 'large' => esc_html__('Large', 'PFT'), + 'full' => esc_html__('Full (Original)', 'PFT') + ); + + $show_dimension = true; + + if ( true === $show_dimension ) { + foreach ( array( 'thumbnail', 'medium', 'large' ) as $key => $_size ) { + $choices[ $_size ] = $choices[ $_size ] . ' (' . get_option( $_size . '_size_w' ) . 'x' . get_option( $_size . '_size_h' ) . ')'; + } + } + + if ( ! empty( $_wp_additional_image_sizes ) && is_array( $_wp_additional_image_sizes ) ) { + foreach ( $_wp_additional_image_sizes as $key => $size ) { + $choices[ $key ] = $key; + if ( true === $show_dimension ) { + $choices[ $key ] .= ' (' . $size['width'] . 'x' . $size['height'] . ')'; + } + } + } + + if ( ! empty( $allowed ) ) { + foreach ( $choices as $key => $value ) { + if ( ! in_array( $key, $allowed ) ) { + unset( $choices[ $key ] ); + } + } + } + + if ( ! empty( $choices ) ) { + + $img_count = 1; + + + foreach ( $choices as $key => $value ) { + + $image_size[$img_count]['text'] = $value; + + $image_size[$img_count]['value'] = $key; + + $img_count++; + } + + } ?> + + [pft layout="layout-one" tag="0" order_by="date" order="DESC" post_number="5" length="10" readmore="Read More" show_date="true" show_image="true" image_size="full"] + +Parameters supported by this plugin are explained below: + +* layout: Supports 2 layouts (layout-one and layout-two) +* tag: Tag ID +* order_by: Order your posts by author, title, ID, date, menu_order, comment_count, rand +* order: DESC or ASC +* post_number: Number of posts to show +* length: Length of excerpt. Set 0 to hide excerpt +* readmore: Read More text +* show_date: true or false +* show_image: true or false +* image_size: Supports thumbnail, medium, large, full or any size defined by the theme + += Other Useful Plugins = + +- [Post from Tag](https://wordpress.org/plugins/advanced-google-recaptcha/) + + +== Installation == + +1. Download the plugin from plugin directory + +2. Extract the file contents + +3. Upload the directory to your WordPress plugins' directory ( /wp-content/plugins/ ) + +4. Activate the plugin from the WordPress Dashboard + +5. Go to Widgets, add 'Post From Tag' widget to your desire sidebar + +6. Fill in the desired fields and we're good to go + +== Frequently Asked Questions == + += Does this plugin provide shortcode ? = + +Yes, you can find PFT shortcode icon at the top bar of WP Editor. Click on it to insert shortcode. + += Can I use this plugin using Gutenberg block or Elementor widget ? = + +Yes, you can use the shortcode block of Gutenberg (and shortcode in Elementor widget) to show your posts. + += Where can I find setting for plugin? = + +This plugin do not have separate setting page. You can provide necessary details in widgets. + + +== Screenshots == + +1. Backend View +2. Frontend View + +== Changelog == + += 1.0.0 = +- First publicly distributable version