Archived
Updates bonanza
This commit is contained in:
1 parent
d26191c9f8
commit
9d480fc3c5
1366 files changed
+220321
-90180
No files matched your search
+87
-44
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( './admin.php' );
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
/** WordPress Administration Widgets API */
|
||||
require_once(ABSPATH . 'wp-admin/includes/widgets.php');
|
||||
@@ -34,6 +34,12 @@ if ( 'on' == $widgets_access ) {
|
||||
wp_enqueue_script( 'jquery-touch-punch' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires early before the Widgets administration screen loads,
|
||||
* after scripts are enqueued.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
do_action( 'sidebar_admin_setup' );
|
||||
|
||||
$title = __( 'Widgets' );
|
||||
@@ -65,7 +71,7 @@ get_current_screen()->add_help_tab( array(
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
if ( ! current_theme_supports( 'widgets' ) ) {
|
||||
@@ -182,7 +188,8 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
|
||||
|
||||
if ( isset($_GET['addnew']) ) {
|
||||
// Default to the first sidebar
|
||||
$sidebar = array_shift( $keys = array_keys($wp_registered_sidebars) );
|
||||
$keys = array_keys( $wp_registered_sidebars );
|
||||
$sidebar = array_shift( $keys );
|
||||
|
||||
if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget
|
||||
// Copy minimal info from an existing instance of this widget to a new instance
|
||||
@@ -221,9 +228,8 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
|
||||
$width = ' style="width:' . max($control['width'], 350) . 'px"';
|
||||
$key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
|
||||
|
||||
require_once( './admin-header.php' ); ?>
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<div class="editwidget"<?php echo $width; ?>>
|
||||
<h3><?php printf( __( 'Widget %s' ), $name ); ?></h3>
|
||||
@@ -288,7 +294,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once( './admin-footer.php' );
|
||||
require_once( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -301,10 +307,9 @@ $errors = array(
|
||||
__('Error in displaying the widget settings form.')
|
||||
);
|
||||
|
||||
require_once( './admin-header.php' ); ?>
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
|
||||
<?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
|
||||
@@ -314,78 +319,102 @@ require_once( './admin-header.php' ); ?>
|
||||
<div id="message" class="error"><p><?php echo $errors[$_GET['error']]; ?></p></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action( 'widgets_admin_page' ); ?>
|
||||
<?php
|
||||
/**
|
||||
* Fires before the Widgets administration page content loads.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'widgets_admin_page' ); ?>
|
||||
|
||||
<div class="widget-liquid-left">
|
||||
<div id="widgets-left">
|
||||
<div id="available-widgets" class="widgets-holder-wrap">
|
||||
<div class="sidebar-name">
|
||||
<div class="sidebar-name-arrow"><br /></div>
|
||||
<h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3></div>
|
||||
<div class="widget-holder">
|
||||
<p class="description"><?php _e('Drag widgets from here to a sidebar on the right to activate them. Drag widgets back here to deactivate them and delete their settings.'); ?></p>
|
||||
<div id="widget-list">
|
||||
<?php wp_list_widgets(); ?>
|
||||
<div class="sidebar-name-arrow"><br /></div>
|
||||
<h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3>
|
||||
</div>
|
||||
<br class='clear' />
|
||||
<div class="widget-holder">
|
||||
<div class="sidebar-description">
|
||||
<p class="description"><?php _e('To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.'); ?></p>
|
||||
</div>
|
||||
<div id="widget-list">
|
||||
<?php wp_list_widgets(); ?>
|
||||
</div>
|
||||
<br class='clear' />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$theme_sidebars = array();
|
||||
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
|
||||
if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
|
||||
$wrap_class = 'widgets-holder-wrap';
|
||||
if ( !empty( $registered_sidebar['class'] ) )
|
||||
$wrap_class .= ' ' . $registered_sidebar['class'];
|
||||
|
||||
?>
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $wrap_class ); ?>">
|
||||
<div class="sidebar-name">
|
||||
<div class="sidebar-name-arrow"><br /></div>
|
||||
<h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
|
||||
<span class="spinner"></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="widget-holder inactive">
|
||||
<?php wp_list_widget_controls( $registered_sidebar['id'] ); ?>
|
||||
<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
} else {
|
||||
$theme_sidebars[$sidebar] = $registered_sidebar;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="widget-liquid-right">
|
||||
<div id="widgets-right">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
|
||||
if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
|
||||
continue;
|
||||
|
||||
$i = $split = 0;
|
||||
$single_sidebar_class = '';
|
||||
$sidebars_count = count( $theme_sidebars );
|
||||
|
||||
if ( $sidebars_count > 1 ) {
|
||||
$split = ceil( $sidebars_count / 2 );
|
||||
} else {
|
||||
$single_sidebar_class = ' class="single-sidebar"';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="widget-liquid-right">
|
||||
<div id="widgets-right"<?php echo $single_sidebar_class; ?>>
|
||||
<div class="sidebars-column-1">
|
||||
<?php
|
||||
|
||||
foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
|
||||
$wrap_class = 'widgets-holder-wrap';
|
||||
if ( !empty( $registered_sidebar['class'] ) )
|
||||
$wrap_class .= ' sidebar-' . $registered_sidebar['class'];
|
||||
|
||||
if ( $i )
|
||||
$wrap_class .= ' closed'; ?>
|
||||
if ( $i > 0 )
|
||||
$wrap_class .= ' closed';
|
||||
|
||||
if ( $split && $i == $split ) {
|
||||
?>
|
||||
</div><div class="sidebars-column-2">
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $wrap_class ); ?>">
|
||||
<div class="sidebar-name">
|
||||
<div class="sidebar-name-arrow"><br /></div>
|
||||
<h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
|
||||
<span class="spinner"></span></h3></div>
|
||||
<?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?>
|
||||
<?php wp_list_widget_controls( $sidebar, $registered_sidebar['name'] ); // Show the control forms for each of the widgets in this sidebar ?>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$i++;
|
||||
} ?>
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="" method="post">
|
||||
@@ -394,6 +423,20 @@ foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<div class="widgets-chooser">
|
||||
<ul class="widgets-chooser-sidebars"></ul>
|
||||
<div class="widgets-chooser-actions">
|
||||
<button class="button-secondary"><?php _e( 'Cancel' ); ?></button>
|
||||
<button class="button-primary"><?php _e( 'Add Widget' ); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Fires after the available widgets and sidebars have loaded, before the admin footer.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
do_action( 'sidebar_admin_page' );
|
||||
require_once( './admin-footer.php' );
|
||||
require_once( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
Reference in new issue
Block a user