Sync plugins from current page
Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
@@ -0,0 +1,246 @@
|
||||
<?php
|
||||
/**
|
||||
* Backend Class for use in all amr plugins
|
||||
* Version 0.1
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
if (!class_exists('amr_saw_plugin_admin')) {
|
||||
class amr_saw_plugin_admin {
|
||||
var $hook = 'amr_saw';
|
||||
var $filename = 'amr_shortcode_any_widget/amr_shortcode_any_widget.php';
|
||||
var $longname = 'Shortcode any widget - insert widgets or widget areas into a page.';
|
||||
var $shortname = 'Shortcode any widget';
|
||||
var $optionname = '';
|
||||
var $homepage = '';
|
||||
var $parent_slug = 'plugin_listings_menu';
|
||||
var $accesslvl = 'manage_options';
|
||||
|
||||
function __construct() {
|
||||
add_action('admin_menu', array(&$this, 'register_settings_page') );
|
||||
}
|
||||
|
||||
function register_settings_page() {
|
||||
add_options_page( $this->longname, $this->shortname, $this->accesslvl, $this->hook, array(&$this,'config_page'));
|
||||
}
|
||||
|
||||
function plugin_options_url() {
|
||||
return admin_url( 'options-general.php?page='.$this->hook );
|
||||
}
|
||||
|
||||
function admin_heading($title) {
|
||||
echo '<div class="wrap" >
|
||||
<div id="icon-options-general" class="icon32"><br />
|
||||
</div>
|
||||
<h2>'.$title.' </h2>';
|
||||
// <form method="post" action="'
|
||||
// .esc_url($_SERVER['PHP_SELF'])
|
||||
// .'">';
|
||||
// wp_nonce_field($this->hook); /* outputs hidden field */
|
||||
// ;
|
||||
}
|
||||
|
||||
function admin_subheading($title) {
|
||||
echo '<h2>'.$title.'</h2>';
|
||||
}
|
||||
|
||||
function config_page() {
|
||||
$this->admin_heading($this->longname);
|
||||
$this->where_shortcode();
|
||||
|
||||
echo '<h2>Help:</h2>';
|
||||
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>';
|
||||
echo '<ol>';
|
||||
echo '<li>';
|
||||
_e('Test your widget in a normal sidebar first.', 'amr-shortcode-any-widget');
|
||||
echo ' <a title="Go to widget area" href="'.get_admin_url('','widgets.php').'">';
|
||||
_e('Go to widgets', 'amr-shortcode-any-widget');
|
||||
echo '</a>';
|
||||
echo '<li>';
|
||||
_e('Drag the widgets you want to use to the shortcodes sidebar.', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
_e('Add a do_widget or do_widget_area shortcode to a page.', 'amr-shortcode-any-widget');
|
||||
echo ' <a title="Create a page" href="'
|
||||
.get_admin_url('','post-new.php?post_type=page&content=[do_widget Archives ]')
|
||||
.'">';
|
||||
_e('Create a page with example do_widget shortcode', 'amr-shortcode-any-widget');
|
||||
echo '</a>';
|
||||
echo '</li>';
|
||||
echo '</ol>';
|
||||
|
||||
|
||||
echo '<h2>';
|
||||
_e('To add a single widget to a page', 'amr-shortcode-any-widget');
|
||||
echo '</h2>';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
_e('Add the shortcode [do_widget widgetname] to a page:', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo '<li>';
|
||||
echo '[do_widget categories] or [do_widget name=categories] ';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
_e('[do_widget "tag cloud"] or [do_widget id=widgetid]', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo 'To see a list of your widgets in their sidebars, add <b>?do_widget_debug</b> to the url of page with the do_widget shortcode.';
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<br />';
|
||||
echo '<h2>';
|
||||
_e('More advanced options:','amr-shortcode-any-widget');
|
||||
echo '</h2>';
|
||||
echo '<ul><li>';
|
||||
echo 'Use title=false to hide a widget title. ';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo '[do_widget pages title=false] will hide the widget title';
|
||||
echo '</li></ul>';
|
||||
echo '<h3>';
|
||||
_e('To change the style, change the html:','amr-shortcode-any-widget');
|
||||
echo '</h3>';
|
||||
echo '<ul>';
|
||||
|
||||
echo '<li>';
|
||||
echo 'Use title=somehtmltag and wrap=somehtmltag to change the html used. This may change how your theme\'s css affects the widget when it is in page. It all depends what what html selectors your theme uses.';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ' Use class=yourclassname to add a class - maybe to override your themes widget styling? Obviously you must have css that applies to that class.';
|
||||
echo '</li>';
|
||||
|
||||
echo '<li>';
|
||||
echo '[do_widget pages title=h3] give the title a heading 3 html tag.';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo '[do_widget "tag cloud" wrap=aside] will wrap the widget in an "aside" html tag.';
|
||||
echo '</li>';
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
echo '<h4>';
|
||||
echo "Valid title html tags are : </h4><ul>";
|
||||
echo '<li>h1</li>';
|
||||
echo '<li>h2</li>';
|
||||
echo '<li>h3</li>';
|
||||
echo '<li>h4</li>';
|
||||
echo '<li>h5</li>';
|
||||
echo '<li>header</li>';
|
||||
echo '<li>strong</li>';
|
||||
echo '<li>em</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo "<h4>Valid html wrap tags are :</h4><ul>";
|
||||
echo '<li>div</li>';
|
||||
echo '<li>p</li>';
|
||||
echo '<li>aside</li>';
|
||||
echo '<li>section</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<h2>';
|
||||
_e('To add multiple instances of the same widget:', 'amr-shortcode-any-widget');
|
||||
|
||||
echo '</h2>';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo '[do_widget id=widgetid1] [do_widget id=widgetid2]';
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<h2>';
|
||||
_e('To add a widget area - all widgets in the widget area:', 'amr-shortcode-any-widget');
|
||||
|
||||
echo '</h2>';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo '<a title="Create a page" href="'
|
||||
.get_admin_url('','post-new.php?post_type=page&content=[do_widget_area]')
|
||||
.'"> ';
|
||||
_e('Create a page with do_widget_area shortcode', 'amr-shortcode-any-widget');
|
||||
echo '</a> Hoping to use theme styling.';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo '<a title="Create a page" href="'
|
||||
.get_admin_url('',
|
||||
'post-new.php?post_type=page&content=[do_widget_area widget_area_class=none]')
|
||||
.'"> ';
|
||||
_e('Create a page with do_widget_area shortcode without the widget_area class', 'amr-shortcode-any-widget');
|
||||
echo '</a> Hoping to avoid theme sidebar styling.';
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
_e('Examples:', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
_e('[do_widget_area] or [do_widget_area widget_area=sidebar-1]', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
_e('NB: Using something like the twenty-fourteen theme? you might end up with white text on a white background. Tweak the widget classes or the html of the wrap or title. If that fails, adjust your css.', 'amr-shortcode-any-widget');
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
echo '<br />';
|
||||
|
||||
|
||||
}
|
||||
|
||||
function plugin_support() {
|
||||
$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>';
|
||||
$this->postbox($this->hook.'support', 'Need support?', $content);
|
||||
}
|
||||
|
||||
function text_limit( $text, $limit, $finish = ' […]') {
|
||||
if( strlen( $text ) > $limit ) {
|
||||
$text = substr( $text, 0, $limit );
|
||||
$text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) );
|
||||
$text .= $finish;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
function where_shortcode() {
|
||||
global $wpdb;
|
||||
//$pattern = get_shortcode_regex(array('do_widget'));
|
||||
|
||||
echo '<h2>'.__('This site is using do_widget shortcodes in the following:','amr-shortcode-any-widget').'</h2>';
|
||||
$results = array();
|
||||
$query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content LIKE '%[do_widget%]%' ORDER BY post_date DESC;" ;
|
||||
//$query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content REGEXP '".$pattern."' ORDER BY post_date DESC;" ;
|
||||
$results = $wpdb->get_results($query);
|
||||
|
||||
echo '<table class="widefat wp-list-table striped"><thead><tr><th>';
|
||||
_e('Post');
|
||||
echo '</th><th>';
|
||||
_e('Published');
|
||||
echo '</th><th>';
|
||||
_e('Shortcodes');
|
||||
echo '</th></tr></thead><tbody>';
|
||||
foreach($results as $i => $result) {
|
||||
echo '<tr><td>';
|
||||
edit_post_link($result->post_title.' ',' ',' ',$result->ID);
|
||||
echo '</td><td>'.substr($result->post_date,0,11);
|
||||
if (!($result->post_status == 'publish')) _e($result->post_status);
|
||||
echo '</td><td>';
|
||||
|
||||
preg_match_all("^\[(.*)\]^",$result->post_content,$matches, PREG_PATTERN_ORDER);
|
||||
|
||||
foreach ($matches[0] as $j=> $m) {
|
||||
if (!empty($matches[1][$j])) {
|
||||
|
||||
echo $m;
|
||||
echo '<br />';
|
||||
}
|
||||
};
|
||||
echo '<td></tr>';
|
||||
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: amr shortcode any widget
|
||||
Plugin URI: http://webdesign.anmari.com/shortcode-any-widget/
|
||||
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>.
|
||||
Author: anmari
|
||||
Version: 3.7
|
||||
Author URI: http://webdesign.anmari.com
|
||||
|
||||
*/
|
||||
|
||||
|
||||
add_action('in_widget_form', 'amr_spice_get_widget_id');
|
||||
function amr_spice_get_widget_id($widget_instance) {
|
||||
echo "<p><strong>To use as shortcode with id:</strong> ";
|
||||
if ($widget_instance->number=="__i__"){
|
||||
echo "Save the widget first!</p>" ;
|
||||
} else {
|
||||
echo "[do_widget id=".$widget_instance->id. "]</p>";
|
||||
}
|
||||
}
|
||||
|
||||
function amr_remove_widget_class($params) { // remove the widget classes
|
||||
if (!empty($params[0]['before_widget'])) {
|
||||
$params[0]['before_widget'] =
|
||||
str_replace ('"widget ','"',$params[0]['before_widget']);
|
||||
}
|
||||
|
||||
if (!empty($params[0]['before_title'])) {
|
||||
|
||||
$params[0]['before_title'] =
|
||||
$params[0]['before_title'] = str_replace ('widget-title','',$params[0]['before_title']);
|
||||
|
||||
}
|
||||
|
||||
return ($params);
|
||||
}
|
||||
|
||||
function amr_do_widget_area($atts) {
|
||||
|
||||
global $wp_registered_widgets, $_wp_sidebars_widgets, $wp_registered_sidebars;
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'widget_area' => 'widgets_for_shortcodes',
|
||||
'class' => 'amr-widget-area', /* the widget class is picked up automatically. If we want to add an additional class at the wrap level to try to match a theme, use this */
|
||||
'widget_area_class' => '', /* option to disassociate from themes widget styling use =none*/
|
||||
'widget_classes' => '' /* option to disassociate from themes widget styling */
|
||||
|
||||
), $atts));
|
||||
|
||||
if (!empty($atts)) {
|
||||
if (($widget_area == 'widgets_for_shortcodes' ) and !empty($atts[0]))
|
||||
$widget_area = $atts[0];
|
||||
}
|
||||
|
||||
if (empty ($wp_registered_sidebars[$widget_area])) {
|
||||
echo '<br/>Widget area "'.$widget_area.'" not found. Registered widget areas (sidebars) are: <br/>';
|
||||
foreach ($wp_registered_sidebars as $area=> $sidebar) echo $area.'<br />';
|
||||
}
|
||||
//if (isset($_REQUEST['do_widget_debug']) and current_user_can('administrator')) var_dump( $wp_registered_sidebars); /**/
|
||||
|
||||
if ($widget_area_class=='none')
|
||||
$class = '';
|
||||
else {
|
||||
|
||||
if (!empty($widget_area_class)) //2014 08
|
||||
$class .= 'class="'.$class.' '.$widget_area_class.'"';
|
||||
else
|
||||
$class = 'class="'.$class.'"';
|
||||
}
|
||||
|
||||
if (!empty($widget_classes) and ($widget_classes=='none'))
|
||||
add_filter('dynamic_sidebar_params','amr_remove_widget_class');
|
||||
|
||||
ob_start(); /* catch the echo output, so we can control where it appears in the text */
|
||||
dynamic_sidebar($widget_area);
|
||||
$output = ob_get_clean();
|
||||
remove_filter('dynamic_sidebar_params','amr_remove_widget_class');
|
||||
|
||||
$output = PHP_EOL.'<div id="'.$widget_area.'" '.$class. '>'
|
||||
.$output
|
||||
.'</div>'.PHP_EOL;
|
||||
|
||||
return ($output);
|
||||
}
|
||||
|
||||
function amr_do_widget($atts) {
|
||||
|
||||
global $wp_registered_widgets, $_wp_sidebars_widgets, $wp_registered_sidebars;
|
||||
|
||||
/* check if the widget is in the shortcode x sidebar if not , just use generic,
|
||||
if it is in, then get the instance data and use that */
|
||||
|
||||
if (is_admin()) {return '';} // eg in case someone decides to apply content filters when apost is saved, and not all widget stuff is there.
|
||||
extract(shortcode_atts(array(
|
||||
'sidebar' => 'Widgets for Shortcodes', //default
|
||||
'id' => '',
|
||||
'name' => '', /* MKM added explicit 'name' attribute. For existing users we still need to allow prev method, else too many support queries will happen */
|
||||
'title' => '', /* do the default title unless they ask us not to - use string here not boolean */
|
||||
'class' => 'amr_widget', /* the widget class is picked up automatically. If we want to add an additional class at the wrap level to try to match a theme, use this */
|
||||
'wrap' => '', /* wrap the whole thing - title plus widget in a div - maybe the themes use a div, maybe not, maybe we want that styling, maybe not */
|
||||
'widget_classes' => '' /* option to disassociate from themes widget styling */
|
||||
), $atts));
|
||||
|
||||
if (isset($_wp_sidebars_widgets) ) {
|
||||
amr_show_widget_debug('which one', $name, $id, $sidebar); //check for debug prompt and show widgets in shortcode sidebar if requested and logged in etc
|
||||
}
|
||||
else {
|
||||
$output = '<br />No widgets defined at all in any sidebar!';
|
||||
return ($output);
|
||||
}
|
||||
|
||||
/* compatibility check - if the name is not entered, then the first parameter is the name */
|
||||
if (empty($name) and !empty($atts[0]))
|
||||
$name = $atts[0];
|
||||
/* the widget need not be specified, [do_widget widgetname] is adequate */
|
||||
if (!empty($name)) { // we have a name
|
||||
$widget = $name;
|
||||
|
||||
foreach ($wp_registered_widgets as $i => $w) { /* get the official internal name or id that the widget was registered with */
|
||||
if (strtolower($w['name']) === strtolower($widget))
|
||||
$widget_ids[] = $i;
|
||||
//if ($debug) {echo '<br /> Check: '.$w['name'];}
|
||||
}
|
||||
|
||||
if (!($sidebarid = amr_get_sidebar_id ($sidebar))) {
|
||||
$sidebarid=$sidebar; /* get the official sidebar id for this widget area - will take the first one */
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else { /* check for id if we do not have a name */
|
||||
|
||||
if (!empty($id)) { /* if a specific id has been specified */
|
||||
foreach ($wp_registered_widgets as $i => $w) { /* get the official internal name or id that the widget was registered with */
|
||||
if ($w['id'] === $id) {
|
||||
$widget_ids[] = $id;
|
||||
}
|
||||
}
|
||||
//echo '<h2>We have an id: '.$id.'</h2>'; if (!empty($widget_ids)) var_dump($widget_ids);
|
||||
}
|
||||
else {
|
||||
$output = '<br />No valid widget name or id given in shortcode parameters';
|
||||
|
||||
return $output;
|
||||
}
|
||||
// if we have id, get the sidebar for it
|
||||
$sidebarid = amr_get_widgets_sidebar($id);
|
||||
if (!$sidebarid) {
|
||||
$output = '<br />Widget not in any sidebars<br />';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($widget)) $widget = '';
|
||||
if (empty($id)) $id = '';
|
||||
|
||||
if (empty ($widget_ids)) {
|
||||
$output = '<br />Error: Your Requested widget "'.$widget.' '.$id.'" is not in the widget list.<br />';
|
||||
$output .= amr_show_widget_debug('empty', $name, $id, $sidebar);
|
||||
return ($output) ;
|
||||
}
|
||||
|
||||
|
||||
if (empty($widget))
|
||||
$widget = '';
|
||||
|
||||
$content = '';
|
||||
/* if the widget is in our chosen sidebar, then use the options stored for that */
|
||||
|
||||
if ((!isset ($_wp_sidebars_widgets[$sidebarid])) or (empty ($_wp_sidebars_widgets[$sidebarid]))) { // try upgrade
|
||||
amr_upgrade_sidebar();
|
||||
}
|
||||
|
||||
//if we have a specific sidebar selected, use that
|
||||
if ((isset ($_wp_sidebars_widgets[$sidebarid])) and (!empty ($_wp_sidebars_widgets[$sidebarid]))) {
|
||||
/* get the intersect of the 2 widget setups so we just get the widget we want */
|
||||
|
||||
$wid = array_intersect ($_wp_sidebars_widgets[$sidebarid], $widget_ids );
|
||||
|
||||
}
|
||||
else { /* the sidebar is not defined or selected - should not happen */
|
||||
if (isset($debug)) { // only do this in debug mode
|
||||
if (!isset($_wp_sidebars_widgets[$sidebarid]))
|
||||
$output = '<p>Error: Sidebar "'.$sidebar.'" with sidebarid "'.$sidebarid.'" is not defined.</p>';
|
||||
// shouldnt happen - maybe someone running content filters on save
|
||||
else
|
||||
$output = '<p>Error: Sidebar "'.$sidebar.'" with sidebarid "'.$sidebarid.'" is empty (no widgets)</p>';
|
||||
}
|
||||
}
|
||||
|
||||
$output = '';
|
||||
if (empty ($wid) or (!is_array($wid)) or (count($wid) < 1)) {
|
||||
|
||||
$output = '<p>Error: Your requested Widget "'.$widget.'" is not in the "'.$sidebar.'" sidebar</p>';
|
||||
$output .= amr_show_widget_debug('empty', $name, $id, $sidebar);
|
||||
|
||||
unset($sidebar);
|
||||
unset($sidebarid);
|
||||
|
||||
}
|
||||
else {
|
||||
/* There may only be one but if we have two in our chosen widget then it will do both */
|
||||
$output = '';
|
||||
foreach ($wid as $i=>$widget_instance) {
|
||||
ob_start(); /* catch the echo output, so we can control where it appears in the text */
|
||||
amr_shortcode_sidebar($widget_instance, $sidebar, $title, $class, $wrap, $widget_classes);
|
||||
$output .= ob_get_clean();
|
||||
}
|
||||
}
|
||||
|
||||
return ($output);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function amr_shortcode_sidebar( $widget_id,
|
||||
$name="widgets_for_shortcode",
|
||||
$title=true,
|
||||
$class='',
|
||||
$wrap='',
|
||||
$widget_classes='') { /* This is basically the wordpress code, slightly modified */
|
||||
global $wp_registered_sidebars, $wp_registered_widgets;
|
||||
|
||||
$debug = amr_check_if_widget_debug();
|
||||
|
||||
$sidebarid = amr_get_sidebar_id ($name);
|
||||
|
||||
$amr_sidebars_widgets = wp_get_sidebars_widgets(); //201711 do we need?
|
||||
|
||||
$sidebar = $wp_registered_sidebars[$sidebarid]; // has the params etc
|
||||
|
||||
$did_one = false;
|
||||
|
||||
/* lifted from wordpress code, keep as similar as possible for now */
|
||||
|
||||
if ( !isset($wp_registered_widgets[$widget_id]) ) return; // wp had c o n t i n u e
|
||||
|
||||
$params = array_merge(
|
||||
array(
|
||||
array_merge( $sidebar,
|
||||
array('widget_id' => $widget_id,
|
||||
'widget_name' => $wp_registered_widgets[$widget_id]['name']) ) ),
|
||||
(array) $wp_registered_widgets[$widget_id]['params']
|
||||
);
|
||||
|
||||
$validtitletags = array ('h1','h2','h3','h4','h5','header','strong','em');
|
||||
$validwraptags = array ('div','p','main','aside','section');
|
||||
|
||||
if (!empty($wrap)) { /* then folks want to 'wrap' with their own html tag, or wrap = yes */
|
||||
if ((!in_array( $wrap, $validwraptags)))
|
||||
$wrap = '';
|
||||
/* To match a variety of themes, allow for a variety of html tags. */
|
||||
/* May not need if our sidebar match attempt has worked */
|
||||
}
|
||||
|
||||
if (!empty ($wrap)) {
|
||||
$params[0]['before_widget'] = '<'.$wrap.' id="%1$s" class="%2$s">';
|
||||
$params[0]['after_widget'] = '</'.$wrap.'>';
|
||||
}
|
||||
|
||||
// wp code to get classname
|
||||
$classname_ = '';
|
||||
//foreach ( (array) $wp_registered_widgets[$widget_id]['classname'] as $cn ) {
|
||||
$cn = $wp_registered_widgets[$widget_id]['classname'];
|
||||
if ( is_string($cn) )
|
||||
$classname_ .= '_' . $cn;
|
||||
elseif ( is_object($cn) )
|
||||
$classname_ .= '_' . get_class($cn);
|
||||
//}
|
||||
$classname_ = ltrim($classname_, '_');
|
||||
|
||||
// add MKM and others requested class in to the wp classname string
|
||||
// if no class specfied, then class will = amrwidget. These classes are so can reverse out unwanted widget styling.
|
||||
|
||||
// $classname_ .= ' widget '; // wordpress seems to almost always adds the widget class
|
||||
|
||||
|
||||
$classname_ .= ' '.$class;
|
||||
|
||||
// we are picking up the defaults from the thems sidebar ad they have registered heir sidebar to issue widget classes?
|
||||
|
||||
|
||||
// Substitute HTML id and class attributes into before_widget
|
||||
if (!empty($params[0]['before_widget']))
|
||||
$params[0]['before_widget'] = sprintf($params[0]['before_widget'], $widget_id, $classname_);
|
||||
else
|
||||
$params[0]['before_widget'] = '';
|
||||
|
||||
if (empty($params[0]['before_widget']))
|
||||
$params[0]['after_widget'] = '';
|
||||
|
||||
$params = apply_filters( 'dynamic_sidebar_params', $params );
|
||||
// allow, any pne usingmust ensure they apply to the correct sidebars
|
||||
|
||||
if (!empty($title)) {
|
||||
if ($title=='false') { /* amr switch off the title html, still need to get rid of title separately */
|
||||
$params[0]['before_title'] = '<span style="display: none">';
|
||||
$params[0]['after_title'] = '</span>';
|
||||
}
|
||||
else {
|
||||
if (in_array( $title, $validtitletags)) {
|
||||
$class = ' class="widget-title" ';
|
||||
|
||||
$params[0]['before_title'] = '<'.$title.' '.$class.' >';
|
||||
$params[0]['after_title'] = '</'.$title.'>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($widget_classes) and ($widget_classes == 'none') ) {
|
||||
$params = amr_remove_widget_class($params); // also called in widget area shortcode
|
||||
}
|
||||
|
||||
|
||||
$callback = $wp_registered_widgets[$widget_id]['callback'];
|
||||
if ( is_callable($callback) ) {
|
||||
call_user_func_array($callback, $params);
|
||||
$did_one = true;
|
||||
}
|
||||
// }
|
||||
return $did_one;
|
||||
}
|
||||
|
||||
|
||||
function amr_saw_setup_sidebar ($sidebars_widgets) {
|
||||
global $sidebars_widgets; //need?
|
||||
// now theme mods has record of widgets and sidebar, but not for our new one.
|
||||
if ( is_array( $sidebars_widgets ) ) {
|
||||
if (empty($sidebars_widgets['widgets_for_shortcodes'])) {
|
||||
$sidebars_widgets['widgets_for_shortcodes'] = array();
|
||||
}
|
||||
}
|
||||
return $sidebars_widgets;
|
||||
}
|
||||
|
||||
function amr_reg_sidebar() { // this is fired late, so hopefully any theme sidebars will have been registered already.
|
||||
|
||||
global $wp_registered_widgets, $_wp_sidebars_widgets, $sidebars_widgets, $wp_registered_sidebars;
|
||||
|
||||
if ( function_exists('register_sidebar') ) { // maybe later, get the first main sidebar and copy it's before/after etc
|
||||
$args = array(
|
||||
'name' =>'Widgets for Shortcodes',
|
||||
'id' => 'widgets_for_shortcodes', // hope to avoid losing widgets
|
||||
'description' => __('Sidebar to hold widgets and their settings. These widgets will be used in a shortcode. This sidebars widgets should be saved with your theme settings now.','amr-shortcode-any-widget'),
|
||||
'before_widget' => '<aside'.' id="%1$s" class="%2$s ">', // 201402 to match twentyfourteen theme
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title" >', // 201402 maybe dont use widget class - we are in content here not in a widget area but others want the widget styling. ?
|
||||
'after_title' => '</h1>' );
|
||||
|
||||
|
||||
|
||||
if (!empty($wp_registered_sidebars)) { // we got some sidebars already.
|
||||
$main_sidebar = reset($wp_registered_sidebars); // Grab the first sidebar and use that as defaults for the widgets
|
||||
$args['before_widget'] = $main_sidebar['before_widget'];
|
||||
$args['after_widget'] = $main_sidebar['after_widget'];
|
||||
$args['before_title'] = $main_sidebar['before_title'];
|
||||
$args['after_title'] = $main_sidebar['after_title'];
|
||||
}
|
||||
|
||||
register_sidebar($args);
|
||||
|
||||
}
|
||||
|
||||
//else { echo '<h1>CANNOT REGISTER widgets_for_shortcodes SIDEBAR</h1>';}
|
||||
}
|
||||
|
||||
include ('amr-admin-form-html.php');
|
||||
include ('amr-utilities.php');
|
||||
|
||||
if (is_admin() ) $amr_saw_plugin_admin = new amr_saw_plugin_admin();
|
||||
|
||||
add_action('widgets_init', 'amr_reg_sidebar',98); // register late so it appears last
|
||||
add_filter( 'theme_mod_sidebars_widgets', 'amr_saw_setup_sidebar' ); //20171126
|
||||
|
||||
add_action('switch_theme', 'amr_save_shortcodes_sidebar');
|
||||
add_action('after_switch_theme', 'amr_restore_shortcodes_sidebar');
|
||||
|
||||
add_shortcode('do_widget', 'amr_do_widget');
|
||||
add_shortcode('do_widget_area', 'amr_do_widget_area'); // just dump the whole widget area - to get same styling
|
||||
|
||||
//require_once(ABSPATH . 'wp-includes/widgets.php'); // *** do we really need this here?
|
||||
function amr_saw_load_text() {
|
||||
// wp (see l10n.php) will check wp-content/languages/plugins if nothing found in plugin dir
|
||||
$result = load_plugin_textdomain( 'amr-shortcode-any-widget', false,
|
||||
dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
}
|
||||
|
||||
|
||||
add_action('plugins_loaded' , 'amr_saw_load_text' );
|
||||
|
||||
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'amr_add_action_links' );
|
||||
|
||||
function amr_add_action_links ( $links ) {
|
||||
$mylinks[] =
|
||||
'<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>';
|
||||
$mylinks[] =
|
||||
'<a title="Click for a page of tips" href="' . admin_url( 'options-general.php?page=amr_saw' ) . '">HELP</a>';
|
||||
return array_merge( $links, $mylinks );
|
||||
}
|
||||
156
wp-content/plugins/amr-shortcode-any-widget/amr-utilities.php
Normal file
156
wp-content/plugins/amr-shortcode-any-widget/amr-utilities.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
function amr_show_shortcode_widget_possibilities () {
|
||||
global $_wp_sidebars_widgets;
|
||||
|
||||
$sidebars_widgets = $_wp_sidebars_widgets;
|
||||
ksort ($sidebars_widgets); // push inactive down the bottom of the list
|
||||
$text= '<ul>';
|
||||
foreach ($sidebars_widgets as $sidebarid => $sidebar) {
|
||||
|
||||
if (is_array($sidebar)) {
|
||||
$text .= '<li><em>[do_widget_area '.$sidebarid.']</em><ul>';
|
||||
foreach ($sidebar as $i=> $w) {
|
||||
|
||||
$text .= '<li>';
|
||||
$text .= '[do_widget id="'.$w.'"]';
|
||||
$text .= '</li>';
|
||||
|
||||
};
|
||||
$text .= '</ul></li>';
|
||||
}
|
||||
}
|
||||
$text .= '</ul>';
|
||||
return ($text);
|
||||
}
|
||||
|
||||
function amr_get_widgets_sidebar($wid) {
|
||||
/* walk through the registered sidebars with a name and find the id - will be something like sidebar-integer.
|
||||
take the first one that matches */
|
||||
global $_wp_sidebars_widgets;
|
||||
|
||||
foreach ($_wp_sidebars_widgets as $sidebarid => $sidebar) {
|
||||
|
||||
if (is_array($sidebar) ) { // ignore the 'array version' sidebarid that isnt actually a sidebar
|
||||
foreach ($sidebar as $i=> $w) {
|
||||
if ($w == $wid) {
|
||||
return $sidebarid;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return (false); // widget id not in any sidebar
|
||||
}
|
||||
|
||||
function amr_get_sidebar_id ($name) {
|
||||
/* walk through the registered sidebars with a name and find the id - will be something like sidebar-integer.
|
||||
take the first one that matches */
|
||||
global $wp_registered_sidebars;
|
||||
|
||||
foreach ($wp_registered_sidebars as $i => $a) {
|
||||
if ((isset ($a['name'])) and ( $a['name'] === $name))
|
||||
return ($i);
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
function amr_get_sidebar_name ($id) { /* dont need anymore ? or at least temporarily */
|
||||
/* walk through the registered sidebars with a name and find the id - will be something like sidebar-integer. take the first one */
|
||||
global $wp_registered_sidebars;
|
||||
foreach ($wp_registered_sidebars as $i => $a) {
|
||||
if ((isset ($a['id'])) and ( $a['id'] === $id)) {
|
||||
if (isset($a['name'])) return ($a['name']);
|
||||
else return ($id);
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
function amr_check_if_widget_debug() {
|
||||
global $said;
|
||||
// only do these debug if we are logged in and are the administrator
|
||||
|
||||
if (is_admin()) return false; // if running in backend, then do not do debug. 20151217
|
||||
|
||||
if ((!is_user_logged_in()) or (!current_user_can('administrator')))
|
||||
return false;
|
||||
|
||||
if (isset($_REQUEST['do_widget_debug'])) {
|
||||
if (empty($said)) {
|
||||
$said = true;
|
||||
}
|
||||
else return true;
|
||||
|
||||
$url_without_debug_query = esc_url(remove_query_arg( 'do_widget_debug'));
|
||||
$eek = '<a href="'.$url_without_debug_query.'">Remove debug</a>';
|
||||
echo '<br/>Note: Debug help is only shown to a logged-in Administrator.'
|
||||
.$eek
|
||||
.'<br />';
|
||||
$text = amr_show_shortcode_widget_possibilities () ;
|
||||
echo $text;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function amr_show_widget_debug($type='', $name, $id, $sidebar) {
|
||||
global $wp_registered_sidebars, $wp_registered_widgets, $_wp_sidebars_widgets, $debugcount;
|
||||
// only do these debug if we are logged in and are the administrator
|
||||
|
||||
$debug = amr_check_if_widget_debug();
|
||||
$text = amr_show_shortcode_widget_possibilities () ;
|
||||
|
||||
if ($type=='empty') {
|
||||
if (current_user_can('administrator'))
|
||||
$text = '<p>Problem with do_widget shortcode? Try one of the following:</p>'.$text;
|
||||
}
|
||||
elseif (($type=='which one') and ($debug)) {
|
||||
$text = '<p>Debug help is on: Is your widget in the widgets_for_shortcodes sidebar?</p>'
|
||||
.$text;
|
||||
}
|
||||
|
||||
return ($text);
|
||||
}
|
||||
|
||||
function amr_save_shortcodes_sidebar() { // when switching a theme, save the widgets we use for the shortcodes as they are getting overwritten
|
||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
||||
if (!empty($sidebars_widgets['widgets_for_shortcodes']))
|
||||
update_option('sidebars_widgets_for_shortcodes_saved',$sidebars_widgets['widgets_for_shortcodes']);
|
||||
else { // our shortcodes sidebar is empty but when to fix ?
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function amr_restore_shortcodes_sidebar() { // when switching a theme, restore the widgets we use for the shortcodes as they are getting overwritten
|
||||
global $_wp_sidebars_widgets;
|
||||
|
||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
||||
if (empty($sidebars_widgets['widgets_for_shortcodes'])) {
|
||||
$sidebars_widgets['widgets_for_shortcodes'] = get_option('sidebars_widgets_for_shortcodes_saved');
|
||||
update_option('sidebars_widgets',$sidebars_widgets);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function amr_upgrade_sidebar() { // added in 2014 February for compatibility.. keep for how long. till no sites running older versions.?
|
||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
||||
if (!empty($sidebars_widgets['Shortcodes']) and empty($sidebars_widgets['widgets_for_shortcodes'])) { // we need to upgrade
|
||||
$sidebars_widgets['widgets_for_shortcodes'] = $sidebars_widgets['Shortcodes'];
|
||||
unset ($sidebars_widgets['Shortcodes']);
|
||||
update_option('sidebars_widgets',$sidebars_widgets );
|
||||
add_action( 'admin_notices', 'widgets_shortcode_admin_notice' );
|
||||
}
|
||||
}
|
||||
|
||||
function widgets_shortcode_admin_notice() {
|
||||
?>
|
||||
<div class="updated">
|
||||
<p>Please go to widgets page and check your "widgets for shortcodes" sidebar. It will hopefully have been corrected upgraded with your widgets and all should be fine.</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
3
wp-content/plugins/amr-shortcode-any-widget/index.php
Normal file
3
wp-content/plugins/amr-shortcode-any-widget/index.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
?>
|
||||
@@ -0,0 +1,118 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: amr shortcode any widget v2.4\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2017-04-03 07:36:42+0000\n"
|
||||
"Last-Translator: Jordan Silaen <jordan.silaen@chameleonjohn.com>\n"
|
||||
"Language-Team:ChameleonJohn.com \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: CSL v1.x\n"
|
||||
"X-Poedit-Language: Indonesian\n"
|
||||
"X-Poedit-Country: Indonesia\n"
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
"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"
|
||||
"X-Poedit-Basepath: ../\n"
|
||||
"X-Poedit-Bookmarks: \n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Textdomain-Support: yes"
|
||||
|
||||
#: amr-admin-form-html.php:37
|
||||
#
|
||||
msgid "Settings"
|
||||
msgstr "pengaturan"
|
||||
|
||||
#: amr-admin-form-html.php:63
|
||||
#
|
||||
msgid "Drag the widgets you want to use to the shortcodes sidebar."
|
||||
msgstr "Tarik widget yang ingin Anda gunakan ke shortcode sidebar."
|
||||
|
||||
#: amr-admin-form-html.php:67
|
||||
#
|
||||
msgid "Set the widgets parameters if there are any."
|
||||
msgstr "Mengatur parameter widget jika ada."
|
||||
|
||||
#: amr-admin-form-html.php:70
|
||||
#
|
||||
msgid "You could test the widgets out in a displayable widget area (sidebar/footer), then drag them to the widgets_for_shortcodes sidebar."
|
||||
msgstr "Anda bisa menguji widget di area widget dapat ditampilkan (sidebar / footer), kemudian menyeret mereka ke widgets_for_shortcodes sidebar."
|
||||
|
||||
#: amr-admin-form-html.php:75
|
||||
#
|
||||
msgid "Go to widgets"
|
||||
msgstr "Pergi ke widget"
|
||||
|
||||
#: amr-admin-form-html.php:81
|
||||
#
|
||||
msgid "To add a widget area - all widgets in the widget area:"
|
||||
msgstr "Untuk menambahkan area widget - widget semua di daerah widget:"
|
||||
|
||||
#: amr-admin-form-html.php:89
|
||||
#
|
||||
msgid "Create a page with do_widget_area shortcode without the widget_area class"
|
||||
msgstr "Buat halaman dengan do_widget_area shortcode tanpa kelas widget_area"
|
||||
|
||||
#: amr-admin-form-html.php:96
|
||||
#
|
||||
msgid "Create a page with do_widget_area shortcode"
|
||||
msgstr "Buat halaman dengan do_widget_area shortcode"
|
||||
|
||||
#: amr-admin-form-html.php:100
|
||||
#: amr-admin-form-html.php:117
|
||||
#
|
||||
msgid "Examples:"
|
||||
msgstr "contoh:"
|
||||
|
||||
#: amr-admin-form-html.php:103
|
||||
#
|
||||
msgid "[do_widget_area] or [do_widget_area widget_area=sidebar-1]"
|
||||
msgstr "[Do_widget_area] atau [do_widget_area widget_area = sidebar-1]"
|
||||
|
||||
#: amr-admin-form-html.php:106
|
||||
#
|
||||
msgid "NB: Using something like the twenty-fourteen theme? you might end up with white text on a white background. Tweak the widget classes or the html of the wrap or title. If that fails, adjust your css."
|
||||
msgstr "NB: Menggunakan sesuatu seperti 20-14 tema? Anda mungkin berakhir dengan teks putih pada latar belakang putih. Tweak kelas widget atau html dari bungkus atau judul. Jika itu gagal, menyesuaikan css Anda."
|
||||
|
||||
#: amr-admin-form-html.php:112
|
||||
#
|
||||
msgid "To add a single widget to a page"
|
||||
msgstr "Untuk menambahkan widget tunggal ke halaman"
|
||||
|
||||
#: amr-admin-form-html.php:116
|
||||
#
|
||||
msgid "Add the shortcode [do_widget widgetname] to a page."
|
||||
msgstr "Tambahkan shortcode [do_widget widgetname] ke halaman."
|
||||
|
||||
#: amr-admin-form-html.php:120
|
||||
#
|
||||
msgid "[do_widget \"tag cloud\"] or [do_widget id=widgetid]"
|
||||
msgstr "[Do_widget \ "tag cloud \"] atau [do_widget id = widgetid]"
|
||||
|
||||
#: amr-admin-form-html.php:126
|
||||
#
|
||||
msgid "Create a page with do_widget shortcode and remove widget_classes"
|
||||
msgstr "Buat halaman dengan do_widget shortcode dan menghapus widget_classes"
|
||||
|
||||
#: amr-admin-form-html.php:133
|
||||
#
|
||||
msgid "Create a page with do_widget shortcode"
|
||||
msgstr "Buat halaman dengan do_widget shortcode"
|
||||
|
||||
#: amr-admin-form-html.php:174
|
||||
#
|
||||
msgid "If you have any problems with this plugin or good ideas for improvements or new features, please talk about them in the"
|
||||
msgstr "Jika Anda memiliki masalah dengan plugin ini atau ide-ide yang baik untuk perbaikan atau fitur baru, silakan berbicara tentang mereka dalam"
|
||||
|
||||
#: amr-admin-form-html.php:174
|
||||
#
|
||||
msgid "Support forums"
|
||||
msgstr "forum dukungan"
|
||||
|
||||
#: amr-shortcode-any-widget.php:306
|
||||
#
|
||||
msgid "Sidebar to hold widgets and their settings. These widgets will be used in a shortcode. This sidebars widgets should be saved with your theme settings now."
|
||||
msgstr "Sidebar untuk menahan widget dan pengaturan mereka. Widget ini akan digunakan dalam shortcode. Ini sidebars widget harus disimpan dengan pengaturan tema Anda sekarang."
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,113 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: amr shortcode any widget v2.4\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tag/amr-shortcode-any-widget\n"
|
||||
"POT-Creation-Date: 2014-09-10 04:32:05+00:00\n"
|
||||
"PO-Revision-Date: 2015-02-05 07:22:13+0000\n"
|
||||
"Last-Translator: Borisa Djuraskovic <borisad@webhostinghub.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Poedit 1.5.7\n"
|
||||
"X-Poedit-Language: \n"
|
||||
"X-Poedit-Country: \n"
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
"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"
|
||||
"X-Poedit-Basepath: \n"
|
||||
"X-Poedit-Bookmarks: \n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Textdomain-Support: yes"
|
||||
|
||||
#: amr-admin-form-html.php:37
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Settings"
|
||||
msgstr "Podešavanja"
|
||||
|
||||
#: amr-admin-form-html.php:63
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Drag the widgets you want to use to the shortcodes sidebar."
|
||||
msgstr "Prevucite widget-e koje želite da koristite u shortcode bočni meni. "
|
||||
|
||||
#: amr-admin-form-html.php:67
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Set the widgets parameters if there are any."
|
||||
msgstr "Podesite parametre widget-a ako ih ima."
|
||||
|
||||
#: amr-admin-form-html.php:70
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "You could test the widgets out in a displayable widget area (sidebar/footer), then drag them to the widgets_for_shortcodes sidebar."
|
||||
msgstr "Možete da testirate widget-e u widget oblasti za prikazivanje (bočni meni/podnožje), a zatim ih prevucite u widgets_for_shortcodes bočni meni. "
|
||||
|
||||
#: amr-admin-form-html.php:75
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Go to widgets"
|
||||
msgstr "Idite na widget-e"
|
||||
|
||||
#: amr-admin-form-html.php:81
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "To add a widget area - all widgets in the widget area:"
|
||||
msgstr "Da biste sve widget-e dodali u widget oblast:"
|
||||
|
||||
#: amr-admin-form-html.php:89
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Create a page with do_widget_area shortcode without the widget_area class"
|
||||
msgstr "Kreirajte stranicu uz shortcode do_widget_area, ali bez widget_area klase"
|
||||
|
||||
#: amr-admin-form-html.php:96
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Create a page with do_widget_area shortcode"
|
||||
msgstr "Kreirajte stranicu uz do_widget_area shortcode"
|
||||
|
||||
#: amr-admin-form-html.php:100
|
||||
#: amr-admin-form-html.php:117
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Examples:"
|
||||
msgstr "Primeri:"
|
||||
|
||||
#: amr-admin-form-html.php:103
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "[do_widget_area] or [do_widget_area widget_area=sidebar-1]"
|
||||
msgstr "[do_widget_area] ili [do_widget_area widget_area=sidebar-1]"
|
||||
|
||||
#: amr-admin-form-html.php:106
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "NB: Using something like the twenty-fourteen theme? you might end up with white text on a white background. Tweak the widget classes or the html of the wrap or title. If that fails, adjust your css."
|
||||
msgstr "Zapamtite: Koristite li nešto poput 2014 teme? Možete završiti sa belim tekstom na beloj pozadini. Uzmite klase widget-a ili html sa preloma ili iz naslova. Ako to ne uspe, prilagodite svoj css."
|
||||
|
||||
#: amr-admin-form-html.php:112
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "To add a single widget to a page"
|
||||
msgstr "Da biste dodali pojedinačni widget stranici"
|
||||
|
||||
#: amr-admin-form-html.php:116
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Add the shortcode [do_widget widgetname] to a page."
|
||||
msgstr "Dodajte shortcode [do_widget widgetname] stranici."
|
||||
|
||||
#: amr-admin-form-html.php:120
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "[do_widget \"tag cloud\"] or [do_widget id=widgetid]"
|
||||
msgstr "[do_widget \"tag cloud\"] ili [do_widget id=widgetid]"
|
||||
|
||||
#: amr-admin-form-html.php:126
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Create a page with do_widget shortcode and remove widget_classes"
|
||||
msgstr "Kreirajte stranicu uz pomoć do_widget shortcode i remove widget_classes"
|
||||
|
||||
#: amr-admin-form-html.php:133
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Create a page with do_widget shortcode"
|
||||
msgstr "Kreirajte stranicu koristeći do_widget shortcode"
|
||||
|
||||
#: amr-admin-form-html.php:174
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "If you have any problems with this plugin or good ideas for improvements or new features, please talk about them in the"
|
||||
msgstr "Ako imate bilo kakvih problema s ovim plugin-om ili dobre ideje za poboljšanja, odnosno, nove funkcionalnosti, pričajte o njima na"
|
||||
|
||||
#: amr-admin-form-html.php:174
|
||||
#@ amr-shortcode-any-widget
|
||||
msgid "Support forums"
|
||||
msgstr "Forumima za podršku"
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: amr shortcode any widget 3.3\n"
|
||||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/amr-shortcode-any-"
|
||||
"widget\n"
|
||||
"POT-Creation-Date: 2017-04-18 13:56+0000\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
|
||||
"X-Generator: Loco - https://localise.biz/"
|
||||
|
||||
#: amr-admin-form-html.php:37
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:63
|
||||
msgid "Test your widget in a normal sidebar first."
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:65
|
||||
msgid "Go to widgets"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:68
|
||||
msgid "Drag the widgets you want to use to the shortcodes sidebar."
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:71
|
||||
msgid "Add a do_widget or do_widget_area shortcode to a page."
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:75
|
||||
msgid "Create a page with example do_widget shortcode"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:82
|
||||
msgid "To add a single widget to a page"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:86
|
||||
msgid "Add the shortcode [do_widget widgetname] to a page:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:93
|
||||
msgid "[do_widget \"tag cloud\"] or [do_widget id=widgetid]"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:102
|
||||
msgid "More advanced options:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:111
|
||||
msgid "To change the style, change the html:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:151
|
||||
msgid "To add multiple instances of the same widget:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:161
|
||||
msgid "To add a widget area - all widgets in the widget area:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:169
|
||||
msgid "Create a page with do_widget_area shortcode"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:177
|
||||
msgid ""
|
||||
"Create a page with do_widget_area shortcode without the widget_area class"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:181
|
||||
msgid "Examples:"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:184
|
||||
msgid "[do_widget_area] or [do_widget_area widget_area=sidebar-1]"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:187
|
||||
msgid ""
|
||||
"NB: Using something like the twenty-fourteen theme? you might end up with "
|
||||
"white text on a white background. Tweak the widget classes or the html of "
|
||||
"the wrap or title. If that fails, adjust your css."
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:199
|
||||
msgid ""
|
||||
"If you have any problems with this plugin or good ideas for improvements or "
|
||||
"new features, please talk about them in the"
|
||||
msgstr ""
|
||||
|
||||
#: amr-admin-form-html.php:199
|
||||
msgid "Support forums"
|
||||
msgstr ""
|
||||
|
||||
#: amr-shortcode-any-widget.php:330
|
||||
msgid "Widgets for Shortcodes"
|
||||
msgstr ""
|
||||
|
||||
#: amr-shortcode-any-widget.php:332
|
||||
msgid ""
|
||||
"Sidebar to hold widgets and their settings. These widgets will be used in a "
|
||||
"shortcode. This sidebars widgets should be saved with your theme settings "
|
||||
"now."
|
||||
msgstr ""
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "amr shortcode any widget"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"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 read: <a href=\"https://wordpress."
|
||||
"org/plugins/amr-shortcode-any-widget/installation/\">Installation</a> and <a "
|
||||
"href=\"https://wordpress.org/plugins/amr-shortcode-any-widget/faq/\">FAQ</a>."
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "http://webdesign.anmari.com/shortcode-any-widget/"
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "anmari"
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://webdesign.anmari.com"
|
||||
msgstr ""
|
||||
Binary file not shown.
285
wp-content/plugins/amr-shortcode-any-widget/readme.txt
Normal file
285
wp-content/plugins/amr-shortcode-any-widget/readme.txt
Normal file
@@ -0,0 +1,285 @@
|
||||
=== amr shortcode any widget ===
|
||||
Contributors: anmari
|
||||
Tags: shortcode, widget, page, templates, page template, widget_area, sidebar
|
||||
Tested up to: 5.0.3
|
||||
Version: 3.7
|
||||
Stable tag: trunk
|
||||
|
||||
== Description ==
|
||||
Insert a widget or multiple widgets or a entire widget area (sidebar) into a page using a shortcode.
|
||||
|
||||
Set up your widget first in a normal sidebar. Check it works.
|
||||
THEN Drag your chosen widgets to the sidebar called "widgets for shortcode".
|
||||
|
||||
Add the do_widget shortcode to the page where you would like the widget to appear (or the do_widget_area)
|
||||
|
||||
To use in the block editor, add a shortcode block, then type in (including the square brackets [do_widget widgetname] or copy the do_widget tip from the widget in the 'Widgets for Shortcodes' sidebar.
|
||||
|
||||
Please see detailed info on shortcodes and parameters under the installation tab (depending what the plugin directory developers have most recently done, this may be under the FAQ, or at the very least under the readme.)
|
||||
|
||||
Using a widget more than once?
|
||||
|
||||
Reference a specific widget instance from the do_widget shortcode, or the chosen sidebar from the do_widget_area shortcode. Eg: [do_widget id=widget-n]
|
||||
|
||||
For example: You could use the query posts widget in the page to create a archive within a page, or the rss widget to list feed content from other sites. For more details see [anmari.com](http://webdesign.anmari.com/category/plugins/shortcode-any-widget/)
|
||||
|
||||
The plugins default action is that it will magically find the settings for your themes sidebar and use the sidebar html to control the widgets output. In most cases this means the widget will be styled as per the rest of your theme. If that does not look good, parameters exist to try override this behaviour.
|
||||
|
||||
EG: in twenty-fourteen theme widget text ends up being white on white! widget_classes=none fixes that. Eg: [do_widget widget_classes=none yourwidget]
|
||||
|
||||
Changed your theme and worried about losing the sidebar settings ?
|
||||
|
||||
No problem, the plugin will save and restore the widgets_for_shortcode settings. On display it will then pick up the new themes sidebar settings.
|
||||
|
||||
**Note:**
|
||||
|
||||
PLEASE get your widgets working in a sidebar BEFORE activating this plugin, and please read https://wordpress.org/plugins/amr-shortcode-any-widget/installation/ and https://wordpress.org/plugins/amr-shortcode-any-widget/faq/ and/or see the settings page. To see a list of your widgets in their sidebars, add ?do_widget_debug to the page with the do_widget shortcode.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Test your chosen widget in a normal sidebar or widget area first.
|
||||
2. Then activate this plugin
|
||||
3. Go to Appearance > widgets and find the " widgets for shortcode" sidebar or widget area
|
||||
4. Drag your chosen widget from your normal sidebar to the shortcodes sidebar. Save.
|
||||
5. Now go to a page and enter a do_widget shortcode The shortcode any widget settings page has some helpful (hopefully) examples and links.
|
||||
|
||||
* [do_widget widgetname] eg: [do_widget calendar]
|
||||
* [do_widget "widget name"]. eg: [do_widget "tag cloud"]
|
||||
* [do_widget id=widgetid] . eg: [do_widget id=tag-cloud-3]
|
||||
|
||||
* [do_widget_area] (will use the "widgets in shortcodes" widget area / sidebar
|
||||
* [do_widget_area sidebarid] or [do_widget_area widget_area=sidebarid] for another sidebar or widget area - eg: to maximise likelihood of getting your theme's widget css to apply.
|
||||
|
||||
**[do_widget ...] Parameters:**
|
||||
|
||||
* *nameofwidget* or name="*nameofwidget*" This is NOT the title of the widget. THis is the name that you see in the widgets menu page even when unassigned to a sidebar. For existing users , you can also use just the name of the widget without name=. It must be the first parameter then. You can only do this with the name, not the id.
|
||||
* id=*wordpress assigned id of widget*. Examples: id=meta-3, id=tag-cloud-9 etc
|
||||
* title=false to hide the widgets title OR to override your themes first sidebar html settings for widget titles, use title=*htmltag* where *htmltag* is one of h1,h2,h3,h4,h5,header,strong,em.
|
||||
* wrap=*htmltag* where *htmltag* is one of div,p,main,aside,section. This will override your themes first sidebar widget wrapping html.
|
||||
* widget_classes=none This will remove the class "widget" from the wrapping html and the class "widget_title" from the title html. This may be enough to remove any unwanted css caused by your theme.
|
||||
* class=*yourclassname* By default the plugin will add a class of amr-widget to the wrapping html. You can use this to add any special css. Add css either by editing your themes stylesheet if it is a custom theme, or using something like the wordpress custom css plugin.
|
||||
* sidebar="*sidebarname*" will default to widgets_for_shortcode sidebar. Only use if you want to re-use a widget already being used in another sidebar. THis is theme dependent and WILL break if you change themes. Safer to use the widget_id.
|
||||
|
||||
**[do_widget_area ...] Parameters:**
|
||||
|
||||
* widget_area=*yourwidgetarea* defaults to 'widgets_for_shortcodes' if nothing entered
|
||||
* widget_area_class=none /* option to remove theme styling by removing the widget_area class from the sidebar html */
|
||||
* widget_classes=none /* option to remove the widget class from the widget wrappinghtml
|
||||
* class=*yourclassname* default is amr_widget_area. This will affect the widget area NOT the individual widgets. At the moment can only remove the widget classes, not replace them when using do_widget_area.
|
||||
|
||||
Advanced users WARNING: using do_widget_area with a widget area other than the shortcode one means that if you changes themes and the new theme has different sidebars, then this shortcode with a named widget area will not work.
|
||||
|
||||
See the settings page for links to help your create the shortcodes in a page.
|
||||
|
||||
The plugin has been tested with most standard widgets (rss feeds, tag cloud, pages, meta, search, and of course my own plugins widgets - upcoming events list, calendar and user lists.
|
||||
|
||||
If you use a widget more than once for different reasons, you may need to use the widget id to isolate which widget instance and it's settings to use. ie: [do_widget id=categories-6] . If you just use the name, it will display all widgets in the shortcode sidebar with that name (all instances).
|
||||
|
||||
|
||||
**If you liked this plugin, you might also like my other plugins:**
|
||||
|
||||
* [icalevents.com](http://icalevents.com) - a ics compliant events plugin fully integrated with wordpress, so it will work with many other plugins (seo, maps, social)
|
||||
* [wpusersplugin.com](http://wpusersplugin.com) - a suite of plugins to help with membership sites. Major plugin is [amr users](http://wordpress.org/extend/plugins/amr-users/)
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
PLEASE get your widgets working in a sidebar BEFORE activating this plugin, and PLEASE read the installation instructions (?is the plugin directory showing them!?) and the settings page before asking any questions.
|
||||
|
||||
**Widget help, the widget is doing this, when it should do that**
|
||||
|
||||
Please get the widget working first in a normal sidebar without this plugin and ask for support on the widgets forum it is does not work in a normal sidebar.
|
||||
|
||||
**How to identify widget**
|
||||
|
||||
To identify your widget in the shortcode, use the NAME or the ID.
|
||||
|
||||
The name is the generic NAME like "tag cloud".
|
||||
|
||||
The id is how wordpress identifies the instance of the widget. The id is visible at the bottom of the widget settings box.
|
||||
|
||||
**Styling, your theme, css, overriding**
|
||||
|
||||
Yes anything could happen wrt the appearance.(There are tens of 1000s of themes and widgets. Multiply out the possible combinations. Add in css specifity, inheritance and cascading rules. Consider you are moving the widget out of the sidebar where the the theme and widget plugin expect it to be. ) The effects are very dependent on how your theme has specified the css that may apply to widgets and sidebars/widget areas.
|
||||
|
||||
It may work beautifully and have the content looking like it belongs with your theme.
|
||||
|
||||
This plugin tries to help encourage that 'belonging' look. If it fails then it offers ways to switch the html and/or the classes being generated.
|
||||
|
||||
|
||||
Examples:
|
||||
* you may have undesired effects applying that do not work in the main content area
|
||||
* You may have desired effects not applying because the css is specific to a themes sidebar and does not apply to the html in a page.
|
||||
|
||||
The plugin can help a bit - Via the plugin you can do the following to affect styling:
|
||||
|
||||
* Remove the general wordpress 'widget' class from the widgets wrapping html and the 'widget_title' from the title html. ([do_widget *widgetname* widget_classes=none]
|
||||
|
||||
* Change the 'wrap' html and the title html with parameters wrap=div title=h3. See the settings page.
|
||||
|
||||
* Apply an existing class in your theme. Use [do_widget *widgetname* class=*yourclass*].
|
||||
|
||||
* Use the additional class 'amr-widget' provided to specify alternate css in your themes stylesheet or with something like wordpress custom css.
|
||||
|
||||
One of the new features is as a default setting is that the plugin will try have your current themes first sidebar styling apply to the widgets inserted into a page via the shortcode.
|
||||
|
||||
Many folks requested this, insisting that absolutely this is what should be happening and why didn't it? Well..This could be great - Imagine: a plugin that can pick up the theme styling and change it as your theme changes.
|
||||
|
||||
The success of this depends very much on how your theme specifies it's css. Does it always use classes ? - more css will apply. Does it lock the css down by sidebar-id: that css will not apply.
|
||||
|
||||
It also depends on what the original widget plugin does with css and js. It may have done something thinking that the widget will always be inside a sidebar and not anticipated being in a page. This the shortcde-any-widget plugin has no control over.
|
||||
|
||||
For example: An unwanted effect could be white text on a white background as in the twenty fourteen theme.
|
||||
|
||||
**If you have an undesired styling effect with the default settings:**
|
||||
|
||||
You need to learn the joys of the 'inspect element' tools in various browsers or browser web developer, firebug add-ons, so you can see what css is applying to what html. Then you can either change some of the html or override or change the css.
|
||||
|
||||
Options if you don't like the default result:
|
||||
|
||||
Use the 'amr-widget' class that has been added to the widget wrapping html to override any css.
|
||||
|
||||
eg:
|
||||
.amr-widget [
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
Tap into a class you already have in your theme:
|
||||
|
||||
[do_widget class=yourclass]
|
||||
|
||||
Change the html that the shortcode-any-widget plugin will use.
|
||||
|
||||
eg: don't like the h3.widget-title styling ? change the title html to h2 in the shotcode parameters
|
||||
|
||||
[do_widget title=h2]
|
||||
|
||||
eg: don't like the 'aside' wrapping html styling? change the wrapping html:
|
||||
|
||||
[do_widget wrap=div]
|
||||
|
||||
If you only using widget, maybe inserting the whole sidebar or widgertarea would give an interesting effect. Sidebar background css may apply.
|
||||
|
||||
[do_widget_area]
|
||||
|
||||
== Changelog ==
|
||||
= Version 3.6 =
|
||||
* Found a mixed line ending. Updated.
|
||||
* Tested on 5.0.3 and 5.1beta, with php 7.3.1
|
||||
|
||||
= Version 3.6 =
|
||||
* Basically forcing an update in the hope that the third party php7compatibility checker sort itself out. It's complaining about mixed line endings, but they're not.
|
||||
* Added indonesian translation provided by Jordan Silaen.
|
||||
|
||||
= Version 3.5 =
|
||||
* 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.
|
||||
|
||||
= Version 3.4 =
|
||||
* Retested on wordpres 4.7 and 4.8 alpha and forcing update because of plugin directory needs trigger temporarily to show the installation instructions
|
||||
|
||||
= Version 3.3 =
|
||||
* Retested on wordpres 4.5 and 4.5.1-alpha
|
||||
* Re-instated the saving of widgets in the shortcode sidebar on theme switch and the reloading of these saved widgets when theme is reactivated (Was commented out for awhile back in 2014, but appears to be working well and very useful when you changing a theme but maybe forgotten about this page that has widget on it - yeah that could be bad !
|
||||
|
||||
= Version 3.2 =
|
||||
* tweaked some error messages and handle situation better where there are no widgets or possibly empty sidebars.
|
||||
|
||||
= Version 3.1 =
|
||||
* added code for the widget-id to appear in the widget settings window.
|
||||
* removed lots of the 'debug' as it will hopefully no longer be needed.
|
||||
* most error messages will now be returned in the shortcode, not echoed at top of page.
|
||||
* the do_widget_debug lists less, but hopefully more usefully a list of the do_widget and do_widget_area options based on your sidebars and the widgets in them.
|
||||
|
||||
= Version 3 =
|
||||
* added code to not output anything if in admin (eg: in edit/save mode) in case something has forced application of content filters when saving (and not all widget stuff is active, so errors are output.
|
||||
* prefixed unprefixed function names to avoid conflicts
|
||||
|
||||
= Version 2.9 =
|
||||
* in debug help, the link to the installation page help was not properly setup. Fixed.
|
||||
|
||||
= Version 2.8 =
|
||||
* Tested on 4.3.1
|
||||
* No real functional change.
|
||||
* Tweaked debug info to look a little prettier. Also some error messages will not show unless you haev requested debug (?do_widiet_debug) to try to avoid the message that some genesis theme users are experiencing. I have not been able to recreate this with the genesis theme myself - it might be a plugin that they are using.
|
||||
|
||||
|
||||
= Version 2.6 =
|
||||
* Tested on 4.2
|
||||
* Removed from admin settings area the use of add_query_arg (unnecessary)
|
||||
* Added esc_url to widget id 'debug' oage just in case (it is only accessed by logged in admin, but lets be safe and keep everyone happy if the see the add_query_arg and remove_query_arg
|
||||
|
||||
= Version 2.5 =
|
||||
* Tested on 4.1.1, Linked to the settings help page from the plugin action menu.
|
||||
* Changed the readme a bit to try further aid understanding and reduce support issues
|
||||
* Updated some screenshots.
|
||||
|
||||
= Version 2.4 =
|
||||
* Tested on 4.1, Cleaned up the readme, Lang file for info page - most texts.
|
||||
|
||||
= Version 2.3 =
|
||||
* Fixed some widget area class options that were not working.
|
||||
* Added a widget area debug option to make it easier to find how your theme has stored it's widget area / sidebar ids. They are not always easy to find.
|
||||
* Tested on 3.9.1
|
||||
* Updated readme
|
||||
|
||||
= Version 2.2 =
|
||||
* Attempt to add more styling control.
|
||||
* Add widget_classes=none to reverse out widget type class. NOte to totally override wordpress widget
|
||||
* Add widget_area_class=none
|
||||
|
||||
= Version 2.1 =
|
||||
* Bug Fix - last sidebar registered by theme was being overwritten by the attempt to copy the themes sidebar arguments so that cleverly (hopefully) the shortcode widgets would pick up the same styling. Fixed now. Now it really does pickup the first sidebars styling - with devasting consquence in twenty-fourteen theme - yes white text on white background is not fun to read. But on other themes it works a treat.
|
||||
|
||||
|
||||
= Version 2 =
|
||||
* Shortcode widget id changed so that wordpress will save the shortcode settings per theme.
|
||||
* Added Code to auto upgrade, but just in case please check your widgets page. Look at the inactive widgets if the widgets are not in your widgets for shortcodes sidebar.
|
||||
* Logic added on theme switching to save shortcode widget settings and restore them after the theme switch, so you can play with themes and not have to set up your widgets again. WP kept putting them into an 'inactive sidebar'.
|
||||
* Added, as requested by a few of you, the ability to add a class and control the html around the widget without having to enter html around the shortcode has been added. See the settings page for instructions.
|
||||
* Added the ability to specify what html should be used for the title and the widget wrap, so that you can more easily either match your theme or get away from your thesmes widget styling.
|
||||
* Added ability to insert a whole widget area into the page. The default will be the "widgets for shortcode" sidebar/widget area. You can specify others. Note Specifying other widget areas may be theme dependent, ie: switch and you'll lose that page.
|
||||
* Added classes amr-widget and amr-widget-area so one can target the widgets in the page to adjust css.
|
||||
|
||||
= Version 1.8 =
|
||||
* Whoops - had renamed the main file and forgot to delete it from the svn. Forcing a version number change to ensure files get cleaned up for everyone
|
||||
|
||||
= Version 1.7 =
|
||||
* Change: Changed so that debugs and debug prompt will only show to a logged in administrator.
|
||||
|
||||
= Version 1.6 =
|
||||
* Add: added a settings page to help people out (not really settings)
|
||||
* Fix: changed a clashing function name
|
||||
|
||||
= Version 1.5 =
|
||||
* Fixed: a small bug which caused a warning if you had not saved the widgets in your shortcode sidebar
|
||||
|
||||
= Version 1.4 =
|
||||
* Updated readme - made very detailed steps and added some screen shots.
|
||||
* Tested on wp 3.3.1 and fixed some notices when bad parameters entered.
|
||||
|
||||
= Version 1.3 =
|
||||
* Added debug link and retested. Added readme.
|
||||
|
||||
= 1.12 =
|
||||
* Changed dummy shortcode sidebar so it appears after the theme sidebars to avoid taking over their widgets (this happened in numbered sidebars) PLEASE note if you have upgraded, you may appear to have "lost" your widgets due to this sidebar change. You have not - they will be in your "inactive widgets" - please drag them to the new sidebar. You may also find that you have 2 versions of the plugin, with slightly different folder names. This will allow you to go back to the previous one to check what you had there if you need to. Deactivate the old one and activate the new one. Move your widgets back in. Test then Delete the old one. In one theme it also appeared that somehow due to this change, one of the sidebar widgets "moved" down to another sidebar. I think that this may have had something to do with the fact that sidebars can be numbered or named, so please check all your sidebars before continuing. As always make sure thath you know how to restore from a backup before doing any upgrades of any kind.
|
||||
* Tested in 2.9.2, can still use either the widget name "Categories" or id=categories-6. Note widget must have been created in the dummy shortcode sidebar.
|
||||
|
||||
= 1.1 =
|
||||
|
||||
* Allow for lowercase use of widget names for the those challenged by attention to detail!
|
||||
* Cleaned up debug mode to make it easier for people to identify which instance of a widget they are using. Add &do_widget_debug to url string.
|
||||
|
||||
= 1.0 =
|
||||
* Launch of the plugin
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. setting up widgets in the widgets for shortcode sidebar. The widget's user interface (UI) is used to provide a UI for the do_widget shortcode.
|
||||
2. add shortcode for widgets in a page (must be in the widgets for shortcode sidebar)
|
||||
3. widgets in a page
|
||||
4. with the default widget class and with widget_classes=none
|
||||
two rss feed widgets in shortcode sidebar - both will show if just name used
|
||||
5. The widget id is now visible in the widget window
|
||||
6. After clicking on debug message - scroll down till you see the shortcodes sidebar - the widgets and their ids will be listed. Find the id of the widget you want.
|
||||
7. Shortcode parameters to remove widget-classes in theme like the twenty-fourteen theme (avoid white text on white background)
|
||||
8. Example of multiple rss widgets in twenty-fourteen theme
|
||||
|
||||
Reference in New Issue
Block a user