Content Blocks (Custom Post Widget) - Version 1.9.2

Version Description

Now includes Polish language files as created by Kuba Skublicki.

=

Download this release

Release Info

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

Code changes from version 1.8 to 1.9.2

custom-post-widget.php CHANGED
@@ -3,15 +3,14 @@
3
  Plugin Name: Custom Post Widget
4
  Plugin URI: http://www.vanderwijk.com/services/web-design/wordpress-custom-post-widget/
5
  Description: Show the content of a custom post of the type 'content_block' in a widget.
6
- Version: 1.6
7
  Author: Johan van der Wijk
8
  Author URI: http://www.vanderwijk.com
9
  License: GPL2
10
 
11
- Release notes: Version 1.6 of the Custom Post Widget plugin now uses the much more efficient
12
- get_post instead of query_post to display the widget content.
13
 
14
- Copyright 2011 Johan van der Wijk (email: info@vanderwijk.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License, version 2, as
@@ -27,31 +26,23 @@
27
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
  */
29
 
30
- /* Set constant path to the custom-post-widget plugin directory. */
31
  define( 'CUSTOM_POST_WIDGET_DIR', plugin_dir_path( __FILE__ ) );
32
  define( 'CUSTOM_POST_WIDGET_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)) );
33
 
34
- /* Launch the plugin. */
35
  add_action( 'plugins_loaded', 'custom_post_widget_plugin_init' );
36
 
37
- /**
38
- Initialize the plugin. This function loads the required files needed for the plugin
39
- to run in the proper order and adds needed functions to the required hooks.
40
- */
41
  function custom_post_widget_plugin_init() {
42
-
43
- /* Load the translation of the plugin. */
44
  load_plugin_textdomain( 'custom-post-widget', false, 'custom-post-widget/languages' );
45
-
46
  add_action( 'widgets_init', 'custom_post_widget_load_widgets' );
47
  }
48
 
49
- /**
50
- Loads the widgets packaged with the plugin.
51
- */
52
  function custom_post_widget_load_widgets() {
53
  require_once( CUSTOM_POST_WIDGET_DIR . '/post-widget.php' );
54
  register_widget( 'custom_post_widget' );
55
  }
56
-
57
  ?>
3
  Plugin Name: Custom Post Widget
4
  Plugin URI: http://www.vanderwijk.com/services/web-design/wordpress-custom-post-widget/
5
  Description: Show the content of a custom post of the type 'content_block' in a widget.
6
+ Version: 1.9.2
7
  Author: Johan van der Wijk
8
  Author URI: http://www.vanderwijk.com
9
  License: GPL2
10
 
11
+ Release notes: Version 1.9.2 Added Polish translation.
 
12
 
13
+ Copyright 2012 Johan van der Wijk (email: info@vanderwijk.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ // Set constant path to the custom-post-widget plugin directory.
30
  define( 'CUSTOM_POST_WIDGET_DIR', plugin_dir_path( __FILE__ ) );
31
  define( 'CUSTOM_POST_WIDGET_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)) );
32
 
33
+ // Launch the plugin.
34
  add_action( 'plugins_loaded', 'custom_post_widget_plugin_init' );
35
 
36
+ // Load the required files needed for the plugin to run in the proper order and add needed functions to the required hooks.
 
 
 
37
  function custom_post_widget_plugin_init() {
38
+ // Load the translation of the plugin.
 
39
  load_plugin_textdomain( 'custom-post-widget', false, 'custom-post-widget/languages' );
 
40
  add_action( 'widgets_init', 'custom_post_widget_load_widgets' );
41
  }
42
 
43
+ // Loads the widgets packaged with the plugin.
 
 
44
  function custom_post_widget_load_widgets() {
45
  require_once( CUSTOM_POST_WIDGET_DIR . '/post-widget.php' );
46
  register_widget( 'custom_post_widget' );
47
  }
 
48
  ?>
languages/custom-post-widget-de_DE.mo CHANGED
Binary file
languages/custom-post-widget-de_DE.po CHANGED
@@ -19,202 +19,153 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: post-widget.php:6
23
  #@ custom-post-widget
24
  msgid "Displays custom post content in a widget"
25
  msgstr "Zeigt benutzerdefinierte Inhalte in einem Widget an"
26
 
27
- #: post-widget.php:7
28
  #@ custom-post-widget
29
  msgid "Content Block"
30
  msgstr "Inhaltsblock"
31
 
32
- #: post-widget.php:15
33
  #@ custom-post-widget
34
  msgid "Content Block to Display:"
35
  msgstr "Anzuzeigender Inhaltsblock"
36
 
37
- #: popup.php:43
38
- #: post-widget.php:27
39
  #@ custom-post-widget
40
  msgid "No content blocks available"
41
  msgstr "Keine Inhaltsblöcke verfügbar"
42
 
43
- #: post-widget.php:45
44
  #@ custom-post-widget
45
  msgid "Show Post Title"
46
  msgstr "Beitragstitel anzeigen"
47
 
48
- #: post-widget.php:58
49
  #@ custom-post-widget
50
  msgid "Find"
51
  msgstr "Finden"
52
 
53
- #: post-widget.php:79
54
  #@ custom-post-widget
55
  msgctxt "post type general name"
56
  msgid "Content Blocks"
57
  msgstr "Inhaltsblöcke"
58
 
59
- #: post-widget.php:80
60
  #@ custom-post-widget
61
  msgctxt "post type singular name"
62
  msgid "Content Block"
63
  msgstr "Inhaltsblock"
64
 
65
- #: post-widget.php:82
66
  #@ custom-post-widget
67
  msgctxt "block"
68
  msgid "Add Content Block"
69
  msgstr "Inhaltsblock erstellen"
70
 
71
- #: post-widget.php:83
72
  #@ custom-post-widget
73
  msgid "Add New Content Block"
74
  msgstr "Neuen Inhaltsblock erstellen"
75
 
76
- #: post-widget.php:84
77
  #@ custom-post-widget
78
  msgid "Edit Content Block"
79
  msgstr "Inhaltsblock bearbeiten"
80
 
81
- #: post-widget.php:85
82
  #@ custom-post-widget
83
  msgid "New Content Block"
84
  msgstr "Neuer Inhaltsblock"
85
 
86
- #: post-widget.php:86
87
  #@ custom-post-widget
88
  msgid "View Content Block"
89
  msgstr "Inhaltsblock ansehen"
90
 
91
- #: post-widget.php:87
92
  #@ custom-post-widget
93
  msgid "Search Content Blocks"
94
  msgstr "Inhaltsblöcke durchsuchen"
95
 
96
- #: post-widget.php:88
97
  #@ custom-post-widget
98
  msgid "No Content Blocks Found"
99
  msgstr "Keine Inhaltsblöcke gefunden"
100
 
101
- #: post-widget.php:89
102
  #@ custom-post-widget
103
  msgid "No Content Blocks found in Trash"
104
  msgstr "Keine Inhaltsblöcke im Papierkorb gefunden"
105
 
106
- #: post-widget.php:132
 
 
 
 
 
 
107
  #@ custom-post-widget
108
  msgid "Custom field updated."
109
  msgstr "Benutzerdefiniertes Feld aktualisiert."
110
 
111
- #: post-widget.php:133
112
  #@ custom-post-widget
113
  msgid "Custom field deleted."
114
  msgstr "Benutzerdefiniertes Feld gelöscht."
115
 
116
- #: post-widget.php:131
117
- #: post-widget.php:134
118
  #@ custom-post-widget
119
  msgid "Content Block updated."
120
  msgstr "Inhaltsblock aktualisiert."
121
 
122
- #: post-widget.php:135
123
  #, php-format
124
  #@ custom-post-widget
125
  msgid "Content Block restored to revision from %s"
126
  msgstr "Inhaltsblock wiederhergestellt als Revision vom %s"
127
 
128
- #: post-widget.php:137
129
- #@ custom-post-widget
130
- msgid "Block saved."
131
- msgstr "Inhaltsblock gespeichert."
132
-
133
- #: post-widget.php:139
134
- #@ custom-post-widget
135
- msgid "M j, Y @ G:i"
136
- msgstr "j. M Y @ H:M"
137
-
138
- #: post-widget.php:81
139
- #@ custom-post-widget
140
- msgctxt "post type plural name"
141
- msgid "Content Blocks"
142
- msgstr "Inhaltsblöcke"
143
-
144
- #: popup.php:9
145
- #@ custom-post-widget
146
- msgid "Please select a Content Block"
147
- msgstr "Bitte Inhaltsblock auswählen"
148
-
149
- #: popup.php:22
150
- #: popup.php:48
151
- #@ custom-post-widget
152
- msgid "Insert Content Block"
153
- msgstr "Inhaltsblock einfügen"
154
-
155
- #: popup.php:25
156
- #@ custom-post-widget
157
- msgid "Select a Content Block below to add it to your post or page."
158
- msgstr "Inhaltsblock auswählen und diesen zum Beitrag hinzufügen"
159
-
160
- #: popup.php:31
161
- #@ custom-post-widget
162
- msgid "Select a Content Block"
163
- msgstr "Inhaltsblock auswählen"
164
-
165
- #: popup.php:50
166
- #@ custom-post-widget
167
- msgid "Cancel"
168
- msgstr "Abbrechen"
169
-
170
- #: post-widget.php:131
171
  #, php-format
172
  #@ custom-post-widget
173
- msgid "Content Block updated. <a href=\"%s\">Manage Widgets</a>"
174
- msgstr "Inhaltsblock aktualisiert. <a href=\"%s\">Widgets bearbeiten</a>"
175
 
176
- #: post-widget.php:136
177
- #, php-format
178
  #@ custom-post-widget
179
- msgid "Content Block published. <a href=\"%s\">Manage Widgets</a>"
180
- msgstr "Inhaltsblock publiziert. <a href=\"%s\">Widgets bearbeiten</a>"
181
 
182
  #: post-widget.php:136
 
183
  #@ custom-post-widget
184
- msgid "Content Block published."
185
- msgstr "Inhaltsblock publiziert."
186
 
187
- #: post-widget.php:138
188
  #, php-format
189
  #@ custom-post-widget
190
- msgid "Content Block submitted. <a href=\"%s\">Manage Widgets</a>"
191
- msgstr "Inhaltsblock gespeichert. <a href=\"%s\">Widgets bearbeiten</a>"
192
 
193
  #: post-widget.php:138
194
  #@ custom-post-widget
195
- msgid "Content Block submitted."
196
- msgstr "Inhaltsblock gespeichert."
197
 
198
  #: post-widget.php:139
199
  #, php-format
200
  #@ custom-post-widget
201
- msgid "Content Block scheduled for: <strong>%1$s</strong>."
202
- msgstr "Inhaltsblock terminiert für: <strong>%1$s</strong>."
203
-
204
- #: post-widget.php:140
205
- #, php-format
206
- #@ custom-post-widget
207
- msgid "Content Block draft updated. <a href=\"%s\">Manage Widgets</a>"
208
- msgstr "Inhaltsblock-Entwurf aktualisiert. <a href=\"%s\">Widgets bearbeiten</a>"
209
-
210
- #: post-widget.php:140
211
- #@ custom-post-widget
212
- msgid "Content Block draft updated."
213
- msgstr "Inhaltsblock-Entwurf aktualisiert."
214
 
215
- #: post-widget.php:175
216
- #: post-widget.php:176
217
  #@ custom-post-widget
218
- msgid "Add Content Block"
219
- msgstr "Inhaltsblock hinzufügen"
 
220
 
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
+ #: post-widget.php:8
23
  #@ custom-post-widget
24
  msgid "Displays custom post content in a widget"
25
  msgstr "Zeigt benutzerdefinierte Inhalte in einem Widget an"
26
 
27
+ #: post-widget.php:9
28
  #@ custom-post-widget
29
  msgid "Content Block"
30
  msgstr "Inhaltsblock"
31
 
32
+ #: post-widget.php:19
33
  #@ custom-post-widget
34
  msgid "Content Block to Display:"
35
  msgstr "Anzuzeigender Inhaltsblock"
36
 
37
+ #: post-widget.php:31
 
38
  #@ custom-post-widget
39
  msgid "No content blocks available"
40
  msgstr "Keine Inhaltsblöcke verfügbar"
41
 
42
+ #: post-widget.php:43
43
  #@ custom-post-widget
44
  msgid "Show Post Title"
45
  msgstr "Beitragstitel anzeigen"
46
 
47
+ #: post-widget.php:62
48
  #@ custom-post-widget
49
  msgid "Find"
50
  msgstr "Finden"
51
 
52
+ #: post-widget.php:94
53
  #@ custom-post-widget
54
  msgctxt "post type general name"
55
  msgid "Content Blocks"
56
  msgstr "Inhaltsblöcke"
57
 
58
+ #: post-widget.php:95
59
  #@ custom-post-widget
60
  msgctxt "post type singular name"
61
  msgid "Content Block"
62
  msgstr "Inhaltsblock"
63
 
64
+ #: post-widget.php:97
65
  #@ custom-post-widget
66
  msgctxt "block"
67
  msgid "Add Content Block"
68
  msgstr "Inhaltsblock erstellen"
69
 
70
+ #: post-widget.php:98
71
  #@ custom-post-widget
72
  msgid "Add New Content Block"
73
  msgstr "Neuen Inhaltsblock erstellen"
74
 
75
+ #: post-widget.php:99
76
  #@ custom-post-widget
77
  msgid "Edit Content Block"
78
  msgstr "Inhaltsblock bearbeiten"
79
 
80
+ #: post-widget.php:100
81
  #@ custom-post-widget
82
  msgid "New Content Block"
83
  msgstr "Neuer Inhaltsblock"
84
 
85
+ #: post-widget.php:101
86
  #@ custom-post-widget
87
  msgid "View Content Block"
88
  msgstr "Inhaltsblock ansehen"
89
 
90
+ #: post-widget.php:102
91
  #@ custom-post-widget
92
  msgid "Search Content Blocks"
93
  msgstr "Inhaltsblöcke durchsuchen"
94
 
95
+ #: post-widget.php:103
96
  #@ custom-post-widget
97
  msgid "No Content Blocks Found"
98
  msgstr "Keine Inhaltsblöcke gefunden"
99
 
100
+ #: post-widget.php:104
101
  #@ custom-post-widget
102
  msgid "No Content Blocks found in Trash"
103
  msgstr "Keine Inhaltsblöcke im Papierkorb gefunden"
104
 
105
+ #: post-widget.php:129
106
+ #, php-format
107
+ #@ custom-post-widget
108
+ msgid "Content Block updated. <a href=\"%s\">View Content Block</a>"
109
+ msgstr "Inhaltsblock aktualisiert. <a href=\"%s\">Ansehen</a>"
110
+
111
+ #: post-widget.php:130
112
  #@ custom-post-widget
113
  msgid "Custom field updated."
114
  msgstr "Benutzerdefiniertes Feld aktualisiert."
115
 
116
+ #: post-widget.php:131
117
  #@ custom-post-widget
118
  msgid "Custom field deleted."
119
  msgstr "Benutzerdefiniertes Feld gelöscht."
120
 
121
+ #: post-widget.php:132
 
122
  #@ custom-post-widget
123
  msgid "Content Block updated."
124
  msgstr "Inhaltsblock aktualisiert."
125
 
126
+ #: post-widget.php:133
127
  #, php-format
128
  #@ custom-post-widget
129
  msgid "Content Block restored to revision from %s"
130
  msgstr "Inhaltsblock wiederhergestellt als Revision vom %s"
131
 
132
+ #: post-widget.php:134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  #, php-format
134
  #@ custom-post-widget
135
+ msgid "Content Block published. <a href=\"%s\">View Content Block</a>"
136
+ msgstr "Inhaltsblock publiziert. <a href=\"%s\">Ansehen</a>"
137
 
138
+ #: post-widget.php:135
 
139
  #@ custom-post-widget
140
+ msgid "Block saved."
141
+ msgstr "Inhaltsblock gespeichert."
142
 
143
  #: post-widget.php:136
144
+ #, php-format
145
  #@ custom-post-widget
146
+ msgid "Content Block submitted. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
147
+ msgstr "Inhaltsblock gesendet. <a target=\"_blank\" href=\"%s\">Vorschau anzeigen</a>"
148
 
149
+ #: post-widget.php:137
150
  #, php-format
151
  #@ custom-post-widget
152
+ msgid "Content Block scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview block</a>"
153
+ msgstr "Inhaltsblock terminiert zum: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Vorschau ansehen</a>"
154
 
155
  #: post-widget.php:138
156
  #@ custom-post-widget
157
+ msgid "M j, Y @ G:i"
158
+ msgstr "j. M Y @ H:M"
159
 
160
  #: post-widget.php:139
161
  #, php-format
162
  #@ custom-post-widget
163
+ msgid "Content Block draft updated. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
164
+ msgstr "Entwurf aktualisiert. <a target=\"_blank\" href=\"%s\">Vorschau ansehen</a>"
 
 
 
 
 
 
 
 
 
 
 
165
 
166
+ #: post-widget.php:96
 
167
  #@ custom-post-widget
168
+ msgctxt "post type plural name"
169
+ msgid "Content Blocks"
170
+ msgstr "Inhaltsblöcke"
171
 
languages/custom-post-widget-nl_NL.mo CHANGED
Binary file
languages/custom-post-widget-nl_NL.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: Johan van der Wijk <johan@vanderwijk.com>\n"
8
  "Language-Team: Johan van der Wijk <info@vanderwijk.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -21,22 +21,22 @@ msgstr ""
21
  #@ custom-post-widget
22
  #: post-widget.php:8
23
  msgid "Displays custom post content in a widget"
24
- msgstr "Toont een tekstblok in een widget"
25
 
26
  #@ custom-post-widget
27
  #: post-widget.php:9
28
  msgid "Content Block"
29
- msgstr "Tekstblok"
30
 
31
  #@ custom-post-widget
32
  #: post-widget.php:19
33
  msgid "Content Block to Display:"
34
- msgstr "Weer te geven tekstblok:"
35
 
36
  #@ custom-post-widget
37
  #: post-widget.php:31
38
  msgid "No content blocks available"
39
- msgstr "Geen tekstblokken beschikbaar"
40
 
41
  #@ custom-post-widget
42
  #: post-widget.php:43
@@ -52,60 +52,60 @@ msgstr "Zoeken"
52
  #: post-widget.php:94
53
  msgctxt "post type general name"
54
  msgid "Content Blocks"
55
- msgstr "Tekstblokken"
56
 
57
  #@ custom-post-widget
58
  #: post-widget.php:95
59
  msgctxt "post type singular name"
60
  msgid "Content Block"
61
- msgstr "Tekstblok"
62
 
63
  #@ custom-post-widget
64
  #: post-widget.php:97
65
  msgctxt "block"
66
  msgid "Add Content Block"
67
- msgstr "Nieuw Tekstblok"
68
 
69
  #@ custom-post-widget
70
  #: post-widget.php:98
71
  msgid "Add New Content Block"
72
- msgstr "Nieuw tekstblok toevoegen"
73
 
74
  #@ custom-post-widget
75
  #: post-widget.php:99
76
  msgid "Edit Content Block"
77
- msgstr "Tekstblok Bewerken"
78
 
79
  #@ custom-post-widget
80
  #: post-widget.php:100
81
  msgid "New Content Block"
82
- msgstr "Nieuw Tekstblok"
83
 
84
  #@ custom-post-widget
85
  #: post-widget.php:101
86
  msgid "View Content Block"
87
- msgstr "Tekstblok Bekijken"
88
 
89
  #@ custom-post-widget
90
  #: post-widget.php:102
91
  msgid "Search Content Blocks"
92
- msgstr "Tekstblokken zoeken"
93
 
94
  #@ custom-post-widget
95
  #: post-widget.php:103
96
  msgid "No Content Blocks Found"
97
- msgstr "Geen Tekstblokken"
98
 
99
  #@ custom-post-widget
100
  #: post-widget.php:104
101
  msgid "No Content Blocks found in Trash"
102
- msgstr "Geen Tekstblokken in de Prullenbak"
103
 
104
  #@ custom-post-widget
105
  #: post-widget.php:129
106
  #, php-format
107
  msgid "Content Block updated. <a href=\"%s\">View Content Block</a>"
108
- msgstr "Tekstblok Bijgewerkt. <a href=\"%s\">Toon Tekstblok</a>"
109
 
110
  #@ custom-post-widget
111
  #: post-widget.php:130
@@ -120,36 +120,36 @@ msgstr "Custom field verwijderd."
120
  #@ custom-post-widget
121
  #: post-widget.php:132
122
  msgid "Content Block updated."
123
- msgstr "Tekstblok bijgewerkt."
124
 
125
  #@ custom-post-widget
126
  #: post-widget.php:133
127
  #, php-format
128
  msgid "Content Block restored to revision from %s"
129
- msgstr "Tekstblok teruggezet naar revisie %s"
130
 
131
  #@ custom-post-widget
132
  #: post-widget.php:134
133
  #, php-format
134
  msgid "Content Block published. <a href=\"%s\">View Content Block</a>"
135
- msgstr "Tekstblok gepublicieerd. <a href=\"%s\">Bekijk Tekstblok</a>"
136
 
137
  #@ custom-post-widget
138
  #: post-widget.php:135
139
  msgid "Block saved."
140
- msgstr "Tekstblok Opgeslagen."
141
 
142
  #@ custom-post-widget
143
  #: post-widget.php:136
144
  #, php-format
145
  msgid "Content Block submitted. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
146
- msgstr "Tekstblok Bewaard. <a target=\"_blank\" href=\"%s\">Toon Preview</a>"
147
 
148
  #@ custom-post-widget
149
  #: post-widget.php:137
150
  #, php-format
151
  msgid "Content Block scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview block</a>"
152
- msgstr "Tekstblok zal worden gepubliceerd op: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Toon preview</a>"
153
 
154
  #@ custom-post-widget
155
  #: post-widget.php:138
@@ -160,11 +160,11 @@ msgstr "j. M Y @ H:M"
160
  #: post-widget.php:139
161
  #, php-format
162
  msgid "Content Block draft updated. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
163
- msgstr "Tekstblok draft bijgewerkt. <a target=\"_blank\" href=\"%s\">Toon preview</a>"
164
 
165
  #@ custom-post-widget
166
  #: post-widget.php:96
167
  msgctxt "post type plural name"
168
  msgid "Content Blocks"
169
- msgstr "Tekstblokken"
170
 
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: Johan van der Wijk <info@vanderwijk.com>\n"
8
  "Language-Team: Johan van der Wijk <info@vanderwijk.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
21
  #@ custom-post-widget
22
  #: post-widget.php:8
23
  msgid "Displays custom post content in a widget"
24
+ msgstr "Toont een inhoudsblok in een widget"
25
 
26
  #@ custom-post-widget
27
  #: post-widget.php:9
28
  msgid "Content Block"
29
+ msgstr "Inhoudsblok"
30
 
31
  #@ custom-post-widget
32
  #: post-widget.php:19
33
  msgid "Content Block to Display:"
34
+ msgstr "Weer te geven inhoudsblok:"
35
 
36
  #@ custom-post-widget
37
  #: post-widget.php:31
38
  msgid "No content blocks available"
39
+ msgstr "Geen inhoudsblokken beschikbaar"
40
 
41
  #@ custom-post-widget
42
  #: post-widget.php:43
52
  #: post-widget.php:94
53
  msgctxt "post type general name"
54
  msgid "Content Blocks"
55
+ msgstr "Inhoudsblokken"
56
 
57
  #@ custom-post-widget
58
  #: post-widget.php:95
59
  msgctxt "post type singular name"
60
  msgid "Content Block"
61
+ msgstr "Inhoudsblok"
62
 
63
  #@ custom-post-widget
64
  #: post-widget.php:97
65
  msgctxt "block"
66
  msgid "Add Content Block"
67
+ msgstr "Nieuw Inhoudsblok"
68
 
69
  #@ custom-post-widget
70
  #: post-widget.php:98
71
  msgid "Add New Content Block"
72
+ msgstr "Nieuw inhoudsblok toevoegen"
73
 
74
  #@ custom-post-widget
75
  #: post-widget.php:99
76
  msgid "Edit Content Block"
77
+ msgstr "Inhoudsblok Bewerken"
78
 
79
  #@ custom-post-widget
80
  #: post-widget.php:100
81
  msgid "New Content Block"
82
+ msgstr "Nieuw Inhoudsblok"
83
 
84
  #@ custom-post-widget
85
  #: post-widget.php:101
86
  msgid "View Content Block"
87
+ msgstr "Inhoudsblok Bekijken"
88
 
89
  #@ custom-post-widget
90
  #: post-widget.php:102
91
  msgid "Search Content Blocks"
92
+ msgstr "Inhoudsblokken zoeken"
93
 
94
  #@ custom-post-widget
95
  #: post-widget.php:103
96
  msgid "No Content Blocks Found"
97
+ msgstr "Geen Inhoudsblokken"
98
 
99
  #@ custom-post-widget
100
  #: post-widget.php:104
101
  msgid "No Content Blocks found in Trash"
102
+ msgstr "Geen Inhoudsblokken in de Prullenbak"
103
 
104
  #@ custom-post-widget
105
  #: post-widget.php:129
106
  #, php-format
107
  msgid "Content Block updated. <a href=\"%s\">View Content Block</a>"
108
+ msgstr "Inhoudsblok Bijgewerkt. <a href=\"%s\">Toon Inhoudsblok</a>"
109
 
110
  #@ custom-post-widget
111
  #: post-widget.php:130
120
  #@ custom-post-widget
121
  #: post-widget.php:132
122
  msgid "Content Block updated."
123
+ msgstr "Inhoudsblok bijgewerkt."
124
 
125
  #@ custom-post-widget
126
  #: post-widget.php:133
127
  #, php-format
128
  msgid "Content Block restored to revision from %s"
129
+ msgstr "Inhoudsblok teruggezet naar revisie %s"
130
 
131
  #@ custom-post-widget
132
  #: post-widget.php:134
133
  #, php-format
134
  msgid "Content Block published. <a href=\"%s\">View Content Block</a>"
135
+ msgstr "Inhoudsblok gepublicieerd. <a href=\"%s\">Bekijk Inhoudsblok</a>"
136
 
137
  #@ custom-post-widget
138
  #: post-widget.php:135
139
  msgid "Block saved."
140
+ msgstr "Inhoudsblok Opgeslagen."
141
 
142
  #@ custom-post-widget
143
  #: post-widget.php:136
144
  #, php-format
145
  msgid "Content Block submitted. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
146
+ msgstr "Inhoudsblok Bewaard. <a target=\"_blank\" href=\"%s\">Toon Preview</a>"
147
 
148
  #@ custom-post-widget
149
  #: post-widget.php:137
150
  #, php-format
151
  msgid "Content Block scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview block</a>"
152
+ msgstr "Inhoudsblok zal worden gepubliceerd op: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Toon preview</a>"
153
 
154
  #@ custom-post-widget
155
  #: post-widget.php:138
160
  #: post-widget.php:139
161
  #, php-format
162
  msgid "Content Block draft updated. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
163
+ msgstr "Inhoudsblok draft bijgewerkt. <a target=\"_blank\" href=\"%s\">Toon preview</a>"
164
 
165
  #@ custom-post-widget
166
  #: post-widget.php:96
167
  msgctxt "post type plural name"
168
  msgid "Content Blocks"
169
+ msgstr "Inhoudsblokken"
170
 
languages/custom-post-widget-pl_PL.mo ADDED
Binary file
languages/custom-post-widget-pl_PL.po ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Kuba Es <poedit@webnova.pl>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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"
15
+ "X-Textdomain-Support: yes\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #@ custom-post-widget
19
+ #: post-widget.php:8
20
+ msgid "Displays custom post content in a widget"
21
+ msgstr "Wyświetla zawartość w widgecie"
22
+
23
+ #@ custom-post-widget
24
+ #: post-widget.php:9
25
+ msgid "Content Block"
26
+ msgstr "Blok Treści"
27
+
28
+ #@ custom-post-widget
29
+ #: post-widget.php:19
30
+ msgid "Content Block to Display:"
31
+ msgstr "Blok Treści do wyświetlenia"
32
+
33
+ #@ custom-post-widget
34
+ #: post-widget.php:31
35
+ msgid "No content blocks available"
36
+ msgstr "Nie utworzono Bloków Treści"
37
+
38
+ #@ custom-post-widget
39
+ #: post-widget.php:43
40
+ msgid "Show Post Title"
41
+ msgstr "Pokaż tytuł postu"
42
+
43
+ #@ custom-post-widget
44
+ #: post-widget.php:62
45
+ msgid "Find"
46
+ msgstr "Znajdź"
47
+
48
+ #@ custom-post-widget
49
+ #: post-widget.php:94
50
+ msgctxt "post type general name"
51
+ msgid "Content Blocks"
52
+ msgstr "Bloki Treści"
53
+
54
+ #@ custom-post-widget
55
+ #: post-widget.php:95
56
+ msgctxt "post type singular name"
57
+ msgid "Content Block"
58
+ msgstr "Blok Treści"
59
+
60
+ #@ custom-post-widget
61
+ #: post-widget.php:97
62
+ msgctxt "block"
63
+ msgid "Add Content Block"
64
+ msgstr "Dodaj Blok Treści"
65
+
66
+ #@ custom-post-widget
67
+ #: post-widget.php:98
68
+ msgid "Add New Content Block"
69
+ msgstr "Nowy Blok Treści"
70
+
71
+ #@ custom-post-widget
72
+ #: post-widget.php:99
73
+ msgid "Edit Content Block"
74
+ msgstr "Edytuj Blok Treści"
75
+
76
+ #@ custom-post-widget
77
+ #: post-widget.php:100
78
+ msgid "New Content Block"
79
+ msgstr "Nowy Blok Treści"
80
+
81
+ #@ custom-post-widget
82
+ #: post-widget.php:101
83
+ msgid "View Content Block"
84
+ msgstr "Zobacz Blok Treści"
85
+
86
+ #@ custom-post-widget
87
+ #: post-widget.php:102
88
+ msgid "Search Content Blocks"
89
+ msgstr "Szukaj Bloków Treśc"
90
+
91
+ #@ custom-post-widget
92
+ #: post-widget.php:103
93
+ msgid "No Content Blocks Found"
94
+ msgstr "Nie znaleziono Bloków Treści"
95
+
96
+ #@ custom-post-widget
97
+ #: post-widget.php:104
98
+ msgid "No Content Blocks found in Trash"
99
+ msgstr "Nie znaleziono Bloków Treści w archiwum"
100
+
101
+ #@ custom-post-widget
102
+ #: post-widget.php:129
103
+ #, php-format
104
+ msgid "Content Block updated. <a href=\"%s\">View Content Block</a>"
105
+ msgstr "Blok Treści został zapisany. <a href=\"%s\">Zobacz</a>"
106
+
107
+ #@ custom-post-widget
108
+ #: post-widget.php:130
109
+ msgid "Custom field updated."
110
+ msgstr "Własne pola zostały zaktualizowane."
111
+
112
+ #@ custom-post-widget
113
+ #: post-widget.php:131
114
+ msgid "Custom field deleted."
115
+ msgstr "Własne pola zostały usunięte."
116
+
117
+ #@ custom-post-widget
118
+ #: post-widget.php:132
119
+ msgid "Content Block updated."
120
+ msgstr "Blok Treści zaktualizowany."
121
+
122
+ #@ custom-post-widget
123
+ #: post-widget.php:133
124
+ #, php-format
125
+ msgid "Content Block restored to revision from %s"
126
+ msgstr "Przywrócono Blok Treści do rewizji z %s"
127
+
128
+ #@ custom-post-widget
129
+ #: post-widget.php:134
130
+ #, php-format
131
+ msgid "Content Block published. <a href=\"%s\">View Content Block</a>"
132
+ msgstr "Blok Treści został opublikowany. <a href=\"%s\">Zobacz</a>"
133
+
134
+ #@ custom-post-widget
135
+ #: post-widget.php:135
136
+ msgid "Block saved."
137
+ msgstr "Blok zapisany."
138
+
139
+ #@ custom-post-widget
140
+ #: post-widget.php:136
141
+ #, php-format
142
+ msgid "Content Block submitted. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
143
+ msgstr "Blok Treści przesłany. <a target=\"_blank\" href=\"%s\">Podgląd Bloku</a>"
144
+
145
+ #@ custom-post-widget
146
+ #: post-widget.php:137
147
+ #, php-format
148
+ msgid "Content Block scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview block</a>"
149
+ msgstr "Blok Treści zaplanowany na: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Podgląd Bloku</a>"
150
+
151
+ #@ custom-post-widget
152
+ #: post-widget.php:138
153
+ msgid "M j, Y @ G:i"
154
+ msgstr "j. M Y @ H:M"
155
+
156
+ #@ custom-post-widget
157
+ #: post-widget.php:139
158
+ #, php-format
159
+ msgid "Content Block draft updated. <a target=\"_blank\" href=\"%s\">Preview Content Block</a>"
160
+ msgstr "Szkic zapisany. <a target=\"_blank\" href=\"%s\">Podgląd Bloku</a>"
161
+
162
+ #@ custom-post-widget
163
+ #: post-widget.php:96
164
+ msgctxt "post type plural name"
165
+ msgid "Content Blocks"
166
+ msgstr "Bloki Treści"
167
+
popup.php CHANGED
@@ -1,51 +1,57 @@
1
- <?php
2
- //Action target that displays the popup to insert a content block to a post/page
3
- function add_mce_popup(){ ?>
4
 
5
- <script>
6
- function InsertContentBlockForm(){
7
- var content_id = jQuery("#add_content_block_id").val();
8
- if(content_id == ""){
9
- alert("<?php _e("Please select a Content Block", 'custom-post-widget') ?>");
10
- return;
11
- }
12
 
13
- var win = window.dialogArguments || opener || parent || top;
14
- win.send_to_editor("[content_block id=" + content_id + "]");
15
- }
16
- </script>
 
 
 
 
 
 
 
17
 
18
- <div id="select_form" style="display:none;">
19
  <div class="wrap">
20
  <div>
21
  <div style="padding:15px 15px 0 15px;">
22
- <h3 style="color:#5A5A5A!important; font-family:Georgia,Times New Roman,Times,serif!important; font-size:1.8em!important; font-weight:normal!important;"><?php _e("Insert Content Block", 'custom-post-widget'); ?></h3>
23
- <span><?php _e("Select a Content Block below to add it to your post or page.", 'custom-post-widget'); ?></span>
 
 
 
 
24
  </div>
25
  <div style="padding:15px 15px 0 15px;">
26
  <select id="add_content_block_id">
27
- <option value=""><?php _e("Select a Content Block", 'custom-post-widget'); ?></option>
 
 
28
  <?php query_posts('post_type=content_block&orderby=ID&order=ASC&showposts=-1');
29
- if ( have_posts() ) : while ( have_posts() ) : the_post();
30
- $currentID = get_the_ID();
31
- if($currentID == $custom_post_id)
32
- $extra = 'selected' and
33
- $widgetExtraTitle = get_the_title();
34
- else
35
- $extra = '';
36
- echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
37
- endwhile; else:
38
- echo '<option value="empty">' . __('No content blocks available', 'custom-post-widget') . '</option>';
39
- endif;
40
- ?>
41
- </select>
42
- <br/>
43
  <div style="padding:15px;">
44
- <input type="button" class="button-primary" value="Insert Content Block" onclick="InsertContentBlockForm();"/>&nbsp;&nbsp;&nbsp;
45
- <a class="button" style="color:#bbb;" href="#" onclick="tb_remove(); return false;"><?php _e("Cancel", 'custom-post-widget'); ?></a>
 
 
46
  </div>
47
  </div>
48
  </div>
49
  </div>
50
- <?php
51
- }
1
+ <?php // Action target that displays the popup to insert a content block to a post/page
 
 
2
 
3
+ function add_content_block_popup(){ ?>
 
 
 
 
 
 
4
 
5
+ <script>
6
+ function InsertContentBlockForm(){
7
+ var content_id = jQuery("#add_content_block_id").val();
8
+ if(content_id == ""){
9
+ alert("<?php _e("Please select a Content Block", 'custom-post-widget') ?>");
10
+ return;
11
+ }
12
+ var win = window.dialogArguments || opener || parent || top;
13
+ win.send_to_editor("[content_block id=" + content_id + "]");
14
+ }
15
+ </script>
16
 
17
+ <div id="content_block_form" style="display:none;">
18
  <div class="wrap">
19
  <div>
20
  <div style="padding:15px 15px 0 15px;">
21
+ <h3 style="color:#5A5A5A!important; font-family:Georgia,Times New Roman,Times,serif!important; font-size:1.8em!important; font-weight:normal!important;">
22
+ <?php _e("Insert Content Block", 'custom-post-widget'); ?>
23
+ </h3>
24
+ <span>
25
+ <?php _e("Select a Content Block below to add it to your post or page.", 'custom-post-widget'); ?>
26
+ </span>
27
  </div>
28
  <div style="padding:15px 15px 0 15px;">
29
  <select id="add_content_block_id">
30
+ <option value="">
31
+ <?php _e("Select a Content Block", 'custom-post-widget'); ?>
32
+ </option>
33
  <?php query_posts('post_type=content_block&orderby=ID&order=ASC&showposts=-1');
34
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
35
+ $currentID = get_the_ID();
36
+ if($currentID == $custom_post_id)
37
+ $extra = 'selected' and
38
+ $widgetExtraTitle = get_the_title();
39
+ else
40
+ $extra = '';
41
+ echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
42
+ endwhile; else:
43
+ echo '<option value="empty">' . __('No content blocks available', 'custom-post-widget') . '</option>';
44
+ endif; ?>
45
+ </select>
46
+ <br />
 
47
  <div style="padding:15px;">
48
+ <input type="button" class="button-primary" value="<?php _e("Insert Content Block", 'custom-post-widget') ?>" onclick="InsertContentBlockForm();"/>
49
+ &nbsp;&nbsp;&nbsp; <a class="button" style="color:#bbb;" href="#" onclick="tb_remove(); return false;">
50
+ <?php _e("Cancel", 'custom-post-widget'); ?>
51
+ </a>
52
  </div>
53
  </div>
54
  </div>
55
  </div>
56
+ </div>
57
+ <?php } ?>
post-widget.php CHANGED
@@ -1,201 +1,194 @@
1
- <?php
2
-
3
- // First create the widget for the admin panel
4
- class custom_post_widget extends WP_Widget
5
- {
6
- function custom_post_widget()
7
- {
8
- $widget_ops = array('description' => __('Displays custom post content in a widget', 'custom-post-widget'));
9
- $this->WP_Widget('custom_post_widget', __('Content Block', 'custom-post-widget'), $widget_ops);
10
- }
11
-
12
- function form($instance)
13
- {
14
- $custom_post_id = esc_attr($instance['custom_post_id']);
15
- $show_custom_post_title = isset($instance['show_custom_post_title ']) ? $instance['show_custom_post_title '] : true;
16
-
17
- ?>
18
- <p>
19
- <label for="<?php echo $this->get_field_id('custom_post_id'); ?>"> <?php echo __('Content Block to Display:', 'custom-post-widget') ?>
20
- <select class="widefat" id="<?php echo $this->get_field_id('custom_post_id'); ?>" name="<?php echo $this->get_field_name('custom_post_id'); ?>">
21
- <?php query_posts('post_type=content_block&orderby=ID&order=ASC&showposts=-1');
22
- if ( have_posts() ) : while ( have_posts() ) : the_post();
23
- $currentID = get_the_ID();
24
- if($currentID == $custom_post_id)
25
- $extra = 'selected' and
26
- $widgetExtraTitle = get_the_title();
27
- else
28
- $extra = '';
29
- echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
30
- endwhile; else:
31
- echo '<option value="empty">' . __('No content blocks available', 'custom-post-widget') . '</option>';
32
- endif;
33
- ?>
34
- </select>
35
- </label>
36
- </p>
37
- <?php ?>
38
- <input type="hidden" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $widgetExtraTitle; ?>" />
39
- <?php wp_reset_query(); ?>
40
- <p>
41
- <input class="checkbox" type="checkbox" <?php checked( (bool) $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' ); ?>" />
42
- <label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __('Show Post Title', 'custom-post-widget') ?></label>
43
- </p>
44
-
45
- <?php
46
- }
47
-
48
- function update($new_instance, $old_instance)
49
- {
50
- $instance = $old_instance;
51
- $instance['custom_post_id'] = strip_tags($new_instance['custom_post_id']);
52
- $instance['show_custom_post_title'] = $new_instance['show_custom_post_title'];
53
-
54
- return $instance;
55
- }
56
-
57
- function widget($args, $instance)
58
- {
59
- extract($args);
60
-
61
- $custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __('Find', 'custom-post-widget');
62
-
63
- /* Variables from the widget settings. */
64
- $show_custom_post_title = isset( $instance['show_custom_post_title'] ) ? $instance['show_custom_post_title'] : false;
65
-
66
- $content_post = get_post($custom_post_id);
67
- $content = $content_post->post_content;
68
- $content = apply_filters('the_content', $content);
69
- $content = str_replace(']]>', ']]>', $content);
70
-
71
- echo $before_widget;
72
- if ( $show_custom_post_title )
73
- {
74
- echo $before_title . $content_post->post_title . $after_title; // This is the line that displays the title (only if show title is set)
75
- }
76
- echo $content; // This is where the actual content of the custom post is being displayed
77
- echo $after_widget;
78
-
79
- }
80
- }
81
-
82
- // Create the Content Block custom post type
83
- add_action('init', 'my_content_block_post_type_init');
84
-
85
- function my_content_block_post_type_init()
86
- {
87
- $labels = array(
88
- 'name' => _x('Content Blocks', 'post type general name', 'custom-post-widget'),
89
- 'singular_name' => _x('Content Block', 'post type singular name', 'custom-post-widget'),
90
- 'plural_name' => _x('Content Blocks', 'post type plural name', 'custom-post-widget'),
91
- 'add_new' => _x('Add Content Block', 'block', 'custom-post-widget'),
92
- 'add_new_item' => __('Add New Content Block', 'custom-post-widget'),
93
- 'edit_item' => __('Edit Content Block', 'custom-post-widget'),
94
- 'new_item' => __('New Content Block', 'custom-post-widget'),
95
- 'view_item' => __('View Content Block', 'custom-post-widget'),
96
- 'search_items' => __('Search Content Blocks', 'custom-post-widget'),
97
- 'not_found' => __('No Content Blocks Found', 'custom-post-widget'),
98
- 'not_found_in_trash' => __('No Content Blocks found in Trash', 'custom-post-widget'),
99
- 'parent_item_colon' => ''
100
- );
101
- $options = array(
102
- 'labels' => $labels,
103
- 'public' => false,
104
- 'publicly_queryable' => false,
105
- 'exclude_from_search' => true,
106
- 'show_ui' => true,
107
- 'query_var' => true,
108
- 'rewrite' => true,
109
- 'capability_type' => 'post',
110
- 'hierarchical' => false,
111
- 'menu_position' => null,
112
- 'supports' => array('title','editor','revisions','thumbnail','author')
113
- );
114
- register_post_type('content_block',$options);
115
- }
116
-
117
-
118
- // Add custom styles to admin screen and menu
119
- add_action('admin_head', 'content_block_header');
120
-
121
- function content_block_header() {
122
-
123
- global $post_type; ?>
124
-
125
- <style type="text/css"><!--
126
- <?php if (($post_type == 'content_block')) : ?>
127
- #icon-edit { background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL; ?>images/contentblock-32.png') no-repeat 0 0 !important; }
128
- <?php endif; ?>
129
- #adminmenu #menu-posts-contentblock div.wp-menu-image{background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL;?>images/contentblock.png') no-repeat center -32px;}
130
- #adminmenu #menu-posts-contentblock:hover div.wp-menu-image,#adminmenu #menu-posts-contentblock.wp-has-current-submenu div.wp-menu-image{background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL;?>images/contentblock.png') no-repeat center 0px;}
131
- --></style><?php
132
-
133
- }
134
-
135
- add_filter('post_updated_messages', 'content_block_messages');
136
-
137
- function content_block_messages( $messages ) {
138
-
139
- $messages['content_block'] = array(
140
- 0 => '',
141
- 1 => sprintf( __('Content Block updated. <a href="%s">View Content Block</a>', 'custom-post-widget'), esc_url( get_permalink(isset($post->ID) ? $post->ID : null) ) ),
142
- 2 => __('Custom field updated.', 'custom-post-widget'),
143
- 3 => __('Custom field deleted.', 'custom-post-widget'),
144
- 4 => __('Content Block updated.', 'custom-post-widget'),
145
- 5 => isset($_GET['revision']) ? sprintf( __('Content Block restored to revision from %s', 'custom-post-widget'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
146
- 6 => sprintf( __('Content Block published. <a href="%s">View Content Block</a>', 'custom-post-widget'), esc_url( get_permalink(isset($post->ID) ? $post->ID : null) ) ),
147
- 7 => __('Block saved.', 'custom-post-widget'),
148
- 8 => sprintf( __('Content Block submitted. <a target="_blank" href="%s">Preview Content Block</a>', 'custom-post-widget'), esc_url( add_query_arg( 'preview', 'true', get_permalink(isset($post->ID) ? $post->ID : null) ) ) ),
149
- 9 => sprintf( __('Content Block scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview block</a>', 'custom-post-widget'), date_i18n( __( 'M j, Y @ G:i' , 'custom-post-widget'), strtotime(isset($post->post_date) ? $post->post_date : null) ), esc_url( get_permalink(isset($post->ID) ? $post->ID : null) ) ),
150
- 10 => sprintf( __('Content Block draft updated. <a target="_blank" href="%s">Preview Content Block</a>', 'custom-post-widget'), esc_url( add_query_arg( 'preview', 'true', get_permalink(isset($post->ID) ? $post->ID : null) ) ) ),
151
- );
152
-
153
- return $messages;
154
- }
155
-
156
- // Add the ability to display the content block in a reqular post using a shortcode
157
- function custom_post_widget_shortcode($atts) {
158
- extract(shortcode_atts(array(
159
- 'id' => '',
160
- ), $atts));
161
-
162
- $content = "";
163
-
164
- if($id != "")
165
- {
166
- $args = array(
167
- 'post__in' => array($id),
168
- 'post_type' => 'content_block',
169
- );
170
-
171
- $content_post = get_posts($args);
172
-
173
- foreach( $content_post as $post ) :
174
- $content .= apply_filters('the_content', $post->post_content);
175
- endforeach;
176
- }
177
-
178
- return $content;
179
- }
180
-
181
- add_shortcode('content_block', 'custom_post_widget_shortcode');
182
-
183
- // Add button above editor
184
- function add_content_block_icon($initcontext) {
185
- return $initcontext.
186
- '<a id="add_content_block" class="thickbox" title="' . __("Add Content Block", 'custom-post-widget') . '" href="' . CUSTOM_POST_WIDGET_URL . 'popup.php#TB_inline?width=450&inlineId=select_form">
187
- <img onclick="return false;" alt="' . __("Add Content Block", 'custom-post-widget') . '" src="' . CUSTOM_POST_WIDGET_URL . 'images/contentblock-13.png">
188
- </a>';
189
- }
190
-
191
- add_filter('media_buttons_context', 'add_content_block_icon');
192
-
193
- require_once( CUSTOM_POST_WIDGET_DIR . '/popup.php' );
194
-
195
- if(!defined( 'CUSTOM_POST_WIDGET_CURRENT_PAGE' ))
196
- define( 'CUSTOM_POST_WIDGET_CURRENT_PAGE', basename($_SERVER['PHP_SELF']) );
197
-
198
- if(in_array(CUSTOM_POST_WIDGET_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
199
- add_action('admin_footer', 'add_mce_popup');
200
- }
201
  ?>
1
+ <?php
2
+
3
+ // First create the widget for the admin panel
4
+ class custom_post_widget extends WP_Widget {
5
+ function custom_post_widget() {
6
+ $widget_ops = array('description' => __('Displays custom post content in a widget', 'custom-post-widget'));
7
+ $this->WP_Widget('custom_post_widget', __('Content Block', 'custom-post-widget'), $widget_ops);
8
+ }
9
+
10
+ function form($instance) {
11
+ $custom_post_id = esc_attr($instance['custom_post_id']);
12
+ $show_custom_post_title = isset($instance['show_custom_post_title ']) ? $instance['show_custom_post_title '] : true; ?>
13
+
14
+ <p>
15
+ <label for="<?php echo $this->get_field_id('custom_post_id'); ?>"> <?php echo __('Content Block to Display:', 'custom-post-widget') ?>
16
+ <select class="widefat" id="<?php echo $this->get_field_id('custom_post_id'); ?>" name="<?php echo $this->get_field_name('custom_post_id'); ?>">
17
+ <?php query_posts('post_type=content_block&orderby=ID&order=ASC&showposts=-1');
18
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
19
+ $currentID = get_the_ID();
20
+ if($currentID == $custom_post_id)
21
+ $extra = 'selected' and
22
+ $widgetExtraTitle = get_the_title();
23
+ else
24
+ $extra = '';
25
+ echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
26
+ endwhile; else:
27
+ echo '<option value="empty">' . __('No content blocks available', 'custom-post-widget') . '</option>';
28
+ endif; ?>
29
+ </select>
30
+ </label>
31
+ </p>
32
+
33
+ <input type="hidden" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $widgetExtraTitle; ?>" />
34
+
35
+ <p>
36
+ <?php
37
+ echo '<a href="post.php?post=' . $custom_post_id . '&action=edit">Edit Content Block</a>' ;
38
+ ?>
39
+ </p>
40
+
41
+ <?php wp_reset_query(); ?>
42
+
43
+ <p>
44
+ <input class="checkbox" type="checkbox" <?php checked( (bool) $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' ); ?>" />
45
+ <label for="<?php echo $this->get_field_id( 'show_custom_post_title' ); ?>"><?php echo __('Show Post Title', 'custom-post-widget') ?></label>
46
+ </p> <?php
47
+ }
48
+
49
+ function update($new_instance, $old_instance) {
50
+ $instance = $old_instance;
51
+ $instance['custom_post_id'] = strip_tags($new_instance['custom_post_id']);
52
+ $instance['show_custom_post_title'] = $new_instance['show_custom_post_title'];
53
+ return $instance;
54
+ }
55
+
56
+ function widget($args, $instance) {
57
+ extract($args);
58
+ $custom_post_id = ( $instance['custom_post_id'] != '' ) ? esc_attr($instance['custom_post_id']) : __('Find', 'custom-post-widget');
59
+ // Add support for WPML Plugin.
60
+ if ( function_exists( 'icl_object_id' ) ){
61
+ $custom_post_id = icl_object_id( $custom_post_id, 'content_block', true );
62
+ }
63
+ // Variables from the widget settings.
64
+ $show_custom_post_title = isset( $instance['show_custom_post_title'] ) ? $instance['show_custom_post_title'] : false;
65
+ $content_post = get_post($custom_post_id);
66
+ $content = $content_post->post_content;
67
+ $content = apply_filters('the_content', $content);
68
+ echo $before_widget;
69
+ if ( $show_custom_post_title ) {
70
+ 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)
71
+ }
72
+ echo do_shortcode($content); // This is where the actual content of the custom post is being displayed
73
+ echo $after_widget;
74
+ }
75
+
76
+ }
77
+
78
+ // Create the Content Block custom post type
79
+ add_action('init', 'my_content_block_post_type_init');
80
+
81
+ function my_content_block_post_type_init() {
82
+ $labels = array(
83
+ 'name' => _x('Content Blocks', 'post type general name', 'custom-post-widget'),
84
+ 'singular_name' => _x('Content Block', 'post type singular name', 'custom-post-widget'),
85
+ 'plural_name' => _x('Content Blocks', 'post type plural name', 'custom-post-widget'),
86
+ 'add_new' => _x('Add Content Block', 'block', 'custom-post-widget'),
87
+ 'add_new_item' => __('Add New Content Block', 'custom-post-widget'),
88
+ 'edit_item' => __('Edit Content Block', 'custom-post-widget'),
89
+ 'new_item' => __('New Content Block', 'custom-post-widget'),
90
+ 'view_item' => __('View Content Block', 'custom-post-widget'),
91
+ 'search_items' => __('Search Content Blocks', 'custom-post-widget'),
92
+ 'not_found' => __('No Content Blocks Found', 'custom-post-widget'),
93
+ 'not_found_in_trash' => __('No Content Blocks found in Trash', 'custom-post-widget'),
94
+ 'parent_item_colon' => ''
95
+ );
96
+ $options = array(
97
+ 'labels' => $labels,
98
+ 'public' => false,
99
+ 'publicly_queryable' => false,
100
+ 'exclude_from_search' => true,
101
+ 'show_ui' => true,
102
+ 'query_var' => true,
103
+ 'rewrite' => true,
104
+ 'capability_type' => 'post',
105
+ 'hierarchical' => false,
106
+ 'menu_position' => null,
107
+ 'supports' => array('title','editor','revisions','thumbnail','author')
108
+ );
109
+ register_post_type('content_block',$options);
110
+ }
111
+
112
+ // Add custom styles to admin screen and menu
113
+ add_action('admin_head', 'content_block_header');
114
+
115
+ function content_block_header() {
116
+ global $post_type; ?>
117
+ <style type="text/css">
118
+ <!--
119
+ <?php if (($post_type == 'content_block')) : ?>
120
+ #icon-edit { background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL; ?>images/contentblock-32.png') no-repeat 0 0 !important;}
121
+ #minor-publishing-actions { display:none; /* Hide the Save Draft and Preview buttons */}
122
+ <?php endif; ?>
123
+ #adminmenu #menu-posts-content_block div.wp-menu-image{background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL;?>images/contentblock.png') no-repeat center -32px;}
124
+ #adminmenu #menu-posts-content_block:hover div.wp-menu-image,#adminmenu #menu-posts-content_block.wp-has-current-submenu div.wp-menu-image{background:transparent url('<?php echo CUSTOM_POST_WIDGET_URL;?>images/contentblock.png') no-repeat center 0px;}
125
+ -->
126
+ </style>
127
+ <?php
128
+ }
129
+
130
+ add_filter('post_updated_messages', 'content_block_messages');
131
+
132
+ function content_block_messages( $messages ) {
133
+ $messages['content_block'] = array(
134
+ 0 => '',
135
+ 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' ) ),
136
+ 2 => __('Custom field updated.', 'custom-post-widget'),
137
+ 3 => __('Custom field deleted.', 'custom-post-widget'),
138
+ 4 => __('Content Block updated.', 'custom-post-widget'),
139
+ 5 => isset($_GET['revision']) ? sprintf( __('Content Block restored to revision from %s', 'custom-post-widget'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
140
+ 6 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block published. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block published.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
141
+ 7 => __('Block saved.', 'custom-post-widget'),
142
+ 8 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block submitted. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block submitted.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
143
+ 9 => sprintf( __('Content Block scheduled for: <strong>%1$s</strong>.', 'custom-post-widget'), date_i18n( __( 'M j, Y @ G:i' , 'custom-post-widget'), strtotime(isset($post->post_date) ? $post->post_date : null) ), esc_url( 'widgets.php' ) ),
144
+ 10 => current_user_can( 'edit_theme_options' ) ? sprintf( __('Content Block draft updated. <a href="%s">Manage Widgets</a>', 'custom-post-widget'), esc_url( 'widgets.php' ) ) : sprintf( __('Content Block draft updated.', 'custom-post-widget'), esc_url( 'widgets.php' ) ),
145
+ );
146
+ return $messages;
147
+ }
148
+
149
+ // Add the ability to display the content block in a reqular post using a shortcode
150
+ function custom_post_widget_shortcode($atts) {
151
+ extract(shortcode_atts(array(
152
+ 'id' => '',
153
+ 'class' => 'content_block'
154
+ ), $atts));
155
+
156
+ $content = "";
157
+
158
+ if($id != "") {
159
+ $args = array(
160
+ 'post__in' => array($id),
161
+ 'post_type' => 'content_block',
162
+ );
163
+
164
+ $content_post = get_posts($args);
165
+
166
+ foreach( $content_post as $post ) :
167
+ $content .= '<div class="'. esc_attr($class) .'">';
168
+ $content .= apply_filters('the_content', $post->post_content);
169
+ $content .= '</div>';
170
+ endforeach;
171
+ }
172
+
173
+ return $content;
174
+ }
175
+ add_shortcode('content_block', 'custom_post_widget_shortcode');
176
+
177
+ // Add button above editor
178
+ function add_content_block_icon($initcontext) {
179
+ return $initcontext.
180
+ '<a id="add_content_block" style="text-decoration:none;" class="thickbox" title="' . __("Add Content Block", 'custom-post-widget') . '" href="' . CUSTOM_POST_WIDGET_URL . 'popup.php?type=add_content_block_popup&amp;TB_inline=true&amp;inlineId=content_block_form">
181
+ <img onclick="return false;" alt="' . __("Add Content Block", 'custom-post-widget') . '" src="' . CUSTOM_POST_WIDGET_URL . 'images/contentblock-13.png">
182
+ </a>';
183
+ }
184
+
185
+ add_filter('media_buttons_context', 'add_content_block_icon');
186
+
187
+ require_once( CUSTOM_POST_WIDGET_DIR . '/popup.php' );
188
+
189
+ if(!defined( 'CUSTOM_POST_WIDGET_CURRENT_PAGE' ))
190
+ define( 'CUSTOM_POST_WIDGET_CURRENT_PAGE', basename($_SERVER['PHP_SELF']) );
191
+ if(in_array(CUSTOM_POST_WIDGET_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
192
+ add_action('admin_footer', 'add_content_block_popup');
193
+ }
 
 
 
 
 
 
 
194
  ?>
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: vanderwijk
3
  Author URI: http://www.vanderwijk.com/
4
  Donate link: http://www.vanderwijk.com/wordpress/support/
5
- Tags: custom-post, widget, sidebar
6
  Requires at least: 2.9.2
7
- Tested up to: 3.1
8
- Stable tag: 1.8
9
 
10
  This plugin enables you to display the content of a custom post type called Content Block in a sidebar widget.
11
 
@@ -18,16 +18,18 @@ Even though you could use the text widget that comes with the default WordPress
18
  * If you are using the standard WordPress text widgets to display content on various areas of your template, this content can only be edited by users with administrator access. If you would like editors to modify the widget content, you can use this plugin to provide them access to the custom posts that provide the content for the widget areas.
19
  * The Custom Post Widget plugin enables users to use the WYSIWYG editor for editing the content and adding images.
20
 
21
- This plugin creates a 'content_block' custom post type. The title is never displayed, use this to describe the position of the widget on the page. Note that these content blocks can only be displayed in the context of the page. I have added 'public' => false to the custom post type which means that it is not accessible outside the page context.
22
 
23
  To add content to a widget, drag it to the required position in the sidebar and select the title of the custom post in the widget configuration.
24
 
 
 
25
  You can find more information about this plugin and a screencast video which shows the plugin in action on the [plugin homepage](http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/).
26
 
27
  == Screenshots ==
28
 
29
- 1. After activating the plugin a new post type called 'Content Blocks' is added.
30
- 2. The widget has a select box to choose the content block.
31
 
32
  == Installation ==
33
 
@@ -91,8 +93,7 @@ Now the title of the content block is displayed in the admin interface to make i
91
  The plugin has been translated into Dutch and German. Hat tip: Caspar H&uuml;binger - glueckpress.com
92
 
93
  = 1.5 =
94
- Thanks to Caspar Huebinger the plugin
95
- now has its own icon and as requested by Stephen James the author field has been added to the Content Block edit screen.
96
 
97
  = 1.6 =
98
  The Custom Post Widget plugin is now using the more efficient get_post instead of query_posts to display the content block on the page. A code example for this change has been graciously provided by Paul de Wouters.
@@ -100,9 +101,36 @@ The Custom Post Widget plugin is now using the more efficient get_post instead o
100
  = 1.7 =
101
  This release fixes all the debug error messages Yoast discovered when [reviewing this plugin](http://yoast.com/wp-plugin-review/custom-post-widget/). As requested by Tony Allsopp the option of using the shortcode [content_block id= ] to pull in the content of a content block in a page or post has been added.
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  == Upgrade Notice ==
104
 
105
- = 1.1.1 =
106
- Now supports more than 10 custom posts in the select box. Note that after upgrading you might have to save the widget state before the correct posts are being displayed.
107
 
108
 
2
  Contributors: vanderwijk
3
  Author URI: http://www.vanderwijk.com/
4
  Donate link: http://www.vanderwijk.com/wordpress/support/
5
+ Tags: custom-post, widget, sidebar, content block, content, block, custom, post, shortcode
6
  Requires at least: 2.9.2
7
+ Tested up to: 3.3.1
8
+ Stable tag: 1.9.2
9
 
10
  This plugin enables you to display the content of a custom post type called Content Block in a sidebar widget.
11
 
18
  * If you are using the standard WordPress text widgets to display content on various areas of your template, this content can only be edited by users with administrator access. If you would like editors to modify the widget content, you can use this plugin to provide them access to the custom posts that provide the content for the widget areas.
19
  * The Custom Post Widget plugin enables users to use the WYSIWYG editor for editing the content and adding images.
20
 
21
+ This plugin creates a 'content_block' custom post type. You can choose to either display the title on the page or use it to describe the contents and widget position of the content block. Note that these content blocks can only be displayed in the context of the page. I have added 'public' => false to the custom post type which means that it is not accessible outside the page context.
22
 
23
  To add content to a widget, drag it to the required position in the sidebar and select the title of the custom post in the widget configuration.
24
 
25
+ This plugin is ready for localization and Dutch, German and Russian language files are included.
26
+
27
  You can find more information about this plugin and a screencast video which shows the plugin in action on the [plugin homepage](http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/).
28
 
29
  == Screenshots ==
30
 
31
+ 1. After activating the plugin a new post type called 'Content Blocks' is added. You can also see the little icon above the WYSIWYG editor that allows you to insert the content block using the shortcode.
32
+ 2. The widget has a select box to choose the content block. Click on the 'Edit Content Block' link to edit the selected Content Block custom post.
33
 
34
  == Installation ==
35
 
93
  The plugin has been translated into Dutch and German. Hat tip: Caspar H&uuml;binger - glueckpress.com
94
 
95
  = 1.5 =
96
+ Thanks to Caspar Huebinger the plugin now has its own icon and as requested by Stephen James the author field has been added to the Content Block edit screen.
 
97
 
98
  = 1.6 =
99
  The Custom Post Widget plugin is now using the more efficient get_post instead of query_posts to display the content block on the page. A code example for this change has been graciously provided by Paul de Wouters.
101
  = 1.7 =
102
  This release fixes all the debug error messages Yoast discovered when [reviewing this plugin](http://yoast.com/wp-plugin-review/custom-post-widget/). As requested by Tony Allsopp the option of using the shortcode [content_block id= ] to pull in the content of a content block in a page or post has been added.
103
 
104
+ = 1.8 =
105
+ Added a button above to content editor to make it easier to add the shortcode (no need for looking up the id).
106
+
107
+ = 1.8.2 =
108
+ Updated German translation and various bugfixes.
109
+
110
+ = 1.8.3 -> rolled-back because of some reported issues with social media icons being added to the widget areas =
111
+ The widget now emulates the $post loop. This means you can now make use of WordPress functionality such as inserting a [gallery]. Thanks to Jari Pennanen for providing the code.
112
+
113
+ = 1.8.4 =
114
+ Added edit content block link to the widget editor and changed the 'view content block' message to include a 'manage widgets' link. The 'Draft' and 'Preview' buttons are now hidden via CSS, hopefully this will soon be default WordPress behaviour (see related ticket: http://core.trac.wordpress.org/ticket/18956).
115
+ Thanks to Julian Gardner-Hobbs (http://www.hobwebs.com/) for requesting this functionality.
116
+
117
+ = 1.8.5 =
118
+ This release is to fix an issue with the WordPress plugin repository.
119
+
120
+ = 1.8.6 =
121
+ Minor bugfix for edit link in widget.
122
+
123
+ = 1.9 =
124
+ The content blocks can now be translated using the WPML plugin, thanks to Jonathan Liuti (http://unboxed-logic.com/).
125
+ Thanks to Vitaliy Kaplya (http://www.dasayt.com/) a Russian translation has been added to the plugin.
126
+
127
+ = 1.9.2 =
128
+ Now includes Polish language files as created by Kuba Skublicki.
129
+
130
+
131
  == Upgrade Notice ==
132
 
133
+ = 1.8 =
134
+ I would appreciate some feedback on the newly introduced shortcode functionality. Is this useful or not? Any issues found? Thanks!
135
 
136
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file