Version Description
Download this release
Release Info
Developer | anmari |
Plugin | amr shortcode any widget |
Version | 3.5 |
Comparing to | |
See all releases |
Code changes from version 3.4 to 3.5
- amr-admin-form-html.php +52 -19
- amr-shortcode-any-widget.php +3 -3
- readme.txt +4 -1
amr-admin-form-html.php
CHANGED
@@ -18,28 +18,16 @@ if (!class_exists('amr_saw_plugin_admin')) {
|
|
18 |
|
19 |
function __construct() {
|
20 |
add_action('admin_menu', array(&$this, 'register_settings_page') );
|
21 |
-
add_filter('plugin_action_links', array(&$this, 'add_action_link'), 10, 2 );
|
22 |
}
|
|
|
23 |
function register_settings_page() {
|
24 |
add_options_page( $this->longname, $this->shortname, $this->accesslvl, $this->hook, array(&$this,'config_page'));
|
25 |
}
|
|
|
26 |
function plugin_options_url() {
|
27 |
return admin_url( 'options-general.php?page='.$this->hook );
|
28 |
}
|
29 |
-
|
30 |
-
* Add a link to the settings page to the plugins list
|
31 |
-
*/
|
32 |
-
function add_action_link( $links, $file ) {
|
33 |
-
static $this_plugin;
|
34 |
-
if( empty($this_plugin) )
|
35 |
-
$this_plugin = $this->filename;
|
36 |
-
if ( $file == $this_plugin ) {
|
37 |
-
$settings_link = '<a href="' . $this->plugin_options_url() . '">' . __('Settings', 'amr-shortcode-any-widget') . '</a>';
|
38 |
-
array_unshift( $links, $settings_link );
|
39 |
-
}
|
40 |
-
return $links;
|
41 |
-
}
|
42 |
-
|
43 |
function admin_heading($title) {
|
44 |
echo '<div class="wrap" >
|
45 |
<div id="icon-options-general" class="icon32"><br />
|
@@ -55,8 +43,12 @@ if (!class_exists('amr_saw_plugin_admin')) {
|
|
55 |
function admin_subheading($title) {
|
56 |
echo '<h2>'.$title.'</h2>';
|
57 |
}
|
|
|
58 |
function config_page() {
|
59 |
$this->admin_heading($this->longname);
|
|
|
|
|
|
|
60 |
echo '<h3>More detailed instructions at the wordpress plugin <a target="_new" href="http://wordpress.org/plugins/amr-shortcode-any-widget/installation">installation and faq pages.</a></h3>';
|
61 |
echo '<ol>';
|
62 |
echo '<li>';
|
@@ -188,13 +180,10 @@ if (!class_exists('amr_saw_plugin_admin')) {
|
|
188 |
echo '</li>';
|
189 |
echo '</ul>';
|
190 |
echo '<br />';
|
|
|
191 |
|
192 |
}
|
193 |
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Info box with link to the support forums.
|
197 |
-
*/
|
198 |
function plugin_support() {
|
199 |
$content = '<p>'.__('If you have any problems with this plugin or good ideas for improvements or new features, please talk about them in the','amr-shortcode-any-widget').' <a href="http://wordpress.org/tags/'.$this->hook.'">'.__("Support forums",'amr-shortcode-any-widget').'</a>.</p>';
|
200 |
$this->postbox($this->hook.'support', 'Need support?', $content);
|
@@ -208,6 +197,50 @@ if (!class_exists('amr_saw_plugin_admin')) {
|
|
208 |
}
|
209 |
return $text;
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
}
|
212 |
}
|
213 |
|
18 |
|
19 |
function __construct() {
|
20 |
add_action('admin_menu', array(&$this, 'register_settings_page') );
|
|
|
21 |
}
|
22 |
+
|
23 |
function register_settings_page() {
|
24 |
add_options_page( $this->longname, $this->shortname, $this->accesslvl, $this->hook, array(&$this,'config_page'));
|
25 |
}
|
26 |
+
|
27 |
function plugin_options_url() {
|
28 |
return admin_url( 'options-general.php?page='.$this->hook );
|
29 |
}
|
30 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
function admin_heading($title) {
|
32 |
echo '<div class="wrap" >
|
33 |
<div id="icon-options-general" class="icon32"><br />
|
43 |
function admin_subheading($title) {
|
44 |
echo '<h2>'.$title.'</h2>';
|
45 |
}
|
46 |
+
|
47 |
function config_page() {
|
48 |
$this->admin_heading($this->longname);
|
49 |
+
$this->where_shortcode();
|
50 |
+
|
51 |
+
echo '<h2>Help:</h2>';
|
52 |
echo '<h3>More detailed instructions at the wordpress plugin <a target="_new" href="http://wordpress.org/plugins/amr-shortcode-any-widget/installation">installation and faq pages.</a></h3>';
|
53 |
echo '<ol>';
|
54 |
echo '<li>';
|
180 |
echo '</li>';
|
181 |
echo '</ul>';
|
182 |
echo '<br />';
|
183 |
+
|
184 |
|
185 |
}
|
186 |
|
|
|
|
|
|
|
|
|
187 |
function plugin_support() {
|
188 |
$content = '<p>'.__('If you have any problems with this plugin or good ideas for improvements or new features, please talk about them in the','amr-shortcode-any-widget').' <a href="http://wordpress.org/tags/'.$this->hook.'">'.__("Support forums",'amr-shortcode-any-widget').'</a>.</p>';
|
189 |
$this->postbox($this->hook.'support', 'Need support?', $content);
|
197 |
}
|
198 |
return $text;
|
199 |
}
|
200 |
+
|
201 |
+
function where_shortcode() {
|
202 |
+
global $wpdb;
|
203 |
+
//$pattern = get_shortcode_regex(array('do_widget'));
|
204 |
+
|
205 |
+
echo '<h2>'.__('This site is using do_widget shortcodes in the following:','amr-shortcode-any-widget').'</h2>';
|
206 |
+
$results = array();
|
207 |
+
$query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content LIKE '%[do_widget%]%' ORDER BY post_date DESC;" ;
|
208 |
+
//$query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content REGEXP '".$pattern."' ORDER BY post_date DESC;" ;
|
209 |
+
$results = $wpdb->get_results($query);
|
210 |
+
|
211 |
+
echo '<table class="widefat wp-list-table striped"><thead><tr><th>';
|
212 |
+
_e('Post');
|
213 |
+
echo '</th><th>';
|
214 |
+
_e('Published');
|
215 |
+
echo '</th><th>';
|
216 |
+
_e('Shortcodes');
|
217 |
+
echo '</th></tr></thead><tbody>';
|
218 |
+
foreach($results as $i => $result) {
|
219 |
+
echo '<tr><td>';
|
220 |
+
edit_post_link($result->post_title.' ',' ',' ',$result->ID);
|
221 |
+
echo '</td><td>'.substr($result->post_date,0,11);
|
222 |
+
if (!($result->post_status == 'publish')) _e($result->post_status);
|
223 |
+
echo '</td><td>';
|
224 |
+
|
225 |
+
preg_match_all("^\[(.*)\]^",$result->post_content,$matches, PREG_PATTERN_ORDER);
|
226 |
+
|
227 |
+
foreach ($matches[0] as $j=> $m) {
|
228 |
+
if (!empty($matches[1][$j])) {
|
229 |
+
|
230 |
+
echo $m;
|
231 |
+
echo '<br />';
|
232 |
+
}
|
233 |
+
};
|
234 |
+
echo '<td></tr>';
|
235 |
+
|
236 |
+
}
|
237 |
+
echo '</tbody></table>';
|
238 |
+
|
239 |
+
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
}
|
245 |
}
|
246 |
|
amr-shortcode-any-widget.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: amr shortcode any widget
|
|
4 |
Plugin URI: http://webdesign.anmari.com/shortcode-any-widget/
|
5 |
Description: Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ] [do_widget id=widgetnamedashed-n ]or include a whole widget area [do_widget_area]. Please see <a href="https://wordpress.org/plugins/amr-shortcode-any-widget/faq/">FAQ</a>.
|
6 |
Author: anmari
|
7 |
-
Version: 3.
|
8 |
Author URI: http://webdesign.anmari.com
|
9 |
|
10 |
*/
|
@@ -379,9 +379,9 @@ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'amr_add_action_
|
|
379 |
|
380 |
function amr_add_action_links ( $links ) {
|
381 |
$mylinks[] =
|
382 |
-
'<a title="
|
383 |
$mylinks[] =
|
384 |
-
'<a title="
|
385 |
return array_merge( $links, $mylinks );
|
386 |
}
|
387 |
|
4 |
Plugin URI: http://webdesign.anmari.com/shortcode-any-widget/
|
5 |
Description: Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ] [do_widget id=widgetnamedashed-n ]or include a whole widget area [do_widget_area]. Please see <a href="https://wordpress.org/plugins/amr-shortcode-any-widget/faq/">FAQ</a>.
|
6 |
Author: anmari
|
7 |
+
Version: 3.5
|
8 |
Author URI: http://webdesign.anmari.com
|
9 |
|
10 |
*/
|
379 |
|
380 |
function amr_add_action_links ( $links ) {
|
381 |
$mylinks[] =
|
382 |
+
'<a title="This page will also tell you if you are using the shortcodes and where" href="' . admin_url( 'options-general.php?page=amr_saw' ) . '">Where using?</a>';
|
383 |
$mylinks[] =
|
384 |
+
'<a title="Click for a page of tips" href="' . admin_url( 'options-general.php?page=amr_saw' ) . '">HELP</a>';
|
385 |
return array_merge( $links, $mylinks );
|
386 |
}
|
387 |
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: anmari
|
3 |
Tags: shortcode, widget, page, templates, page template, widget_area, sidebar
|
4 |
Tested up to: 4.8 alpha
|
5 |
-
Version: 3.
|
6 |
Stable tag: trunk
|
7 |
|
8 |
== Description ==
|
@@ -160,6 +160,9 @@ If you only using widget, maybe inserting the whole sidebar or widgertarea would
|
|
160 |
[do_widget_area]
|
161 |
|
162 |
== Changelog ==
|
|
|
|
|
|
|
163 |
= Version 3.4 =
|
164 |
* Retested on wordpres 4.7 and 4.8 alpha and forcing update because of plugin directory needs trigger temporarily to show the installation instructions
|
165 |
|
2 |
Contributors: anmari
|
3 |
Tags: shortcode, widget, page, templates, page template, widget_area, sidebar
|
4 |
Tested up to: 4.8 alpha
|
5 |
+
Version: 3.5
|
6 |
Stable tag: trunk
|
7 |
|
8 |
== Description ==
|
160 |
[do_widget_area]
|
161 |
|
162 |
== Changelog ==
|
163 |
+
= Version 3.5 =
|
164 |
+
* Adds info showing you on which pages, posts etc you are using a do_widget or do_widget_area shortcode, just in case you forget.
|
165 |
+
|
166 |
= Version 3.4 =
|
167 |
* Retested on wordpres 4.7 and 4.8 alpha and forcing update because of plugin directory needs trigger temporarily to show the installation instructions
|
168 |
|