Content Blocks (Custom Post Widget) - Version 2.9

Version Description

Removed the admin notice, added donation link to plugin overview page. Shortcodes are now displayed on the content block edit screen, thanks to Remkus for suggesting this feature.

Download this release

Release Info

Developer vanderwijk
Plugin Icon 128x128 Content Blocks (Custom Post Widget)
Version 2.9
Comparing to
See all releases

Code changes from version 2.8.5 to 2.9

assets/css/custom-post-widget.css ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cpw-code {
2
+ display: block;
3
+ padding: 10px;
4
+ }
5
+ .cpw-clipboard {
6
+ display: block;
7
+ font-size: .9em;
8
+ padding: 10px 0;
9
+ text-align: right;
10
+ }
11
+ .cpw-clipboard:hover {
12
+ cursor: copy;
13
+ }
14
+ .cpw-information {
15
+ height: 8em;
16
+ width: 100%;
17
+ }
assets/js/clipboard.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ var clipboard = new Clipboard('.cpw-clipboard');
2
+
3
+ clipboard.on('success', function(e) {
4
+ console.log(e);
5
+ });
6
+
7
+ clipboard.on('error', function(e) {
8
+ console.log(e);
9
+ });
assets/js/clipboard.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*!
2
+ * clipboard.js v1.5.16
3
+ * https://zenorocha.github.io/clipboard.js
4
+ *
5
+ * Licensed MIT © Zeno Rocha
6
+ */
7
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e,t,n;return function e(t,n,i){function o(a,c){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return o(n?n:e)},u,u.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){function i(e,t){for(;e&&e.nodeType!==o;){if(e.matches(t))return e;e=e.parentNode}}var o=9;if(Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=i},{}],2:[function(e,t,n){function i(e,t,n,i,r){var a=o.apply(this,arguments);return e.addEventListener(n,a,r),{destroy:function(){e.removeEventListener(n,a,r)}}}function o(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}var r=e("./closest");t.exports=i},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===t||"[object HTMLCollection]"===t)&&"length"in e&&(0===e.length||n.node(e[0]))},n.string=function(e){return"string"==typeof e||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t}},{}],4:[function(e,t,n){function i(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!c.string(t))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(e))return o(e,t,n);if(c.nodeList(e))return r(e,t,n);if(c.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function r(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return l(document.body,e,t,n)}var c=e("./is"),l=e("delegate");t.exports=i},{"./is":3,delegate:2}],5:[function(e,t,n){function i(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName)e.focus(),e.setSelectionRange(0,e.value.length),t=e.value;else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i),t=n.toString()}return t}t.exports=i},{}],6:[function(e,t,n){function i(){}i.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){o.off(e,i),t.apply(n,arguments)}var o=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,o=n.length;for(i;i<o;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],o=[];if(i&&t)for(var r=0,a=i.length;r<a;r++)i[r].fn!==t&&i[r].fn._!==t&&o.push(i[r]);return o.length?n[e]=o:delete n[e],this}},t.exports=i},{}],7:[function(t,n,i){!function(o,r){if("function"==typeof e&&e.amd)e(["module","select"],r);else if("undefined"!=typeof i)r(n,t("select"));else{var a={exports:{}};r(a,o.select),o.clipboardAction=a.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(t),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(t){i(this,e),this.resolveOptions(t),this.initSelection()}return a(e,[{key:"resolveOptions",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function e(){var t=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.addEventListener("focus",window.scrollTo(0,i)),this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function e(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function e(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function e(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function e(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function e(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function e(){this.removeFake()}},{key:"action",set:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function e(){return this._action}},{key:"target",set:function e(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function e(){return this._target}}]),e}();e.exports=c})},{select:5}],8:[function(t,n,i){!function(o,r){if("function"==typeof e&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof i)r(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var a={exports:{}};r(a,o.clipboardAction,o.tinyEmitter,o.goodListener),o.clipboard=a.exports}}(this,function(e,t,n,i){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var s=o(t),u=o(n),f=o(i),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(e,n){r(this,t);var i=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.resolveOptions(n),i.listenClick(e),i}return c(t,e),d(t,[{key:"resolveOptions",value:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText}},{key:"listenClick",value:function e(t){var n=this;this.listener=(0,f.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function e(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})}},{key:"defaultAction",value:function e(t){return l("action",t)}},{key:"defaultTarget",value:function e(t){var n=l("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function e(t){return l("text",t)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}]),t}(u.default);e.exports=h})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
custom-post-widget.php CHANGED
@@ -3,19 +3,19 @@
3
  Plugin Name: Custom Post Widget
4
  Plugin URI: http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget
5
  Description: Show the content of a custom post of the type 'content_block' in a widget or with a shortcode.
6
- Version: 2.8.5
7
  Author: Johan van der Wijk
8
  Author URI: http://vanderwijk.nl
9
  Text Domain: custom-post-widget
10
  Domain Path: /languages
11
  License: GPL2
12
 
13
- Release notes: Fix for compatibility issue with Slider Revolution plugin
14
-
15
- Copyright 2015 Johan van der Wijk
16
-
17
  This program is free software; you can redistribute it and/or modify
18
- it under the terms of the GNU General Public License, version 2, as
19
  published by the Free Software Foundation.
20
 
21
  This program is distributed in the hope that it will be useful,
@@ -46,6 +46,34 @@ function custom_post_widget_load_widgets() {
46
  register_widget( 'custom_post_widget' );
47
  }
48
 
49
- require_once( 'meta-box.php' );
50
- require_once( 'popup.php' );
51
- require_once( 'notice.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Plugin Name: Custom Post Widget
4
  Plugin URI: http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget
5
  Description: Show the content of a custom post of the type 'content_block' in a widget or with a shortcode.
6
+ Version: 2.9
7
  Author: Johan van der Wijk
8
  Author URI: http://vanderwijk.nl
9
  Text Domain: custom-post-widget
10
  Domain Path: /languages
11
  License: GPL2
12
 
13
+ Release notes: Removed admin notice, added shortcode copy box
14
+
15
+ Copyright 2017 Johan van der Wijk
16
+
17
  This program is free software; you can redistribute it and/or modify
18
+ it under the terms of the GNU General Public License, version 2, as
19
  published by the Free Software Foundation.
20
 
21
  This program is distributed in the hope that it will be useful,
46
  register_widget( 'custom_post_widget' );
47
  }
48
 
49
+ // Admin-only functions
50
+ if ( is_admin() ) {
51
+
52
+ // Add donation and review links to plugin description
53
+ if ( ! function_exists ( 'cpw_plugin_links' ) ) {
54
+ function cpw_plugin_links( $links, $file ) {
55
+ $base = plugin_basename( __FILE__ );
56
+ if ( $file == $base ) {
57
+ $links[] = '<a href="https://wordpress.org/support/plugin/custom-post-widget/reviews/" target="_blank">' . __( 'Review', 'custom-post-widget' ) . ' <span class="dashicons dashicons-thumbs-up"></span></a> | <a href="https://paypal.me/vanderwijk">' . __( 'Donate', 'custom-post-widget' ) . ' <span class="dashicons dashicons-money"></span></a>';
58
+ }
59
+ return $links;
60
+ }
61
+ }
62
+ add_filter( 'plugin_row_meta', 'cpw_plugin_links', 10, 2 );
63
+
64
+ require_once( 'meta-box.php' );
65
+ require_once( 'popup.php' );
66
+
67
+ // Enqueue styles and scripts on content_block edit page
68
+ function cpw_enqueue() {
69
+ $screen = get_current_screen();
70
+ // Check screen base and current post type
71
+ if ( 'post' === $screen -> base && 'content_block' === $screen -> post_type ) {
72
+ wp_enqueue_style( 'cpw-style', plugins_url( '/assets/css/custom-post-widget.css', __FILE__ ) );
73
+ wp_enqueue_script( 'clipboard', plugins_url( '/assets/js/clipboard.min.js', __FILE__ ), array(), '1.5.16', true );
74
+ wp_enqueue_script( 'clipboard-init', plugins_url( '/assets/js/clipboard.js', __FILE__ ), array(), false, true );
75
+ }
76
+ }
77
+ add_action( 'admin_enqueue_scripts', 'cpw_enqueue' );
78
+
79
+ }
languages/custom-post-widget-nl_NL.mo CHANGED
Binary file
languages/custom-post-widget-nl_NL.po CHANGED
@@ -1,259 +1,205 @@
 
 
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Custom Post Widget\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-09-26 14:32+0200\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: Johan van der Wijk <johan@vanderwijk.nl>\n"
8
- "Language-Team: Johan van der Wijk <info@vanderwijk.com>\n"
9
- "Language: nl_NL\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
- "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
- "X-Poedit-Basepath: .\n"
18
- "X-Textdomain-Support: yes\n"
19
- "X-Generator: Poedit 1.8.5\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPath-1: ..\n"
22
-
23
- # @ custom-post-widget
24
- #: ../meta-box.php:6 ../meta-box.php:47
25
- msgid "Content Block Information"
26
- msgstr "Inhoudsblok Informatie"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- #: ../notice.php:11
29
- #, php-format
30
- msgid ""
31
- "Thank you for using the Custom Post Widget plugin. Visit the <a href="
32
- "\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?"
33
- "utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget\" "
34
- "target=\"_blank\">plugin website</a> to find out more about using this "
35
- "plugin. <a href=\"%1$s\" style=\"float:right;\">Hide Notice</a>"
36
- msgstr ""
37
- "Bedankt voor het installeren van de Custom Post Widget plugin. Bezoek de <a "
38
- "href=\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/\" "
39
- "target=\"_blank\">plugin website</a> voor meer informatie over deze plugin. "
40
- "<a href=\"%1$s\" style=\"float:right;\">Verberg Melding</a>"
41
 
42
- # @ custom-post-widget
43
- #: ../popup.php:17 ../popup.php:18
44
- msgid "Add Content Block"
45
- msgstr "Inhoudsblok toevoegen"
46
 
47
- # @ custom-post-widget
48
- #: ../popup.php:31
49
- msgid "Please select a Content Block"
50
- msgstr "Kies een inhoudsblok"
51
 
52
- # @ custom-post-widget
53
- #: ../popup.php:40 ../popup.php:64
54
- msgid "Insert Content Block"
55
- msgstr "Voeg inhoudsblok toe"
56
 
57
- #: ../popup.php:43
58
- msgid "Select a Content Block below to add it to your post or page."
59
- msgstr "Kies een Inhoudsblok om toe te voegen."
60
 
61
- # @ custom-post-widget
62
- #: ../popup.php:48
63
- msgid "Select a Content Block"
64
- msgstr "Selecteer een inhoudsblok"
65
 
66
- # @ custom-post-widget
67
- #: ../popup.php:58 ../post-widget.php:41
68
- msgid "No content blocks available"
69
- msgstr "Geen inhoudsblokken beschikbaar"
70
 
71
- # @ custom-post-widget
72
- #: ../post-widget.php:11
73
- msgid "Displays custom post content in a widget"
74
- msgstr "Toont een inhoudsblok in een widget"
75
 
76
- # @ custom-post-widget
77
- #: ../post-widget.php:12
78
- msgid "Content Block"
79
- msgstr "Inhoudsblok"
80
 
81
- # @ custom-post-widget
82
- #: ../post-widget.php:26
83
- msgid "Content Block to Display:"
84
- msgstr "Weer te geven inhoudsblok:"
 
 
 
 
 
 
 
 
 
85
 
86
- # @ custom-post-widget
87
- #: ../post-widget.php:52 ../post-widget.php:126
88
- msgid "Edit Content Block"
89
- msgstr "Inhoudsblok Bewerken"
90
 
91
- # @ custom-post-widget
92
- #: ../post-widget.php:58
93
- msgid "Show Post Title"
94
- msgstr "Toon de titel"
95
 
96
- #: ../post-widget.php:63
97
- msgid "Show featured image"
98
- msgstr "Toon uitgelichte afbeelding"
99
 
100
- #: ../post-widget.php:68
101
- msgid "Do not apply content filters"
102
- msgstr "Apply_filters niet toepassen"
103
 
104
- # @ custom-post-widget
105
- #: ../post-widget.php:84
106
  msgid "Find"
107
  msgstr "Zoeken"
108
 
109
- # @ custom-post-widget
110
- #: ../post-widget.php:121
111
  msgctxt "post type general name"
112
  msgid "Content Blocks"
113
  msgstr "Inhoudsblokken"
114
 
115
- # @ custom-post-widget
116
- #: ../post-widget.php:122
117
  msgctxt "post type singular name"
118
  msgid "Content Block"
119
  msgstr "Inhoudsblok"
120
 
121
- # @ custom-post-widget
122
- #: ../post-widget.php:123
123
  msgctxt "post type plural name"
124
  msgid "Content Blocks"
125
  msgstr "Inhoudsblokken"
126
 
127
- # @ custom-post-widget
128
- #: ../post-widget.php:124
129
  msgctxt "block"
130
  msgid "Add Content Block"
131
  msgstr "Nieuw Inhoudsblok"
132
 
133
- # @ custom-post-widget
134
- #: ../post-widget.php:125
135
  msgid "Add New Content Block"
136
  msgstr "Nieuw inhoudsblok toevoegen"
137
 
138
- # @ custom-post-widget
139
- #: ../post-widget.php:127
140
  msgid "New Content Block"
141
  msgstr "Nieuw Inhoudsblok"
142
 
143
- # @ custom-post-widget
144
- #: ../post-widget.php:128
145
  msgid "View Content Block"
146
  msgstr "Inhoudsblok Bekijken"
147
 
148
- # @ custom-post-widget
149
- #: ../post-widget.php:129
150
  msgid "Search Content Blocks"
151
  msgstr "Inhoudsblokken zoeken"
152
 
153
- # @ custom-post-widget
154
- #: ../post-widget.php:130
155
- msgid "No Content Blocks Found"
156
- msgstr "Geen Inhoudsblokken"
157
-
158
- # @ custom-post-widget
159
- #: ../post-widget.php:131
160
- msgid "No Content Blocks found in Trash"
161
- msgstr "Geen Inhoudsblokken in de Prullenbak"
162
-
163
- # @ custom-post-widget
164
- #: ../post-widget.php:154
165
- #, php-format
166
- msgid "Content Block updated. <a href=\"%s\">Manage Widgets</a>"
167
- msgstr "Inhoudsblok bijgewerkt. <a href=\"%s\">Beheer Widgets</a>"
168
 
169
- # @ custom-post-widget
170
- #: ../post-widget.php:154 ../post-widget.php:157
171
- msgid "Content Block updated."
172
- msgstr "Inhoudsblok bijgewerkt."
173
 
174
- # @ custom-post-widget
175
- #: ../post-widget.php:155
176
- msgid "Custom field updated."
177
- msgstr "Custom field bijgewerkt."
178
 
179
- # @ custom-post-widget
180
- #: ../post-widget.php:156
181
- msgid "Custom field deleted."
182
- msgstr "Custom field verwijderd."
183
 
184
- # @ custom-post-widget
185
- #: ../post-widget.php:158
186
- #, php-format
187
- msgid "Content Block restored to revision from %s"
188
- msgstr "Inhoudsblok teruggezet naar revisie %s"
189
 
190
- # @ custom-post-widget
191
- #: ../post-widget.php:159
192
- #, php-format
193
- msgid "Content Block published. <a href=\"%s\">Manage Widgets</a>"
194
- msgstr "Inhoudsblok gepubliceerd. <a href=\"%s\">Beheer Widgets</a>"
195
 
196
- # @ custom-post-widget
197
- #: ../post-widget.php:159
198
- msgid "Content Block published."
199
- msgstr "Inhoudsblok gepubliceerd."
200
 
201
- # @ custom-post-widget
202
- #: ../post-widget.php:160
203
- msgid "Block saved."
204
- msgstr "Inhoudsblok Opgeslagen."
205
 
206
- # @ custom-post-widget
207
- #: ../post-widget.php:161
208
- #, php-format
209
- msgid "Content Block submitted. <a href=\"%s\">Manage Widgets</a>"
210
- msgstr "Inhoudsblok toegevoegd. <a href=\"%s\">Beheer Widgets</a>"
211
 
212
- # @ custom-post-widget
213
- #: ../post-widget.php:161
214
- msgid "Content Block submitted."
215
- msgstr "Inhoudsblok toegevoegd."
216
 
217
- # @ custom-post-widget
218
- #: ../post-widget.php:162
219
- #, php-format
220
- msgid "Content Block scheduled for: <strong>%1$s</strong>."
221
- msgstr "Inhoudsblok zal worden gepubliceerd op: <strong>%1$s</strong>."
222
 
223
- # @ custom-post-widget
224
- #: ../post-widget.php:162
225
- msgid "M j, Y @ G:i"
226
- msgstr "j. M Y @ H:M"
227
 
228
- # @ custom-post-widget
229
- #: ../post-widget.php:163
230
- #, php-format
231
- msgid "Content Block draft updated. <a href=\"%s\">Manage Widgets</a>"
232
- msgstr "Concept Inhoudsblok Bijgewerkt. <a href=\"%s\">Beheer Widgets</a>"
233
 
234
- # @ custom-post-widget
235
- #: ../post-widget.php:163
236
- msgid "Content Block draft updated."
237
- msgstr "Concept Inhoudsblok bijgewerkt."
238
 
239
- #~ msgid ""
240
- #~ "Thank you for using the Custom Post Widget plugin. Visit the <a href="
241
- #~ "\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/\" "
242
- #~ "target=\"_blank\">plugin website</a> to find out more about using this "
243
- #~ "plugin. <a href=\"%1$s\" style=\"float:right;\">Hide Notice</a>"
244
- #~ msgstr ""
245
- #~ "Bedankt voor het installeren van de Custom Post Widget plugin. Bezoek de "
246
- #~ "<a href=\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-"
247
- #~ "widget/\" target=\"_blank\">plugin website</a> voor meer informatie over "
248
- #~ "deze plugin. <a href=\"%1$s\" style=\"float:right;\">Verberg Bericht</a>"
249
-
250
- #~ msgid ""
251
- #~ "Thank you for using the Custom Post Widget plugin. Visit the <a href="
252
- #~ "\"https://www.savvii.eu/wordpress-custom-post-widget/\" target=\"_blank"
253
- #~ "\">Savvii website</a> to find out more about using this plugin. <a href="
254
- #~ "\"%1$s\" style=\"float:right;\">Hide Notice</a>"
255
- #~ msgstr ""
256
- #~ "Bedankt voor het gebruiken van de Savvii Custom Post Widget plugin. "
257
- #~ "Bezoek de <a href=\"https://www.savvii.eu/wordpress-custom-post-widget/\" "
258
- #~ "target=\"_blank\">Savvii website</a> voor meer informatie over deze "
259
- #~ "plugin. <a href=\"%1$s\" style=\"float:right;\">Verberg Bericht</a>"
1
+ # Translation of Development (trunk) in Dutch
2
+ # This file is distributed under the same license as the Development (trunk) package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2016-01-29 15:43+0100\n"
 
 
 
 
 
 
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
10
+ "X-Generator: Poedit 1.8.6\n"
11
+ "Project-Id-Version: Development (trunk)\n"
12
+ "POT-Creation-Date: \n"
13
+ "Last-Translator: \n"
14
+ "Language-Team: \n"
15
+ "Language: nl\n"
16
+
17
+ #. Plugin Name of the plugin/theme
18
+ msgid "Custom Post Widget"
19
+ msgstr "Custom Post Widget"
20
+
21
+ #. Plugin URI of the plugin/theme
22
+ msgid "http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget"
23
+ msgstr "http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget"
24
+
25
+ #. Description of the plugin/theme
26
+ msgid "Show the content of a custom post of the type 'content_block' in a widget or with a shortcode."
27
+ msgstr "Toon de inhoud van een custom post van het type 'content_block' in een widget of met een shortcode."
28
+
29
+ #. Author of the plugin/theme
30
+ msgid "Johan van der Wijk"
31
+ msgstr "Johan van der Wijk"
32
+
33
+ #. Author URI of the plugin/theme
34
+ msgid "http://vanderwijk.nl"
35
+ msgstr "http://vanderwijk.nl"
36
+
37
+ #: post-widget.php:163
38
+ msgid "Content Block draft updated. <a href=\"%s\">Manage Widgets</a>"
39
+ msgstr "Concept Inhoudsblok Bijgewerkt. <a href=\"%s\">Beheer Widgets</a>"
40
 
41
+ #: post-widget.php:163
42
+ msgid "Content Block draft updated."
43
+ msgstr "Concept Inhoudsblok bijgewerkt."
 
 
 
 
 
 
 
 
 
 
44
 
45
+ #: post-widget.php:158
46
+ msgid "Content Block restored to revision from %s"
47
+ msgstr "Inhoudsblok teruggezet naar revisie %s"
 
48
 
49
+ #: post-widget.php:159
50
+ msgid "Content Block published. <a href=\"%s\">Manage Widgets</a>"
51
+ msgstr "Inhoudsblok gepubliceerd. <a href=\"%s\">Beheer Widgets</a>"
 
52
 
53
+ #: post-widget.php:159
54
+ msgid "Content Block published."
55
+ msgstr "Inhoudsblok gepubliceerd."
 
56
 
57
+ #: post-widget.php:160
58
+ msgid "Block saved."
59
+ msgstr "Inhoudsblok Opgeslagen."
60
 
61
+ #: post-widget.php:161
62
+ msgid "Content Block submitted. <a href=\"%s\">Manage Widgets</a>"
63
+ msgstr "Inhoudsblok toegevoegd. <a href=\"%s\">Beheer Widgets</a>"
 
64
 
65
+ #: post-widget.php:161
66
+ msgid "Content Block submitted."
67
+ msgstr "Inhoudsblok toegevoegd."
 
68
 
69
+ #: post-widget.php:162
70
+ msgid "Content Block scheduled for: <strong>%1$s</strong>."
71
+ msgstr "Inhoudsblok zal worden gepubliceerd op: <strong>%1$s</strong>."
 
72
 
73
+ #: post-widget.php:162
74
+ msgid "M j, Y @ G:i"
75
+ msgstr "j. M Y @ H:M"
 
76
 
77
+ #: post-widget.php:156
78
+ msgid "Custom field deleted."
79
+ msgstr ""
80
+ "Aangepaste\n"
81
+ " \n"
82
+ "veld\n"
83
+ " \n"
84
+ "verwijderd\n"
85
+ "."
86
+
87
+ #: post-widget.php:130
88
+ msgid "No Content Blocks Found"
89
+ msgstr "Geen Inhoudsblokken"
90
 
91
+ #: post-widget.php:131
92
+ msgid "No Content Blocks found in Trash"
93
+ msgstr "Geen Inhoudsblokken in de Prullenbak"
 
94
 
95
+ #: post-widget.php:154
96
+ msgid "Content Block updated. <a href=\"%s\">Manage Widgets</a>"
97
+ msgstr "Inhoudsblok bijgewerkt. <a href=\"%s\">Beheer Widgets</a>"
 
98
 
99
+ #: post-widget.php:154 post-widget.php:157
100
+ msgid "Content Block updated."
101
+ msgstr "Inhoudsblok bijgewerkt."
102
 
103
+ #: post-widget.php:155
104
+ msgid "Custom field updated."
105
+ msgstr "Custom field bijgewerkt."
106
 
107
+ #: post-widget.php:84
 
108
  msgid "Find"
109
  msgstr "Zoeken"
110
 
111
+ #: post-widget.php:121
 
112
  msgctxt "post type general name"
113
  msgid "Content Blocks"
114
  msgstr "Inhoudsblokken"
115
 
116
+ #: post-widget.php:122
 
117
  msgctxt "post type singular name"
118
  msgid "Content Block"
119
  msgstr "Inhoudsblok"
120
 
121
+ #: post-widget.php:123
 
122
  msgctxt "post type plural name"
123
  msgid "Content Blocks"
124
  msgstr "Inhoudsblokken"
125
 
126
+ #: post-widget.php:124
 
127
  msgctxt "block"
128
  msgid "Add Content Block"
129
  msgstr "Nieuw Inhoudsblok"
130
 
131
+ #: post-widget.php:125
 
132
  msgid "Add New Content Block"
133
  msgstr "Nieuw inhoudsblok toevoegen"
134
 
135
+ #: post-widget.php:127
 
136
  msgid "New Content Block"
137
  msgstr "Nieuw Inhoudsblok"
138
 
139
+ #: post-widget.php:128
 
140
  msgid "View Content Block"
141
  msgstr "Inhoudsblok Bekijken"
142
 
143
+ #: post-widget.php:129
 
144
  msgid "Search Content Blocks"
145
  msgstr "Inhoudsblokken zoeken"
146
 
147
+ #: meta-box.php:6 meta-box.php:47
148
+ msgid "Content Block Information"
149
+ msgstr "Inhoudsblok Informatie"
 
 
 
 
 
 
 
 
 
 
 
 
150
 
151
+ #: notice.php:11
152
+ msgid "Thank you for using the Custom Post Widget plugin. Visit the <a href=\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/?utm_source=wordpress&utm_medium=plugin&utm_campaign=custom_post_widget\" target=\"_blank\">plugin website</a> to find out more about using this plugin. <a href=\"%1$s\" style=\"float:right;\">Hide Notice</a>"
153
+ msgstr "Bedankt voor het installeren van de Custom Post Widget plugin. Bezoek de <a href=\"http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/\" target=\"_blank\">plugin website</a> voor meer informatie over deze plugin. <a href=\"%1$s\" style=\"float:right;\">Verberg Melding</a>"
 
154
 
155
+ #: popup.php:17 popup.php:18
156
+ msgid "Add Content Block"
157
+ msgstr "Inhoudsblok toevoegen"
 
158
 
159
+ #: popup.php:31
160
+ msgid "Please select a Content Block"
161
+ msgstr "Kies een inhoudsblok"
 
162
 
163
+ #: popup.php:40 popup.php:64
164
+ msgid "Insert Content Block"
165
+ msgstr "Voeg inhoudsblok toe"
 
 
166
 
167
+ #: popup.php:43
168
+ msgid "Select a Content Block below to add it to your post or page."
169
+ msgstr "Kies een Inhoudsblok om toe te voegen."
 
 
170
 
171
+ #: popup.php:48
172
+ msgid "Select a Content Block"
173
+ msgstr "Selecteer een inhoudsblok"
 
174
 
175
+ #: popup.php:58 post-widget.php:41
176
+ msgid "No content blocks available"
177
+ msgstr "Geen inhoudsblokken beschikbaar"
 
178
 
179
+ #: post-widget.php:11
180
+ msgid "Displays custom post content in a widget"
181
+ msgstr "Toont een inhoudsblok in een widget"
 
 
182
 
183
+ #: post-widget.php:12
184
+ msgid "Content Block"
185
+ msgstr "Inhoudsblok"
 
186
 
187
+ #: post-widget.php:26
188
+ msgid "Content Block to Display:"
189
+ msgstr "Weer te geven inhoudsblok:"
 
 
190
 
191
+ #: post-widget.php:52 post-widget.php:126
192
+ msgid "Edit Content Block"
193
+ msgstr "Inhoudsblok Bewerken"
 
194
 
195
+ #: post-widget.php:58
196
+ msgid "Show Post Title"
197
+ msgstr "Toon de titel"
 
 
198
 
199
+ #: post-widget.php:63
200
+ msgid "Show featured image"
201
+ msgstr "Toon uitgelichte afbeelding"
 
202
 
203
+ #: post-widget.php:68
204
+ msgid "Do not apply content filters"
205
+ msgstr "Apply_filters niet toepassen"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
meta-box.php CHANGED
@@ -1,32 +1,42 @@
1
  <?php
2
 
3
- function cpw_add_meta_box() {
4
- add_meta_box(
5
- 'cpw_sectionid',
6
- __( 'Content Block Information', 'custom-post-widget' ),
7
- 'cpw_meta_box',
8
- 'content_block',
9
- 'side'
10
- );
11
  }
12
- add_action( 'add_meta_boxes', 'cpw_add_meta_box' );
13
 
14
- function cpw_meta_box( $post ) {
15
- wp_nonce_field( 'cpw_meta_box', 'cpw_meta_box_nonce' );
16
- $value = get_post_meta( $post->ID, '_content_block_information', true );
17
- echo '<textarea id="cpw_content_block_information" cols="40" rows="4" name="cpw_content_block_information" style="height: 8em; width: 100%;">' . esc_attr( $value ) . '</textarea>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
 
20
  function cpw_save_postdata( $post_id ) {
21
- if ( ! isset( $_POST['cpw_meta_box_nonce'] ) )
22
  return $post_id;
23
 
24
- $nonce = $_POST['cpw_meta_box_nonce'];
25
 
26
- if ( ! wp_verify_nonce( $nonce, 'cpw_meta_box' ) )
27
  return $post_id;
28
 
29
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
30
  return $post_id;
31
 
32
  if ( 'content_block' == $_POST['post_type'] ) {
@@ -43,11 +53,11 @@ function cpw_save_postdata( $post_id ) {
43
  add_action( 'save_post', 'cpw_save_postdata' );
44
 
45
  // Add content block information column to overview
46
- function cpw_modify_material_table( $column ) {
47
  $column['content_block_information'] = __( 'Content Block Information', 'custom-post-widget' );
48
  return $column;
49
  }
50
- add_filter( 'manage_edit-content_block_columns', 'cpw_modify_material_table' );
51
 
52
  function cpw_modify_post_table_row( $column_name, $post_id ) {
53
  $custom_fields = get_post_custom( $post_id );
@@ -59,4 +69,4 @@ function cpw_modify_post_table_row( $column_name, $post_id ) {
59
  break;
60
  }
61
  }
62
- add_action( 'manage_posts_custom_column', 'cpw_modify_post_table_row', 10, 2 );
1
  <?php
2
 
3
+ // Meta boxes on content_block edit page
4
+ function cpw_add_meta_boxes() {
5
+ add_meta_box( 'cpw_info', __( 'Content Block Information', 'custom-post-widget' ), 'cpw_info_meta_box', 'content_block', 'side' );
6
+ add_meta_box( 'cpw_shortcode', __( 'Content Block Shortcodes', 'custom-post-widget' ), 'cpw_shortcode_meta_box', 'content_block', 'side' );
 
 
 
 
7
  }
8
+ add_action( 'add_meta_boxes_content_block', 'cpw_add_meta_boxes' );
9
 
10
+ // Shortcode meta box
11
+ function cpw_shortcode_meta_box( $post ) { ?>
12
+ <p><?php _e( 'You can place this content block into your posts, pages, custom post types or widgets using the shortcode below:','custom-post-widget' ); ?></p>
13
+ <code class="cpw-code" id="cpw-shortcode-1"><?php echo '[content_block id=' . $post -> ID . ' slug=' . $post -> post_name . ']'; ?></code>
14
+ <span class="cpw-clipboard" data-clipboard-target="#cpw-shortcode-1"><?php _e( 'Copy to clipboard', 'custom-post-widget' ); ?></span>
15
+
16
+ <p><?php _e( 'Use this shortcode to include the content block title:','custom-post-widget' ); ?></p>
17
+ <code class="cpw-code" id="cpw-shortcode-2"><?php echo '[content_block id=' . $post -> ID . ' slug=' . $post -> post_name . ' title=yes title_tag=h3]'; ?></code>
18
+ <span class="cpw-clipboard" data-clipboard-target="#cpw-shortcode-2"><?php _e( 'Copy to clipboard', 'custom-post-widget' ); ?></span>
19
+ <?php
20
+ }
21
+
22
+ // Info meta box
23
+ function cpw_info_meta_box( $post ) {
24
+ wp_nonce_field( 'cpw_info_meta_box', 'cpw_info_meta_box_nonce' );
25
+ $value = get_post_meta( $post -> ID, '_content_block_information', true );
26
+ echo '<p>' . __( 'You can use this field to describe this content block:','custom-post-widget' ) . '</p>';
27
+ echo '<textarea class="cpw-information" id="cpw_content_block_information" cols="40" rows="4" name="cpw_content_block_information">' . esc_attr( $value ) . '</textarea>';
28
  }
29
 
30
  function cpw_save_postdata( $post_id ) {
31
+ if ( ! isset( $_POST['cpw_info_meta_box_nonce'] ) )
32
  return $post_id;
33
 
34
+ $nonce = $_POST['cpw_info_meta_box_nonce'];
35
 
36
+ if ( ! wp_verify_nonce( $nonce, 'cpw_info_meta_box' ) )
37
  return $post_id;
38
 
39
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
40
  return $post_id;
41
 
42
  if ( 'content_block' == $_POST['post_type'] ) {
53
  add_action( 'save_post', 'cpw_save_postdata' );
54
 
55
  // Add content block information column to overview
56
+ function cpw_modify_content_block_table( $column ) {
57
  $column['content_block_information'] = __( 'Content Block Information', 'custom-post-widget' );
58
  return $column;
59
  }
60
+ add_filter( 'manage_edit-content_block_columns', 'cpw_modify_content_block_table' );
61
 
62
  function cpw_modify_post_table_row( $column_name, $post_id ) {
63
  $custom_fields = get_post_custom( $post_id );
69
  break;
70
  }
71
  }
72
+ add_action( 'manage_posts_custom_column', 'cpw_modify_post_table_row', 10, 2 );
popup.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
 
3
  // Add button above editor if not editing content_block
4
  function add_content_block_icon() {
5
  echo '<style>
6
- #add-content-block .dashicons-screenoptions {
7
  color: #888;
8
  height: 18px;
9
  margin: 0 4px 0 0;
10
  vertical-align: text-top;
11
  width: 18px;
12
  }
13
- #add-content-block {
14
  padding-left: 0.4em;
15
  }
16
  </style>
17
- <a id="add-content-block" class="button thickbox" title="' . __("Add Content Block", 'custom-post-widget' ) . '" href="' . plugins_url() . 'popup.php?type=add_content_block_popup&amp;TB_inline=true&amp;inlineId=content-block-form">
18
  <div class="dashicons dashicons-screenoptions"></div>' . __("Add Content Block", "custom-post-widget") . '
19
  </a>';
20
  }
@@ -47,7 +47,7 @@ function add_content_block_popup() { ?>
47
  <option value="">
48
  <?php _e( 'Select a Content Block', 'custom-post-widget' ); ?>
49
  </option>
50
- <?php
51
  $args = array( 'post_type' => 'content_block', 'suppress_filters' => 0, 'numberposts' => -1, 'order' => 'ASC' );
52
  $content_block = get_posts( $args );
53
  if ($content_block) {
@@ -64,5 +64,5 @@ function add_content_block_popup() { ?>
64
  <input type="button" class="button-primary" value="<?php _e( 'Insert Content Block', 'custom-post-widget' ) ?>" onclick="insertContentBlockShortcode();"/>
65
  </p>
66
  </div>
67
-
68
- <?php }
1
+ <?php
2
 
3
  // Add button above editor if not editing content_block
4
  function add_content_block_icon() {
5
  echo '<style>
6
+ .cpw-button .dashicons-screenoptions {
7
  color: #888;
8
  height: 18px;
9
  margin: 0 4px 0 0;
10
  vertical-align: text-top;
11
  width: 18px;
12
  }
13
+ .cpw-button {
14
  padding-left: 0.4em;
15
  }
16
  </style>
17
+ <a id="add-content-block" class="button thickbox cpw-button" title="' . __("Add Content Block", 'custom-post-widget' ) . '" href="' . plugins_url() . 'popup.php?type=add_content_block_popup&amp;TB_inline=true&amp;inlineId=content-block-form">
18
  <div class="dashicons dashicons-screenoptions"></div>' . __("Add Content Block", "custom-post-widget") . '
19
  </a>';
20
  }
47
  <option value="">
48
  <?php _e( 'Select a Content Block', 'custom-post-widget' ); ?>
49
  </option>
50
+ <?php
51
  $args = array( 'post_type' => 'content_block', 'suppress_filters' => 0, 'numberposts' => -1, 'order' => 'ASC' );
52
  $content_block = get_posts( $args );
53
  if ($content_block) {
64
  <input type="button" class="button-primary" value="<?php _e( 'Insert Content Block', 'custom-post-widget' ) ?>" onclick="insertContentBlockShortcode();"/>
65
  </p>
66
  </div>
67
+
68
+ <?php }
post-widget.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  // Add featured image support
4
- if ( function_exists( 'add_theme_support' ) ) {
5
  add_theme_support( 'post-thumbnails' );
6
  }
7
 
@@ -44,7 +44,7 @@ class custom_post_widget extends WP_Widget {
44
  </select>
45
  </label>
46
  </p>
47
-
48
  <input type="hidden" id="<?php echo $this -> get_field_id( 'title' ); ?>" name="<?php echo $this -> get_field_name( 'title' ); ?>" value="<?php if ( !empty( $widgetExtraTitle ) ) { echo $widgetExtraTitle; } ?>" />
49
 
50
  <p>
@@ -55,7 +55,7 @@ class custom_post_widget extends WP_Widget {
55
 
56
  <p>
57
  <input class="checkbox" type="checkbox" <?php checked( (bool) isset( $instance['show_custom_post_title'] ), true ); ?> id="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_custom_post_title' ); ?>" />
58
- <label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __( 'Show Post Title', 'custom-post-widget' ) ?></label>
59
  </p>
60
 
61
  <p>
@@ -66,7 +66,7 @@ class custom_post_widget extends WP_Widget {
66
  <p>
67
  <input class="checkbox" type="checkbox" <?php checked( (bool) isset( $instance['apply_content_filters'] ), true ); ?> id="<?php echo $this->get_field_id( 'apply_content_filters' ); ?>" name="<?php echo $this->get_field_name( 'apply_content_filters' ); ?>" />
68
  <label for="<?php echo $this->get_field_id( 'apply_content_filters' ); ?>"><?php echo __( 'Do not apply content filters', 'custom-post-widget' ) ?></label>
69
- </p> <?php
70
  }
71
 
72
  function update( $new_instance, $old_instance ) {
@@ -83,7 +83,7 @@ class custom_post_widget extends WP_Widget {
83
  extract($args);
84
  $custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __( 'Find', 'custom-post-widget' );
85
  // Add support for WPML Plugin.
86
- if ( function_exists( 'icl_object_id' ) ){
87
  $custom_post_id = icl_object_id( $custom_post_id, 'content_block', true );
88
  }
89
  // Variables from the widget settings.
@@ -104,7 +104,7 @@ class custom_post_widget extends WP_Widget {
104
  }
105
  echo $before_widget;
106
  if ( $show_custom_post_title ) {
107
- echo $before_title . apply_filters( 'widget_title',$content_post->post_title) . $after_title; // This is the line that displays the title (only if show title is set)
108
  }
109
  if ( $show_featured_image ) {
110
  echo get_the_post_thumbnail( $content_post -> ID );
@@ -150,7 +150,7 @@ add_action( 'init', 'cpw_post_type_init' );
150
 
151
  function content_block_messages( $messages ) {
152
  $messages['content_block'] = array(
153
- 0 => '',
154
  1 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block updated.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
155
  2 => __( 'Custom field updated.', 'custom-post-widget' ),
156
  3 => __( 'Custom field deleted.', 'custom-post-widget' ),
@@ -173,8 +173,8 @@ function custom_post_widget_shortcode( $atts ) {
173
  'slug' => '',
174
  'class' => 'content_block',
175
  'suppress_content_filters' => 'no',
176
- 'title' => 'no',
177
- 'title_tag' => 'h3'
178
  ), $atts ) );
179
 
180
  if ( $slug ) {
@@ -185,7 +185,7 @@ function custom_post_widget_shortcode( $atts ) {
185
  }
186
 
187
  $content = "";
188
-
189
  if( $id != "" ) {
190
  $args = array(
191
  'post__in' => array( $id ),
@@ -197,12 +197,12 @@ function custom_post_widget_shortcode( $atts ) {
197
  foreach( $content_post as $post ) :
198
  $content .= '<div class="'. esc_attr($class) .'" id="custom_post_widget-' . $id . '">';
199
  if ( $title === 'yes' ) {
200
- $content .= '<' . esc_attr( $title_tag ) . '>' . $post->post_title . '</' . esc_attr( $title_tag ) . '>';
201
  }
202
  if ( $suppress_content_filters === 'no' ) {
203
  $content .= apply_filters( 'the_content', $post->post_content);
204
  } else {
205
- $content .= $post->post_content;
206
  }
207
  $content .= '</div>';
208
  endforeach;
@@ -220,4 +220,4 @@ function cpw_add_content_block_button() {
220
  add_action( 'admin_footer', 'add_content_block_popup' );
221
  }
222
  }
223
- add_action( 'admin_head', 'cpw_add_content_block_button' );
1
  <?php
2
 
3
  // Add featured image support
4
+ if ( function_exists( 'add_theme_support' ) ) {
5
  add_theme_support( 'post-thumbnails' );
6
  }
7
 
44
  </select>
45
  </label>
46
  </p>
47
+
48
  <input type="hidden" id="<?php echo $this -> get_field_id( 'title' ); ?>" name="<?php echo $this -> get_field_name( 'title' ); ?>" value="<?php if ( !empty( $widgetExtraTitle ) ) { echo $widgetExtraTitle; } ?>" />
49
 
50
  <p>
55
 
56
  <p>
57
  <input class="checkbox" type="checkbox" <?php checked( (bool) isset( $instance['show_custom_post_title'] ), true ); ?> id="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>" name="<?php echo $this->get_field_name( 'show_custom_post_title' ); ?>" />
58
+ <label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __( 'Show post title', 'custom-post-widget' ) ?></label>
59
  </p>
60
 
61
  <p>
66
  <p>
67
  <input class="checkbox" type="checkbox" <?php checked( (bool) isset( $instance['apply_content_filters'] ), true ); ?> id="<?php echo $this->get_field_id( 'apply_content_filters' ); ?>" name="<?php echo $this->get_field_name( 'apply_content_filters' ); ?>" />
68
  <label for="<?php echo $this->get_field_id( 'apply_content_filters' ); ?>"><?php echo __( 'Do not apply content filters', 'custom-post-widget' ) ?></label>
69
+ </p> <?php
70
  }
71
 
72
  function update( $new_instance, $old_instance ) {
83
  extract($args);
84
  $custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __( 'Find', 'custom-post-widget' );
85
  // Add support for WPML Plugin.
86
+ if ( function_exists( 'icl_object_id' ) ){
87
  $custom_post_id = icl_object_id( $custom_post_id, 'content_block', true );
88
  }
89
  // Variables from the widget settings.
104
  }
105
  echo $before_widget;
106
  if ( $show_custom_post_title ) {
107
+ echo $before_title . apply_filters( 'widget_title',$content_post->post_title) . $after_title; // This is the line that displays the title (only if show title is set)
108
  }
109
  if ( $show_featured_image ) {
110
  echo get_the_post_thumbnail( $content_post -> ID );
150
 
151
  function content_block_messages( $messages ) {
152
  $messages['content_block'] = array(
153
+ 0 => '',
154
  1 => current_user_can( 'edit_theme_options' ) ? sprintf( __( 'Content Block updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget' ), esc_url( 'widgets.php' ) ) : sprintf( __( 'Content Block updated.', 'custom-post-widget' ), esc_url( 'widgets.php' ) ),
155
  2 => __( 'Custom field updated.', 'custom-post-widget' ),
156
  3 => __( 'Custom field deleted.', 'custom-post-widget' ),
173
  'slug' => '',
174
  'class' => 'content_block',
175
  'suppress_content_filters' => 'no',
176
+ 'title' => 'no',
177
+ 'title_tag' => 'h3'
178
  ), $atts ) );
179
 
180
  if ( $slug ) {
185
  }
186
 
187
  $content = "";
188
+
189
  if( $id != "" ) {
190
  $args = array(
191
  'post__in' => array( $id ),
197
  foreach( $content_post as $post ) :
198
  $content .= '<div class="'. esc_attr($class) .'" id="custom_post_widget-' . $id . '">';
199
  if ( $title === 'yes' ) {
200
+ $content .= '<' . esc_attr( $title_tag ) . '>' . $post->post_title . '</' . esc_attr( $title_tag ) . '>';
201
  }
202
  if ( $suppress_content_filters === 'no' ) {
203
  $content .= apply_filters( 'the_content', $post->post_content);
204
  } else {
205
+ $content .= $post->post_content;
206
  }
207
  $content .= '</div>';
208
  endforeach;
220
  add_action( 'admin_footer', 'add_content_block_popup' );
221
  }
222
  }
223
+ add_action( 'admin_head', 'cpw_add_content_block_button' );
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: vanderwijk
3
  Tags: widget, sidebar, content block, block, custom, post, shortcode, wysiwyg, wpml, featured image
4
  Requires at least: 4.0
5
- Tested up to: 4.4.1
6
- Stable tag: 2.8.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -27,7 +27,7 @@ To add content to a widget, drag it to the required position in the sidebar and
27
 
28
  **Includes the following translations:**
29
 
30
- * Czech (cs_CZ) by [Martin Kucera](http://jsemweb.cz/)
31
  * Dutch (nl_NL) by [Johan van der Wijk](http://vanderwijk.nl)
32
  * French (fr_FR) by [Alexandre Simard](http://brocheafoin.biz/)
33
  * German (de_DE) by [Caspar H&uuml;binger](http://glueckpress.com/)
@@ -35,7 +35,7 @@ To add content to a widget, drag it to the required position in the sidebar and
35
  * Italian (it_IT) by [Ercicion](http://ercicion.altervista.org/blog/)
36
  * Polish (pl_PL) by [Kuba Skublicki](https://www.linkedin.com/in/kubecki)
37
  * Portuguese (pt_BR) by [Ronaldo Chevalier](http://www.hostmeta.com.br/)
38
- * Russian (ru_RU) by [Vitaliy Kaplya](http://www.dasayt.com/)
39
  * Swedish (sv_SE) by [Andreas Larsson](http://krokedil.se)
40
 
41
  More translations are very welcome!
@@ -79,7 +79,7 @@ If your social media sharing plugin adds buttons to the widget areas you could c
79
 
80
  = The title and featured image are not displayed when using the shortcode =
81
 
82
- Currently the shortcode function only outputs the post content of the content block, future support for displaying the title and/or the attached featured image is being considered.
83
 
84
  = I have a feature request =
85
 
@@ -88,14 +88,13 @@ These new features are on the to-do list:
88
 
89
  * Display the content block featured image when using the shortcode
90
  * Front-end editing of the content blocks
91
- * Display shortcode on content block edit screen and/or overview page similar to Contact Form 7
92
  * Visual Composer integration
93
 
94
  = How can I make advanced changes to the widget layout? =
95
 
96
  You can create your own widget template and upload this to your theme folder. See [this support topic](http://wordpress.org/support/topic/patch-custom-widget-frontends?replies=1) for more information about this feature.
97
 
98
- = Can I make the post type public? =
99
 
100
  You can make the post type public by adding the following code to your theme's functions.php file:
101
  `function filter_content_block_init() {
@@ -132,6 +131,9 @@ Creating and supporting this plugin takes up a lot of my free time, therefore I
132
 
133
  == Changelog ==
134
 
 
 
 
135
  = 2.8.5 =
136
  Fix for minor compatibility issue when using the Slider Revolution plugin
137
 
2
  Contributors: vanderwijk
3
  Tags: widget, sidebar, content block, block, custom, post, shortcode, wysiwyg, wpml, featured image
4
  Requires at least: 4.0
5
+ Tested up to: 4.7
6
+ Stable tag: 2.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
27
 
28
  **Includes the following translations:**
29
 
30
+ * Czech (cs_CZ) by [Martin Kucera](http://jsemweb.cz/)
31
  * Dutch (nl_NL) by [Johan van der Wijk](http://vanderwijk.nl)
32
  * French (fr_FR) by [Alexandre Simard](http://brocheafoin.biz/)
33
  * German (de_DE) by [Caspar H&uuml;binger](http://glueckpress.com/)
35
  * Italian (it_IT) by [Ercicion](http://ercicion.altervista.org/blog/)
36
  * Polish (pl_PL) by [Kuba Skublicki](https://www.linkedin.com/in/kubecki)
37
  * Portuguese (pt_BR) by [Ronaldo Chevalier](http://www.hostmeta.com.br/)
38
+ * Russian (ru_RU) by [Vitaliy Kaplya](http://www.dasayt.com/)
39
  * Swedish (sv_SE) by [Andreas Larsson](http://krokedil.se)
40
 
41
  More translations are very welcome!
79
 
80
  = The title and featured image are not displayed when using the shortcode =
81
 
82
+ Currently the shortcode function only outputs the post content and title of the content block, future support for displaying the attached featured image is being considered.
83
 
84
  = I have a feature request =
85
 
88
 
89
  * Display the content block featured image when using the shortcode
90
  * Front-end editing of the content blocks
 
91
  * Visual Composer integration
92
 
93
  = How can I make advanced changes to the widget layout? =
94
 
95
  You can create your own widget template and upload this to your theme folder. See [this support topic](http://wordpress.org/support/topic/patch-custom-widget-frontends?replies=1) for more information about this feature.
96
 
97
+ = Can I make the post type public? =
98
 
99
  You can make the post type public by adding the following code to your theme's functions.php file:
100
  `function filter_content_block_init() {
131
 
132
  == Changelog ==
133
 
134
+ = 2.9 =
135
+ Removed the admin notice, added donation link to plugin overview page. Shortcodes are now displayed on the content block edit screen, thanks to [Remkus](https://forsite.media/) for suggesting this feature.
136
+
137
  = 2.8.5 =
138
  Fix for minor compatibility issue when using the Slider Revolution plugin
139