Archived
wp++
This commit is contained in:
1 parent
4e25d03c9c
commit
a631e727fa
385 files changed
+8431
-3849
No files matched your search
@@ -45,6 +45,10 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 47 ), '4.7.4', number_format_i18n( 47 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.4' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 39 ), '4.7.3', number_format_i18n( 39 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.3' ); ?>
|
||||
|
||||
@@ -294,6 +294,11 @@ body {
|
||||
transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1), 0.18s -webkit-transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */
|
||||
}
|
||||
|
||||
#customize-theme-controls .customize-pane-child.skip-transition {
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#customize-info,
|
||||
#customize-theme-controls .customize-pane-parent {
|
||||
position: relative;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
#customize-controls .customize-info .customize-section-description,#customize-controls .customize-info.section-meta{margin-bottom:15px}body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#555d66}#customize-header-actions .button-primary{float:left;margin-top:9px}#customize-header-actions .spinner{margin-top:13px;margin-left:4px}.saving #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-right:none;border-left:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:24px}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;left:1px;padding:20px 10px 10px 20px;width:20px;height:20px;cursor:pointer;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;right:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-left:30px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-right:4px solid #fff;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-right:4px solid #fff}#customize-theme-controls .accordion-section-title:after{content:"\f341";color:#a0a5aa}#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0;position:absolute;top:0;right:100%;width:100%;margin:0;padding:12px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-right-color:#0073aa}#accordion-section-themes+.control-sLine truncated
|
||||
#customize-controls .customize-info .customize-section-description,#customize-controls .customize-info.section-meta{margin-bottom:15px}body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#555d66}#customize-header-actions .button-primary{float:left;margin-top:9px}#customize-header-actions .spinner{margin-top:13px;margin-left:4px}.saving #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-right:none;border-left:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:24px}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;left:1px;padding:20px 10px 10px 20px;width:20px;height:20px;cursor:pointer;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;right:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-left:30px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-right:4px solid #fff;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-right:4px solid #fff}#customize-theme-controls .accordion-section-title:after{content:"\f341";color:#a0a5aa}#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0;position:absolute;top:0;right:100%;width:100%;margin:0;padding:12px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-right-color:#0073aa}#accordion-section-themes+.control-sLine truncated
|
||||
@@ -294,6 +294,11 @@ body {
|
||||
transition: 0.18s transform cubic-bezier(0.645, 0.045, 0.355, 1), 0.18s -webkit-transform cubic-bezier(0.645, 0.045, 0.355, 1); /* easeInOutCubic */
|
||||
}
|
||||
|
||||
#customize-theme-controls .customize-pane-child.skip-transition {
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#customize-info,
|
||||
#customize-theme-controls .customize-pane-parent {
|
||||
position: relative;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
#customize-controls .customize-info .customize-section-description,#customize-controls .customize-info.section-meta{margin-bottom:15px}body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#555d66}#customize-header-actions .button-primary{float:right;margin-top:9px}#customize-header-actions .spinner{margin-top:13px;margin-right:4px}.saving #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-left:none;border-right:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:24px}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;right:1px;padding:20px 20px 10px 10px;width:20px;height:20px;cursor:pointer;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;left:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-right:30px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-left:4px solid #fff;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-left:4px solid #fff}#customize-theme-controls .accordion-section-title:after{content:"\f345";color:#a0a5aa}#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0;position:absolute;top:0;left:100%;width:100%;margin:0;padding:12px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-left-color:#0073aa}#accordion-section-themes+.control-seLine truncated
|
||||
#customize-controls .customize-info .customize-section-description,#customize-controls .customize-info.section-meta{margin-bottom:15px}body{overflow:hidden;-webkit-text-size-adjust:100%}.customize-controls-close,.widget-control-actions a{text-decoration:none}#customize-controls h3{font-size:14px}#customize-controls img{max-width:100%}#customize-controls .submit{text-align:center}#customize-controls .description{color:#555d66}#customize-header-actions .button-primary{float:right;margin-top:9px}#customize-header-actions .spinner{margin-top:13px;margin-right:4px}.saving #customize-header-actions .spinner{visibility:visible}#customize-header-actions{border-bottom:1px solid #ddd}#customize-controls .wp-full-overlay-sidebar-content{overflow-y:auto;overflow-x:hidden}#customize-controls .customize-info{border:none;border-bottom:1px solid #ddd;margin-bottom:15px}#customize-controls .customize-info.is-in-view,#customize-controls .customize-section-title.is-in-view{position:absolute;z-index:9;width:100%;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 0 rgba(0,0,0,.1)}#customize-controls .customize-section-title.is-in-view{margin-top:0}#customize-controls .customize-info.is-in-view+.accordion-section{margin-top:15px}#customize-controls .customize-info.is-sticky,#customize-controls .customize-section-title.is-sticky{position:fixed;top:46px}#customize-controls .customize-info .accordion-section-title{background:#fff;color:#555d66;border-left:none;border-right:none;border-bottom:none;cursor:default}#customize-controls .customize-info .accordion-section-title:focus:after,#customize-controls .customize-info .accordion-section-title:hover:after,#customize-controls .customize-info.open .accordion-section-title:after{color:#32373c}#customize-controls .customize-info .accordion-section-title:after{display:none}#customize-controls .customize-info .preview-notice{font-size:13px;line-height:24px}#customize-controls .customize-info .panel-title,#customize-controls .customize-pane-child .customize-section-title h3,#customize-controls .customize-pane-child h3.customize-section-title{font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-section-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .customize-info .customize-help-toggle{position:absolute;top:4px;right:1px;padding:20px 20px 10px 10px;width:20px;height:20px;cursor:pointer;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;background:0 0;color:#555d66;border:none}#customize-controls .customize-info .customize-help-toggle:before{position:absolute;top:5px;left:6px}#customize-controls .customize-info .customize-help-toggle:focus,#customize-controls .customize-info .customize-help-toggle:hover,#customize-controls .customize-info.open .customize-help-toggle{color:#0073aa}#customize-controls .customize-info .customize-panel-description,#customize-controls .customize-info .customize-section-description,#customize-controls .no-widget-areas-rendered-notice{color:#555d66;display:none;background:#fff;padding:12px 15px;border-top:1px solid #ddd}#customize-controls .customize-info .customize-panel-description.open+.no-widget-areas-rendered-notice{border-top:none}#customize-controls .customize-info .customize-panel-description p:first-child,#customize-controls .customize-info .customize-section-description p:first-child{margin-top:0}#customize-controls .customize-info .customize-panel-description p:last-child,#customize-controls .customize-info .customize-section-description p:last-child{margin-bottom:0}#customize-controls .current-panel .control-section>h3.accordion-section-title{padding-right:30px}#customize-theme-controls .control-section{border:none}#customize-theme-controls .accordion-section-title{color:#555d66;background-color:#fff;border-bottom:1px solid #ddd;border-left:4px solid #fff;-webkit-transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}#customize-controls #customize-theme-controls .customize-themes-panel .accordion-section-title{color:#555;background-color:#fff;border-left:4px solid #fff}#customize-theme-controls .accordion-section-title:after{content:"\f345";color:#a0a5aa}#customize-theme-controls .accordion-section-content{color:#555d66;background:0 0;position:absolute;top:0;left:100%;width:100%;margin:0;padding:12px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#customize-controls .control-section .accordion-section-title:focus,#customize-controls .control-section .accordion-section-title:hover,#customize-controls .control-section.open .accordion-section-title,#customize-controls .control-section:hover>.accordion-section-title{color:#0073aa;background:#f3f3f5;border-left-color:#0073aa}#accordion-section-themes+.control-seLine truncated
|
||||
@@ -161,6 +161,7 @@
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after {
|
||||
@@ -532,6 +533,7 @@
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#available-menu-items .accordion-section-title .no-items,
|
||||
@@ -623,6 +625,7 @@
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#available-menu-items .menu-item-handle .item-add:focus {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-bottom:15px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .edit-menu{margin-right:6px;vertical-align:middle;line-height:28px;color:#0073aa;text-decoration:underline}.customize-control-nav_menu_location .edit-menu:active,.customize-control-nav_menu_location .edit-menu:hover{color:#00a0d2}.customize-control-nav_menu_location .edit-menu:focus{color:#124964}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-left:0}.wp-customizer .menu-item-handle .item-type{padding:1px 5px 0 21px;float:left;text-align:left}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-right:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:right;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;left:0}.menus-move-left:before{content:"\f345"}.menus-move-right:before{content:"\f341"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;left:-19px;top:2px;display:block;width:30px;height:38px;margin-left:0!important;-webkit-box-shadow:none;box-shadow:none;outline:0;overflow:hidden;cursor:pointer}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;left:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;right:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{-webkit-border-radius:100%;border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-left:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1;text-indent:-1px}.rtl .wp-customizer .toggle-indicator{text-inLine truncated
|
||||
#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-bottom:15px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .edit-menu{margin-right:6px;vertical-align:middle;line-height:28px;color:#0073aa;text-decoration:underline}.customize-control-nav_menu_location .edit-menu:active,.customize-control-nav_menu_location .edit-menu:hover{color:#00a0d2}.customize-control-nav_menu_location .edit-menu:focus{color:#124964}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-left:0}.wp-customizer .menu-item-handle .item-type{padding:1px 5px 0 21px;float:left;text-align:left}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-right:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:right;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;left:0}.menus-move-left:before{content:"\f345"}.menus-move-right:before{content:"\f341"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;left:-19px;top:2px;display:block;width:30px;height:38px;margin-left:0!important;-webkit-box-shadow:none;box-shadow:none;outline:0;overflow:hidden;cursor:pointer;text-align:center}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;left:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;right:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{-webkit-border-radius:100%;border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-left:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1;text-indent:-1px}.rtl .wp-customizer .toggleLine truncated
|
||||
@@ -161,6 +161,7 @@
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after {
|
||||
@@ -532,6 +533,7 @@
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#available-menu-items .accordion-section-title .no-items,
|
||||
@@ -623,6 +625,7 @@
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#available-menu-items .menu-item-handle .item-add:focus {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-bottom:15px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .edit-menu{margin-left:6px;vertical-align:middle;line-height:28px;color:#0073aa;text-decoration:underline}.customize-control-nav_menu_location .edit-menu:active,.customize-control-nav_menu_location .edit-menu:hover{color:#00a0d2}.customize-control-nav_menu_location .edit-menu:focus{color:#124964}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-right:0}.wp-customizer .menu-item-handle .item-type{padding:1px 21px 0 5px;float:right;text-align:right}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-left:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:left;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;right:0}.menus-move-left:before{content:"\f341"}.menus-move-right:before{content:"\f345"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;right:-19px;top:2px;display:block;width:30px;height:38px;margin-right:0!important;-webkit-box-shadow:none;box-shadow:none;outline:0;overflow:hidden;cursor:pointer}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;right:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;left:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{-webkit-border-radius:100%;border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-right:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1;text-indent:-1px}.rtl .wp-customizer .toggle-indicator{texLine truncated
|
||||
#customize-theme-controls #accordion-section-menu_locations{position:relative;margin-bottom:15px}#customize-theme-controls #accordion-section-menu_locations>.accordion-section-title{border-bottom-color:#ddd}.menu-in-location,.menu-in-locations{display:block;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .theme-location-set{color:#555}.customize-control-nav_menu_location .edit-menu{margin-left:6px;vertical-align:middle;line-height:28px;color:#0073aa;text-decoration:underline}.customize-control-nav_menu_location .edit-menu:active,.customize-control-nav_menu_location .edit-menu:hover{color:#00a0d2}.customize-control-nav_menu_location .edit-menu:focus{color:#124964}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-right:0}.wp-customizer .menu-item-handle .item-type{padding:1px 21px 0 5px;float:right;text-align:right}.wp-customizer .menu-item-handle:hover{z-index:8}.customize-control-nav_menu_item.has-notifications .menu-item-handle{border-left:4px solid #00a0d2}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;z-index:8;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{float:left;margin:6px 0 0;padding:0;cursor:pointer}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;right:0}.menus-move-left:before{content:"\f341"}.menus-move-right:before{content:"\f345"}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;right:-19px;top:2px;display:block;width:30px;height:38px;margin-right:0!important;-webkit-box-shadow:none;box-shadow:none;outline:0;overflow:hidden;cursor:pointer;text-align:center}.wp-customizer .menu-item.menu-item-edit-active .item-edit .toggle-indicator:after{content:"\f142"}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;margin:0;padding:20px;position:absolute;right:0;top:30px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:18px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;left:6px;position:absolute;top:6px}#customize-controls .customize-info .customize-help-toggle:focus:before,.customize-screen-options-toggle:focus:before{-webkit-border-radius:100%;border-radius:100%}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 15px}.wp-customizer .metabox-prefs label{display:block;padding-right:0;line-height:30px}.wp-customizer .toggle-indicator{display:inline-block;font-size:20px;line-height:1;text-indent:-1px}.rtl .wp-customizer .toLine truncated
|
||||
@@ -102,7 +102,7 @@ if ( $wp_customize->is_ios() ) {
|
||||
if ( is_rtl() ) {
|
||||
$body_class .= ' rtl';
|
||||
}
|
||||
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
|
||||
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
|
||||
|
||||
$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading…' ) );
|
||||
|
||||
|
||||
@@ -2982,7 +2982,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
if ( ! empty( $data[$version]['comments'] ) ) {
|
||||
foreach ( $data[$version]['comments'] as $key => $list ) {
|
||||
if ( 'length' !== $key && ! empty( $list ) ) {
|
||||
$metadata[$key] = reset( $list );
|
||||
$metadata[$key] = wp_kses_post( reset( $list ) );
|
||||
// Fix bug in byte stream analysis.
|
||||
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
|
||||
$metadata[$key] = 'Cop' . $metadata[$key];
|
||||
@@ -3072,8 +3072,6 @@ function wp_read_video_metadata( $file ) {
|
||||
|
||||
wp_add_id3_tag_data( $metadata, $data );
|
||||
|
||||
$metadata = wp_kses_post_deep( $metadata );
|
||||
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
@@ -3119,8 +3117,6 @@ function wp_read_audio_metadata( $file ) {
|
||||
|
||||
wp_add_id3_tag_data( $metadata, $data );
|
||||
|
||||
$metadata = wp_kses_post_deep( $metadata );
|
||||
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ function wp_prepare_themes_for_js( $themes = null ) {
|
||||
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
|
||||
$customize_action = esc_url( add_query_arg(
|
||||
array(
|
||||
'return' => urlencode( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
|
||||
'return' => urlencode( esc_url_raw( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),
|
||||
),
|
||||
wp_customize_url( $slug )
|
||||
) );
|
||||
|
||||
+1
-15
@@ -334,6 +334,7 @@ switch($step) {
|
||||
|
||||
$scripts_to_print[] = 'user-profile';
|
||||
|
||||
display_header();
|
||||
// Fill in the data we gathered
|
||||
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
|
||||
$user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
|
||||
@@ -346,26 +347,21 @@ switch($step) {
|
||||
$error = false;
|
||||
if ( empty( $user_name ) ) {
|
||||
// TODO: poka-yoke
|
||||
display_header();
|
||||
display_setup_form( __( 'Please provide a valid username.' ) );
|
||||
$error = true;
|
||||
} elseif ( $user_name != sanitize_user( $user_name, true ) ) {
|
||||
display_header();
|
||||
display_setup_form( __( 'The username you provided has invalid characters.' ) );
|
||||
$error = true;
|
||||
} elseif ( $admin_password != $admin_password_check ) {
|
||||
// TODO: poka-yoke
|
||||
display_header();
|
||||
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
|
||||
$error = true;
|
||||
} elseif ( empty( $admin_email ) ) {
|
||||
// TODO: poka-yoke
|
||||
display_header();
|
||||
display_setup_form( __( 'You must provide an email address.' ) );
|
||||
$error = true;
|
||||
} elseif ( ! is_email( $admin_email ) ) {
|
||||
// TODO: poka-yoke
|
||||
display_header();
|
||||
display_setup_form( __( 'Sorry, that isn’t a valid email address. Email addresses look like <code>username@example.com</code>.' ) );
|
||||
$error = true;
|
||||
}
|
||||
@@ -373,16 +369,6 @@ switch($step) {
|
||||
if ( $error === false ) {
|
||||
$wpdb->show_errors();
|
||||
$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
|
||||
|
||||
// Log the user in and send them to wp-admin:
|
||||
if ( ! headers_sent() ) {
|
||||
wp_set_auth_cookie( $result['user_id'], true, is_ssl() );
|
||||
wp_redirect( admin_url() );
|
||||
exit;
|
||||
}
|
||||
|
||||
// If headers have already been sent, fall back to a "Success!" message:
|
||||
display_header();
|
||||
?>
|
||||
|
||||
<h1><?php _e( 'Success!' ); ?></h1>
|
||||
|
||||
@@ -528,10 +528,11 @@
|
||||
*
|
||||
* @since 4.1.0
|
||||
*
|
||||
* @param {Boolean} active
|
||||
* @param {Object} args
|
||||
* @param {Object} args.duration
|
||||
* @param {Object} args.completeCallback
|
||||
* @param {boolean} active - The active state to transiution to.
|
||||
* @param {Object} [args] - Args.
|
||||
* @param {Object} [args.duration] - The duration for the slideUp/slideDown animation.
|
||||
* @param {boolean} [args.unchanged] - Whether the state is already known to not be changed, and so short-circuit with calling completeCallback early.
|
||||
* @param {Function} [args.completeCallback] - Function to call when the slideUp/slideDown has completed.
|
||||
*/
|
||||
onChangeActive: function( active, args ) {
|
||||
var construct = this,
|
||||
@@ -564,24 +565,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $.contains( document, headContainer ) ) {
|
||||
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
|
||||
if ( ! $.contains( document, headContainer.get( 0 ) ) ) {
|
||||
// If the element is not in the DOM, then jQuery.fn.slideUp() does nothing. In this case, a hard toggle is required instead.
|
||||
headContainer.toggle( active );
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
} else if ( active ) {
|
||||
headContainer.stop( true, true ).slideDown( duration, args.completeCallback );
|
||||
headContainer.slideDown( duration, args.completeCallback );
|
||||
} else {
|
||||
if ( construct.expanded() ) {
|
||||
construct.collapse({
|
||||
duration: duration,
|
||||
completeCallback: function() {
|
||||
headContainer.stop( true, true ).slideUp( duration, args.completeCallback );
|
||||
headContainer.slideUp( duration, args.completeCallback );
|
||||
}
|
||||
});
|
||||
} else {
|
||||
headContainer.stop( true, true ).slideUp( duration, args.completeCallback );
|
||||
headContainer.slideUp( duration, args.completeCallback );
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -710,11 +711,19 @@
|
||||
var construct = this,
|
||||
content = construct.contentContainer,
|
||||
overlay = content.closest( '.wp-full-overlay' ),
|
||||
elements, transitionEndCallback;
|
||||
elements, transitionEndCallback, transitionParentPane;
|
||||
|
||||
// Determine set of elements that are affected by the animation.
|
||||
elements = overlay.add( content );
|
||||
if ( _.isUndefined( construct.panel ) || '' === construct.panel() ) {
|
||||
|
||||
if ( ! construct.panel || '' === construct.panel() ) {
|
||||
transitionParentPane = true;
|
||||
} else if ( api.panel( construct.panel() ).contentContainer.hasClass( 'skip-transition' ) ) {
|
||||
transitionParentPane = true;
|
||||
} else {
|
||||
transitionParentPane = false;
|
||||
}
|
||||
if ( transitionParentPane ) {
|
||||
elements = elements.add( '#customize-info, .customize-pane-parent' );
|
||||
}
|
||||
|
||||
@@ -995,7 +1004,7 @@
|
||||
overlay = section.headContainer.closest( '.wp-full-overlay' ),
|
||||
backBtn = content.find( '.customize-section-back' ),
|
||||
sectionTitle = section.headContainer.find( '.accordion-section-title' ).first(),
|
||||
expand;
|
||||
expand, panel;
|
||||
|
||||
if ( expanded && ! content.hasClass( 'open' ) ) {
|
||||
|
||||
@@ -1043,6 +1052,12 @@
|
||||
}
|
||||
|
||||
} else if ( ! expanded && content.hasClass( 'open' ) ) {
|
||||
if ( section.panel() ) {
|
||||
panel = api.panel( section.panel() );
|
||||
if ( panel.contentContainer.hasClass( 'skip-transition' ) ) {
|
||||
panel.collapse();
|
||||
}
|
||||
}
|
||||
section._animateChangeExpanded( function() {
|
||||
backBtn.attr( 'tabindex', '-1' );
|
||||
sectionTitle.attr( 'tabindex', '0' );
|
||||
@@ -1721,7 +1736,9 @@
|
||||
overlay = accordionSection.closest( '.wp-full-overlay' ),
|
||||
container = accordionSection.closest( '.wp-full-overlay-sidebar-content' ),
|
||||
topPanel = panel.headContainer.find( '.accordion-section-title' ),
|
||||
backBtn = accordionSection.find( '.customize-panel-back' );
|
||||
backBtn = accordionSection.find( '.customize-panel-back' ),
|
||||
childSections = panel.sections(),
|
||||
skipTransition;
|
||||
|
||||
if ( expanded && ! accordionSection.hasClass( 'current-panel' ) ) {
|
||||
// Collapse any sibling sections/panels
|
||||
@@ -1736,35 +1753,50 @@
|
||||
}
|
||||
});
|
||||
|
||||
panel._animateChangeExpanded( function() {
|
||||
topPanel.attr( 'tabindex', '-1' );
|
||||
backBtn.attr( 'tabindex', '0' );
|
||||
if ( panel.params.autoExpandSoleSection && 1 === childSections.length && childSections[0].active.get() ) {
|
||||
accordionSection.addClass( 'current-panel skip-transition' );
|
||||
overlay.addClass( 'in-sub-panel' );
|
||||
|
||||
backBtn.focus();
|
||||
accordionSection.css( 'top', '' );
|
||||
container.scrollTop( 0 );
|
||||
childSections[0].expand( {
|
||||
completeCallback: args.completeCallback
|
||||
} );
|
||||
} else {
|
||||
panel._animateChangeExpanded( function() {
|
||||
topPanel.attr( 'tabindex', '-1' );
|
||||
backBtn.attr( 'tabindex', '0' );
|
||||
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
} );
|
||||
backBtn.focus();
|
||||
accordionSection.css( 'top', '' );
|
||||
container.scrollTop( 0 );
|
||||
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
} );
|
||||
|
||||
accordionSection.addClass( 'current-panel' );
|
||||
overlay.addClass( 'in-sub-panel' );
|
||||
}
|
||||
|
||||
overlay.addClass( 'in-sub-panel' );
|
||||
accordionSection.addClass( 'current-panel' );
|
||||
api.state( 'expandedPanel' ).set( panel );
|
||||
|
||||
} else if ( ! expanded && accordionSection.hasClass( 'current-panel' ) ) {
|
||||
panel._animateChangeExpanded( function() {
|
||||
topPanel.attr( 'tabindex', '0' );
|
||||
backBtn.attr( 'tabindex', '-1' );
|
||||
skipTransition = accordionSection.hasClass( 'skip-transition' );
|
||||
if ( ! skipTransition ) {
|
||||
panel._animateChangeExpanded( function() {
|
||||
topPanel.attr( 'tabindex', '0' );
|
||||
backBtn.attr( 'tabindex', '-1' );
|
||||
|
||||
topPanel.focus();
|
||||
accordionSection.css( 'top', '' );
|
||||
topPanel.focus();
|
||||
accordionSection.css( 'top', '' );
|
||||
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
} );
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
accordionSection.removeClass( 'skip-transition' );
|
||||
}
|
||||
|
||||
overlay.removeClass( 'in-sub-panel' );
|
||||
accordionSection.removeClass( 'current-panel' );
|
||||
@@ -2266,9 +2298,9 @@
|
||||
availableItem = new api.Menus.AvailableItemModel( {
|
||||
'id': 'post-' + data.post_id, // Used for available menu item Backbone models.
|
||||
'title': title,
|
||||
'type': 'page',
|
||||
'type': 'post_type',
|
||||
'type_label': api.Menus.data.l10n.page_label,
|
||||
'object': 'post_type',
|
||||
'object': 'page',
|
||||
'object_id': data.post_id,
|
||||
'url': data.url
|
||||
} );
|
||||
@@ -4122,7 +4154,7 @@
|
||||
|
||||
// Remove notification errors that are no longer valid.
|
||||
setting.notifications.each( function( notification ) {
|
||||
if ( 'error' === notification.type && ( true === validity || ! validity[ notification.code ] ) ) {
|
||||
if ( notification.fromServer && 'error' === notification.type && ( true === validity || ! validity[ notification.code ] ) ) {
|
||||
setting.notifications.remove( notification.code );
|
||||
}
|
||||
} );
|
||||
@@ -4730,6 +4762,12 @@
|
||||
*/
|
||||
populateChangesetUuidParam = function( isIncluded ) {
|
||||
var urlParser, queryParams;
|
||||
|
||||
// Abort on IE9 which doesn't support history management.
|
||||
if ( ! history.replaceState ) {
|
||||
return;
|
||||
}
|
||||
|
||||
urlParser = document.createElement( 'a' );
|
||||
urlParser.href = location.href;
|
||||
queryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) );
|
||||
@@ -4748,11 +4786,9 @@
|
||||
history.replaceState( {}, document.title, urlParser.href );
|
||||
};
|
||||
|
||||
if ( history.replaceState ) {
|
||||
changesetStatus.bind( function( newStatus ) {
|
||||
populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus );
|
||||
} );
|
||||
}
|
||||
changesetStatus.bind( function( newStatus ) {
|
||||
populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus );
|
||||
} );
|
||||
|
||||
// Expose states to the API.
|
||||
api.state = state;
|
||||
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
!function(a,b){var c,d,e,f=wp.customize;f.Setting=f.Value.extend({initialize:function(a,b,c){var d=this;f.Value.prototype.initialize.call(d,b,c),d.id=a,d.transport=d.transport||"refresh",d._dirty=c.dirty||!1,d.notifications=new f.Values({defaultConstructor:f.Notification}),d.bind(d.preview)},preview:function(){var a,b=this;a=b.transport,"postMessage"!==a||f.state("previewerAlive").get()||(a="refresh"),"postMessage"===a?b.previewer.send("setting",[b.id,b()]):"refresh"===a&&b.previewer.refresh()},findControls:function(){var a=this,b=[];return f.control.each(function(c){_.each(c.settings,function(d){d.id===a.id&&b.push(c)})}),b}}),f._latestRevision=0,f._lastSavedRevision=0,f._latestSettingRevisions={},f.bind("change",function(a){f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision}),f.bind("ready",function(){f.bind("add",function(a){a._dirty&&(f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision)})}),f.dirtyValues=function(a){var b={};return f.each(function(c){var d;c._dirty&&(d=f._latestSettingRevisions[c.id],f.state("changesetStatus").get()&&a&&a.unsaved&&(_.isUndefined(d)||d<=f._lastSavedRevision)||(b[c.id]=c.get()))}),b},f.requestChangesetUpdate=function(a){var c,d,e,g={};return c=new b.Deferred,a&&_.extend(g,a),_.each(f.dirtyValues({unsaved:!0}),function(b,c){a&&null===a[c]||(g[c]=_.extend({},g[c]||{},{value:b}))}),_.isEmpty(g)?(c.resolve({}),c.promise()):(f.state("processing").set(f.state("processing").get()+1),c.always(function(){f.state("processing").set(f.state("processing").get()-1)}),f.trigger("changeset-save",g),e=f.previewer.query({excludeCustomizedSaved:!0}),delete e.customized,_.extend(e,{nonce:f.settings.nonce.save,customize_theme:f.settings.theme.stylesheet,customize_changeset_data:JSON.stringify(g)}),d=wp.ajax.post("customize_save",e),d.done(function(a){var b={};f._lastSavedRevision=Math.max(f._latestRevision,f._lastSavedRevision),f.state("changesetStatus").set(a.changeset_status),c.resolve(a),f.trigger("changeset-saved",a),a.setting_validities&&_.each(a.setting_validities,function(a,c){!0===a&&_.isObject(g[c])&&!_.isUndefined(g[c].value)&&(b[c]=g[c].value)}),f.previewer.send("changeset-saved",_.extend({},a,{saved_changeset_values:b}))}),d.fail(function(a){c.reject(a),f.trigger("changeset-error",a)}),d.always(function(a){a.setting_validities&&f._handleSettingValidities({settingValidities:a.setting_validities})}),c.promise())},f.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){var b,c,d,e;b=this,a=a||{},d=function(){var a;a=(b.extended(f.Panel)||b.extended(f.Section))&&b.expanded&&b.expanded()?b.contentContainer:b.container,e=a.find(".control-focus:first"),0===e.length&&(e=a.find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible").first()),e.focus()},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,f.state("paneVisible").set(!0),b.expand?b.expand(a):a.completeCallback()},f.utils.prioritySort=function(a,b){return a.priority()===b.priority()&&"number"==typeof a.params.instanceNumber&&"number"==typeof b.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},f.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},f.utils.areElementListsEqual=function(a,c){var d=a.length===c.length&&-1===_.indexOf(_.map(_.zip(a,c),function(a){return b(a[0]).is(a[1])}),!1);return d},e=function(){var a,b,c;return a=document.createElement("div"),b={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},c=_.find(_.keys(b),function(b){return!_.isUndefined(a.style[b])}),c?b[c]:null}(),c=f.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},containerType:"container",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null},initialize:function(a,c){var d=this;d.id=a,c=c||{},c.params=_.defaults(c.params||{},d.defaults),b.extend(d,c),d.templateSelector="customize-"+d.containerType+"-"+d.params.type,d.container=b(d.params.content),0===d.container.length&&(d.container=b(d.getContainer())),d.headContainer=d.container,d.contentContainer=d.getContent(),d.container=d.container.add(d.contentContainer),d.deferred={embedded:new b.Deferred},d.priority=new f.Value,d.active=new f.Value,d.activeArgumentsQueue=[],d.expanded=new f.Value,d.expandedArgumentsQueue=[],d.active.bind(function(a){var c=d.activeArgumentsQueue.shift();c=b.extend({},d.defaultActiveArguments,c),a=a&&d.isContextuallyActive(),d.onChangeActive(a,c)}),d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.deferred.embedded.done(function(){d.attachEvents()}),f.utils.bubbleChildValueChanLine truncated
|
||||
initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.SiteIconCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON(),b=this;this.params.width!==a.width||this.params.height!==a.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):wp.ajax.post("crop-image",{nonce:a.nonces.edit,id:a.id,context:"site-icon",cropDetails:{x1:0,y1:0,width:this.params.width,height:this.params.height,dst_width:this.params.width,dst_height:this.params.height}}).done(function(a){b.setImageFromAttachment(a),b.frame.close()}).fail(function(){b.frame.trigger("content:error:crop")})},setImageFromAttachment:function(a){var c,d,e=["site_icon-32","thumbnail","full"];_.each(e,function(b){d||_.isUndefined(a.sizes[b])||(d=a.sizes[b])}),this.params.attachment=a,this.setting(a.id),d&&(c=b('link[rel="icon"][sizes="32x32"]'),c.attr("href",d.url))},removeFile:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent(),b('link[rel="icon"][sizes="32x32"]').attr("href","/favicon.ico"))}}),f.HeaderControl=f.Control.extend({ready:function(){this.btnRemove=b("#customize-control-header_image .actions .remove"),this.btnNew=b("#customize-control-header_image .actions .new"),_.bindAll(this,"openMedia","removeImage"),this.btnNew.on("click",this.openMedia),this.btnRemove.on("click",this.removeImage),f.HeaderTool.currentHeader=this.getInitialHeaderImage(),new f.HeaderTool.CurrentView({model:f.HeaderTool.currentHeader,el:"#customize-control-header_image .current .container"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.UploadsList=new f.HeaderTool.ChoiceList,el:"#customize-control-header_image .choices .uploaded .list"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.DefaultsList=new f.HeaderTool.DefaultsList,el:"#customize-control-header_image .choices .default .list"}),f.HeaderTool.combinedList=f.HeaderTool.CombinedList=new f.HeaderTool.CombinedList([f.HeaderTool.UploadsList,f.HeaderTool.DefaultsList]),wp.media.controller.Cropper.prototype.defaults.doCropArgs.wp_customize="on",wp.media.controller.Cropper.prototype.defaults.doCropArgs.customize_theme=f.settings.theme.stylesheet},getInitialHeaderImage:function(){if(!f.get().header_image||!f.get().header_image_data||_.contains(["remove-header","random-default-image","random-uploaded-image"],f.get().header_image))return new f.HeaderTool.ImageModel;var a=_.find(_wpCustomizeHeader.uploads,function(a){return a.attachment_id===f.get().header_image_data.attachment_id});return a||(a={url:f.get().header_image,thumbnail_url:f.get().header_image,attachment_id:f.get().header_image_data.attachment_id}),new f.HeaderTool.ImageModel({header:a,choice:a.url.split("/").pop()})},calculateImageSelectOptions:function(a,b){var c,d,e,g,h,i,j=parseInt(_wpCustomizeHeader.data.width,10),k=parseInt(_wpCustomizeHeader.data.height,10),l=!!parseInt(_wpCustomizeHeader.data["flex-width"],10),m=!!parseInt(_wpCustomizeHeader.data["flex-height"],10);return h=a.get("width"),g=a.get("height"),this.headerImage=new f.HeaderTool.ImageModel,this.headerImage.set({themeWidth:j,themeHeight:k,themeFlexWidth:l,themeFlexHeight:m,imageWidth:h,imageHeight:g}),b.set("canSkipCrop",!this.headerImage.shouldBeCropped()),c=j/k,d=h,e=g,d/e>c?(k=e,j=k*c):(j=d,k=j/c),i={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:h,imageHeight:g,x1:0,y1:0,x2:j,y2:k},m===!1&&l===!1&&(i.aspectRatio=j+":"+k),m===!1&&(i.maxHeight=k),l===!1&&(i.maxWidth=j),i},openMedia:function(a){var b=_wpMediaViewsL10n;a.preventDefault(),this.frame=wp.media({button:{text:b.selectAndCrop,close:!1},states:[new wp.media.controller.Library({title:b.chooseImage,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:_wpCustomizeHeader.data.width,suggestedHeight:_wpCustomizeHeader.data.height}),new wp.media.controller.Cropper({imgSelectOptions:this.calculateImageSelectOptions})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this),this.frame.open()},onSelect:function(){this.frame.setState("cropper")},onCropped:function(a){var b=a.url,c=a.attachment_id,d=a.width,e=a.height;this.setImageFromURL(b,c,d,e)},onSkippedCrop:function(a){var b=a.get("url"),c=a.get("width"),d=a.get("height");this.setImageFromURL(b,a.id,c,d)},setImageFromURL:function(a,b,c,d){var e,g={};g.url=a,g.thumbnail_url=a,g.timestamp=_.now(),b&&(g.attachment_id=b),c&Line truncated
|
||||
}})}(wp,jQuery);
|
||||
!function(a,b){var c,d,e,f=wp.customize;f.Setting=f.Value.extend({initialize:function(a,b,c){var d=this;f.Value.prototype.initialize.call(d,b,c),d.id=a,d.transport=d.transport||"refresh",d._dirty=c.dirty||!1,d.notifications=new f.Values({defaultConstructor:f.Notification}),d.bind(d.preview)},preview:function(){var a,b=this;a=b.transport,"postMessage"!==a||f.state("previewerAlive").get()||(a="refresh"),"postMessage"===a?b.previewer.send("setting",[b.id,b()]):"refresh"===a&&b.previewer.refresh()},findControls:function(){var a=this,b=[];return f.control.each(function(c){_.each(c.settings,function(d){d.id===a.id&&b.push(c)})}),b}}),f._latestRevision=0,f._lastSavedRevision=0,f._latestSettingRevisions={},f.bind("change",function(a){f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision}),f.bind("ready",function(){f.bind("add",function(a){a._dirty&&(f._latestRevision+=1,f._latestSettingRevisions[a.id]=f._latestRevision)})}),f.dirtyValues=function(a){var b={};return f.each(function(c){var d;c._dirty&&(d=f._latestSettingRevisions[c.id],f.state("changesetStatus").get()&&a&&a.unsaved&&(_.isUndefined(d)||d<=f._lastSavedRevision)||(b[c.id]=c.get()))}),b},f.requestChangesetUpdate=function(a){var c,d,e,g={};return c=new b.Deferred,a&&_.extend(g,a),_.each(f.dirtyValues({unsaved:!0}),function(b,c){a&&null===a[c]||(g[c]=_.extend({},g[c]||{},{value:b}))}),_.isEmpty(g)?(c.resolve({}),c.promise()):(f.state("processing").set(f.state("processing").get()+1),c.always(function(){f.state("processing").set(f.state("processing").get()-1)}),f.trigger("changeset-save",g),e=f.previewer.query({excludeCustomizedSaved:!0}),delete e.customized,_.extend(e,{nonce:f.settings.nonce.save,customize_theme:f.settings.theme.stylesheet,customize_changeset_data:JSON.stringify(g)}),d=wp.ajax.post("customize_save",e),d.done(function(a){var b={};f._lastSavedRevision=Math.max(f._latestRevision,f._lastSavedRevision),f.state("changesetStatus").set(a.changeset_status),c.resolve(a),f.trigger("changeset-saved",a),a.setting_validities&&_.each(a.setting_validities,function(a,c){!0===a&&_.isObject(g[c])&&!_.isUndefined(g[c].value)&&(b[c]=g[c].value)}),f.previewer.send("changeset-saved",_.extend({},a,{saved_changeset_values:b}))}),d.fail(function(a){c.reject(a),f.trigger("changeset-error",a)}),d.always(function(a){a.setting_validities&&f._handleSettingValidities({settingValidities:a.setting_validities})}),c.promise())},f.utils.bubbleChildValueChanges=function(a,c){b.each(c,function(b,c){a[c].bind(function(b,c){a.parent&&b!==c&&a.parent.trigger("change",a)})})},d=function(a){var b,c,d,e;b=this,a=a||{},d=function(){var a;a=(b.extended(f.Panel)||b.extended(f.Section))&&b.expanded&&b.expanded()?b.contentContainer:b.container,e=a.find(".control-focus:first"),0===e.length&&(e=a.find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible").first()),e.focus()},a.completeCallback?(c=a.completeCallback,a.completeCallback=function(){d(),c()}):a.completeCallback=d,f.state("paneVisible").set(!0),b.expand?b.expand(a):a.completeCallback()},f.utils.prioritySort=function(a,b){return a.priority()===b.priority()&&"number"==typeof a.params.instanceNumber&&"number"==typeof b.params.instanceNumber?a.params.instanceNumber-b.params.instanceNumber:a.priority()-b.priority()},f.utils.isKeydownButNotEnterEvent=function(a){return"keydown"===a.type&&13!==a.which},f.utils.areElementListsEqual=function(a,c){var d=a.length===c.length&&-1===_.indexOf(_.map(_.zip(a,c),function(a){return b(a[0]).is(a[1])}),!1);return d},e=function(){var a,b,c;return a=document.createElement("div"),b={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},c=_.find(_.keys(b),function(b){return!_.isUndefined(a.style[b])}),c?b[c]:null}(),c=f.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:b.noop},defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},containerType:"container",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null},initialize:function(a,c){var d=this;d.id=a,c=c||{},c.params=_.defaults(c.params||{},d.defaults),b.extend(d,c),d.templateSelector="customize-"+d.containerType+"-"+d.params.type,d.container=b(d.params.content),0===d.container.length&&(d.container=b(d.getContainer())),d.headContainer=d.container,d.contentContainer=d.getContent(),d.container=d.container.add(d.contentContainer),d.deferred={embedded:new b.Deferred},d.priority=new f.Value,d.active=new f.Value,d.activeArgumentsQueue=[],d.expanded=new f.Value,d.expandedArgumentsQueue=[],d.active.bind(function(a){var c=d.activeArgumentsQueue.shift();c=b.extend({},d.defaultActiveArguments,c),a=a&&d.isContextuallyActive(),d.onChangeActive(a,c)}),d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.deferred.embedded.done(function(){d.attachEvents()}),f.utils.bubbleChildValueChanLine truncated
|
||||
e.maxWidth=i),!0===g&&(delete e.minWidth,e.maxHeight=j),e},mustBeCropped:function(a,b,c,d,e,f){return(!0!==a||!0!==b)&&((!0!==a||d!==f)&&((!0!==b||c!==e)&&((c!==e||d!==f)&&!(e<=c))))},onSkippedCrop:function(){var a=this.frame.state().get("selection").first().toJSON();this.setImageFromAttachment(a)},setImageFromAttachment:function(a){this.params.attachment=a,this.setting(a.id)}}),f.SiteIconControl=f.CroppedImageControl.extend({initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.SiteIconCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON(),b=this;this.params.width!==a.width||this.params.height!==a.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):wp.ajax.post("crop-image",{nonce:a.nonces.edit,id:a.id,context:"site-icon",cropDetails:{x1:0,y1:0,width:this.params.width,height:this.params.height,dst_width:this.params.width,dst_height:this.params.height}}).done(function(a){b.setImageFromAttachment(a),b.frame.close()}).fail(function(){b.frame.trigger("content:error:crop")})},setImageFromAttachment:function(a){var c,d,e=["site_icon-32","thumbnail","full"];_.each(e,function(b){d||_.isUndefined(a.sizes[b])||(d=a.sizes[b])}),this.params.attachment=a,this.setting(a.id),d&&(c=b('link[rel="icon"][sizes="32x32"]'),c.attr("href",d.url))},removeFile:function(a){f.utils.isKeydownButNotEnterEvent(a)||(a.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent(),b('link[rel="icon"][sizes="32x32"]').attr("href","/favicon.ico"))}}),f.HeaderControl=f.Control.extend({ready:function(){this.btnRemove=b("#customize-control-header_image .actions .remove"),this.btnNew=b("#customize-control-header_image .actions .new"),_.bindAll(this,"openMedia","removeImage"),this.btnNew.on("click",this.openMedia),this.btnRemove.on("click",this.removeImage),f.HeaderTool.currentHeader=this.getInitialHeaderImage(),new f.HeaderTool.CurrentView({model:f.HeaderTool.currentHeader,el:"#customize-control-header_image .current .container"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.UploadsList=new f.HeaderTool.ChoiceList,el:"#customize-control-header_image .choices .uploaded .list"}),new f.HeaderTool.ChoiceListView({collection:f.HeaderTool.DefaultsList=new f.HeaderTool.DefaultsList,el:"#customize-control-header_image .choices .default .list"}),f.HeaderTool.combinedList=f.HeaderTool.CombinedList=new f.HeaderTool.CombinedList([f.HeaderTool.UploadsList,f.HeaderTool.DefaultsList]),wp.media.controller.Cropper.prototype.defaults.doCropArgs.wp_customize="on",wp.media.controller.Cropper.prototype.defaults.doCropArgs.customize_theme=f.settings.theme.stylesheet},getInitialHeaderImage:function(){if(!f.get().header_image||!f.get().header_image_data||_.contains(["remove-header","random-default-image","random-uploaded-image"],f.get().header_image))return new f.HeaderTool.ImageModel;var a=_.find(_wpCustomizeHeader.uploads,function(a){return a.attachment_id===f.get().header_image_data.attachment_id});return a||(a={url:f.get().header_image,thumbnail_url:f.get().header_image,attachment_id:f.get().header_image_data.attachment_id}),new f.HeaderTool.ImageModel({header:a,choice:a.url.split("/").pop()})},calculateImageSelectOptions:function(a,b){var c,d,e,g,h,i,j=parseInt(_wpCustomizeHeader.data.width,10),k=parseInt(_wpCustomizeHeader.data.height,10),l=!!parseInt(_wpCustomizeHeader.data["flex-width"],10),m=!!parseInt(_wpCustomizeHeader.data["flex-height"],10);return h=a.get("width"),g=a.get("height"),this.headerImage=new f.HeaderTool.ImageModel,this.headerImage.set({themeWidth:j,themeHeight:k,themeFlexWidth:l,themeFlexHeight:m,imageWidth:h,imageHeight:g}),b.set("canSkipCrop",!this.headerImage.shouldBeCropped()),c=j/k,d=h,e=g,d/e>c?(k=e,j=k*c):(j=d,k=j/c),i={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:h,imageHeight:g,x1:0,y1:0,x2:j,y2:k},m===!1&&l===!1&&(i.aspectRatio=j+":"+k),m===!1&&(i.maxHeight=k),l===!1&&(i.maxWidth=j),i},openMedia:function(a){var b=_wpMediaViewsL10n;a.preventDefault(),this.frame=wp.media({button:{text:b.selectAndCrop,close:!1},states:[new wp.media.controller.Library({title:b.chooseImage,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:_wpCustomizeHeader.data.width,suggestedHeight:_wpCustomizeHeader.data.height}),new wp.media.controller.Cropper({imgSelectOptions:this.calculateImageSelectOptions})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",Line truncated
|
||||
f.previewer.send("edit-shortcut-visibility",a)}),function(){var a,c,d,e=!1;c=function(){e||(e=!0,f.requestChangesetUpdate().always(function(){e=!1})),d()},d=function(){clearTimeout(a),a=setTimeout(function(){c()},f.settings.timeouts.changesetAutoSave)},d(),b(window).on("blur.wp-customize-changeset-update",function(){c()}),b(window).on("beforeunload.wp-customize-changeset-update",function(){c()})}(),f.trigger("ready")}})}(wp,jQuery);
|
||||
@@ -1323,7 +1323,14 @@
|
||||
this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var menuControl = control.getMenuControl();
|
||||
var menuControl = control.getMenuControl(),
|
||||
isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ),
|
||||
isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' );
|
||||
|
||||
if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) {
|
||||
api.Menus.availableMenuItemsPanel.close();
|
||||
}
|
||||
|
||||
if ( menuControl.isReordering || menuControl.isSorting ) {
|
||||
return;
|
||||
}
|
||||
@@ -2214,7 +2221,7 @@
|
||||
}
|
||||
} );
|
||||
|
||||
control.container.find( '.menu-delete' ).on( 'click', function( event ) {
|
||||
control.container.find( '.menu-delete-item' ).on( 'click', function( event ) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
control.setting.set( false );
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
!function(a,b,c){"use strict";function d(a){return"nav_menu_item["+a+"]"}function e(b){return b=b||"",b=c("<div>").text(b).html(),b=c.trim(b),b||a.Menus.data.l10n.unnamed}wpNavMenu.originalInit=wpNavMenu.init,wpNavMenu.options.menuItemDepthPerLevel=20,wpNavMenu.options.sortableItems="> .customize-control-nav_menu_item",wpNavMenu.options.targetTolerance=10,wpNavMenu.init=function(){this.jQueryExtensions()},a.Menus=a.Menus||{},a.Menus.data={itemTypes:[],l10n:{},settingTransport:"refresh",phpIntMax:0,defaultSettingValues:{nav_menu:{},nav_menu_item:{}},locationSlugMappedToName:{}},"undefined"!=typeof _wpCustomizeNavMenusSettings&&c.extend(a.Menus.data,_wpCustomizeNavMenusSettings),a.Menus.generatePlaceholderAutoIncrementId=function(){return-Math.ceil(a.Menus.data.phpIntMax*Math.random())},a.Menus.AvailableItemModel=Backbone.Model.extend(c.extend({id:null},a.Menus.data.defaultSettingValues.nav_menu_item)),a.Menus.AvailableItemCollection=Backbone.Collection.extend({model:a.Menus.AvailableItemModel,sort_key:"order",comparator:function(a){return-a.get(this.sort_key)},sortByField:function(a){this.sort_key=a,this.sort()}}),a.Menus.availableMenuItems=new a.Menus.AvailableItemCollection(a.Menus.data.availableMenuItems),a.Menus.insertAutoDraftPost=function(d){var e,f=c.Deferred();return e=b.ajax.post("customize-nav-menus-insert-auto-draft",{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",params:d}),e.done(function(b){b.post_id&&(a("nav_menus_created_posts").set(a("nav_menus_created_posts").get().concat([b.post_id])),"page"===d.post_type&&(a.section.has("static_front_page")&&a.section("static_front_page").activate(),a.control.each(function(a){var c;"dropdown-pages"===a.params.type&&(c=a.container.find('select[name^="_customize-dropdown-pages-"]'),c.append(new Option(d.post_title,b.post_id)))})),f.resolve(b))}),e.fail(function(a){var b=a||"";"undefined"!=typeof a.message&&(b=a.message),console.error(b),f.rejectWith(b)}),f.promise()},a.Menus.AvailableMenuItemsPanelView=b.Backbone.View.extend({el:"#available-menu-items",events:{"input #menu-items-search":"debounceSearch","keyup #menu-items-search":"debounceSearch","focus .menu-item-tpl":"focus","click .menu-item-tpl":"_submit","click #custom-menu-item-submit":"_submitLink","keypress #custom-menu-item-name":"_submitLink","click .new-content-item .add-content":"_submitNew","keypress .create-item-input":"_submitNew",keydown:"keyboardAccessible"},selected:null,currentMenuControl:null,debounceSearch:null,$search:null,$clearResults:null,searchTerm:"",rendered:!1,pages:{},sectionContent:"",loading:!1,addingNew:!1,initialize:function(){var b=this;a.panel.has("nav_menus")&&(this.$search=c("#menu-items-search"),this.$clearResults=this.$el.find(".clear-results"),this.sectionContent=this.$el.find(".available-menu-items-list"),this.debounceSearch=_.debounce(b.search,500),_.bindAll(this,"close"),c("#customize-controls, .customize-section-back").on("click keydown",function(a){var d=c(a.target).is(".item-delete, .item-delete *"),e=c(a.target).is(".add-new-menu-item, .add-new-menu-item *");!c("body").hasClass("adding-menu-items")||d||e||b.close()}),this.$clearResults.on("click",function(){b.$search.val("").focus().trigger("keyup")}),this.$el.on("input","#custom-menu-item-name.invalid, #custom-menu-item-url.invalid",function(){c(this).removeClass("invalid")}),a.panel("nav_menus").container.bind("expanded",function(){b.rendered||(b.initList(),b.rendered=!0)}),this.sectionContent.scroll(function(){var a=b.$el.find(".accordion-section.open .available-menu-items-list").prop("scrollHeight"),d=b.$el.find(".accordion-section.open").height();if(!b.loading&&c(this).scrollTop()>.75*a-d){var e=c(this).data("type"),f=c(this).data("object");"search"===e?b.searchTerm&&b.doSearch(b.pages.search):b.loadItems([{type:e,object:f}])}}),a.previewer.bind("url",this.close),b.delegateEvents())},search:function(a){var b=c("#available-menu-items-search"),d=c("#available-menu-items .accordion-section").not(b);a&&this.searchTerm!==a.target.value&&(""===a.target.value||b.hasClass("open")?""===a.target.value&&(b.removeClass("open"),d.show(),this.$clearResults.removeClass("is-visible")):(d.fadeOut(100),b.find(".accordion-section-content").slideDown("fast"),b.addClass("open"),this.$clearResults.addClass("is-visible")),this.searchTerm=a.target.value,this.pages.search=1,this.doSearch(1))},doSearch:function(d){var e,f=this,g=c("#available-menu-items-search"),h=g.find(".accordion-section-content"),i=b.template("available-menu-item");if(f.currentRequest&&f.currentRequest.abort(),!(d<0)){if(d>1)g.addClass("loading-more"),h.attr("aria-busy","true"),b.a11y.speak(a.Menus.data.l10n.itemsLoadingMore);else if(""===f.searchTerm)return h.html(""),void b.a11y.speak("");g.addClass("loading"),f.loading=!0,e=a.previewer.query({excludeCustomizedSaved:!0}),_.extend(e,{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",search:f.searchTerm,page:d}),f.currentRequest=b.ajax.post("search-avLine truncated
|
||||
completeCallback:function(){e(),b.a11y.speak(a.Menus.data.l10n.menuDeleted),a.panel("nav_menus").focus()}}):e(),a.each(function(a){/^nav_menu\[/.test(a.id)&&!1!==a()&&(i+=1)}),a.control.each(function(b){if(b.extended(a.controlConstructor.widget_form)&&"nav_menu"===b.params.widget_id_base){var c=b.container.find("select");c.val()===String(h)&&c.prop("selectedIndex",0).trigger("change"),b.container.find(".nav-menu-widget-form-controls:first").toggle(0!==i),b.container.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),b.container.find("option[value="+String(h)+"]").remove()}}),f=c("#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )"),f.find(".nav-menu-widget-form-controls:first").toggle(0!==i),f.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),f.find("option[value="+String(h)+"]").remove()},_setupLocations:function(){var b=this;b.container.find(".assigned-menu-location").each(function(){var d,f,g=c(this),h=g.find("input[type=checkbox]"),i=a("nav_menu_locations["+h.data("location-id")+"]");f=function(b){var c=a("nav_menu["+String(b)+"]");b&&c&&c()?g.find(".theme-location-set").show().find("span").text(e(c().name)):g.find(".theme-location-set").hide()},d=new a.Element(h),d.set(i.get()===b.params.menu_id),h.on("change",function(){i.set(this.checked?b.params.menu_id:0)}),i.bind(function(a){d.set(a===b.params.menu_id),f(a)}),f(i.get())})},_setupTitle:function(){var b=this;b.setting.bind(function(d){if(d){var f=a.section(b.section()),g=b.params.menu_id,h=f.headContainer.find(".accordion-section-title"),i=f.contentContainer.find(".customize-section-title h3"),j=f.headContainer.find(".menu-in-location"),k=i.find(".customize-action"),l=e(d.name);h.text(l),j.length&&j.appendTo(h),i.text(l),k.length&&k.prependTo(i),a.control.each(function(a){/^nav_menu_locations\[/.test(a.id)&&a.container.find("option[value="+g+"]").text(l)}),f.contentContainer.find(".customize-control-checkbox input").each(function(){c(this).prop("checked")&&c(".current-menu-location-name-"+c(this).data("location-id")).text(l)})}})},toggleReordering:function(c){var d=this.container.find(".add-new-menu-item"),e=this.container.find(".reorder-toggle"),f=this.$sectionContent.find(".item-title");c=Boolean(c),c!==this.$sectionContent.hasClass("reordering")&&(this.isReordering=c,this.$sectionContent.toggleClass("reordering",c),this.$sectionContent.sortable(this.isReordering?"disable":"enable"),this.isReordering?(d.attr({tabindex:"-1","aria-hidden":"true"}),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOff),b.a11y.speak(a.Menus.data.l10n.reorderModeOn),f.attr("aria-hidden","false")):(d.removeAttr("tabindex aria-hidden"),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOn),b.a11y.speak(a.Menus.data.l10n.reorderModeOff),f.attr("aria-hidden","true")),c&&_(this.getMenuItemControls()).each(function(a){a.collapseForm()}))},getMenuItemControls:function(){var b=this,c=[],d=b.params.menu_id;return a.control.each(function(a){"nav_menu_item"===a.params.type&&a.setting()&&d===a.setting().nav_menu_term_id&&c.push(a)}),c},reflowMenuItems:function(){var a,b=this,c=b.getMenuItemControls();a=function(b){var c=[],d=b.currentParent;_.each(b.menuItemControls,function(a){d===a.setting().menu_item_parent&&c.push(a)}),c.sort(function(a,b){return a.setting().position-b.setting().position}),_.each(c,function(c){b.currentAbsolutePosition+=1,c.priority.set(b.currentAbsolutePosition),c.container.hasClass("menu-item-depth-"+String(b.currentDepth))||(_.each(c.container.prop("className").match(/menu-item-depth-\d+/g),function(a){c.container.removeClass(a)}),c.container.addClass("menu-item-depth-"+String(b.currentDepth))),c.container.data("item-depth",b.currentDepth),b.currentDepth+=1,b.currentParent=c.params.menu_item_id,a(b),b.currentDepth-=1,b.currentParent=d}),c.length&&(_(c).each(function(a){a.container.removeClass("move-up-disabled move-down-disabled move-left-disabled move-right-disabled"),0===b.currentDepth?a.container.addClass("move-left-disabled"):10===b.currentDepth&&a.container.addClass("move-right-disabled")}),c[0].container.addClass("move-up-disabled").addClass("move-right-disabled").toggleClass("move-down-disabled",1===c.length),c[c.length-1].container.addClass("move-down-disabled").toggleClass("move-up-disabled",1===c.length))},a({menuItemControls:c,currentParent:0,currentDepth:0,currentAbsolutePosition:0}),b.container.find(".reorder-toggle").toggle(c.length>1)},debouncedReflowMenuItems:_.debounce(function(){this.reflowMenuItems.apply(this,arguments)},0),addItemToMenu:function(d){var e,f,g,h,i,j=this,k=0,l=10;return _.each(j.getMenuItemControls(),function(a){!1!==a.setting()&&(l=Math.max(l,a.priority()),0===a.setting().menu_item_parent&&(k=Math.max(k,a.setting().position)))}),k+=1,l+=1,d=c.extend({},a.Menus.data.defaultSettingValues.nav_menu_item,d,{nav_menu_term_id:j.params.menu_id,original_title:d.title,position:k}),delete d.id,i=a.Menus.generatePlaceholderAutoIncrementId(),e="nav_menu_item["+String(i)+"]",f={type:"nav_mLine truncated
|
||||
!function(a,b,c){"use strict";function d(a){return"nav_menu_item["+a+"]"}function e(b){return b=b||"",b=c("<div>").text(b).html(),b=c.trim(b),b||a.Menus.data.l10n.unnamed}wpNavMenu.originalInit=wpNavMenu.init,wpNavMenu.options.menuItemDepthPerLevel=20,wpNavMenu.options.sortableItems="> .customize-control-nav_menu_item",wpNavMenu.options.targetTolerance=10,wpNavMenu.init=function(){this.jQueryExtensions()},a.Menus=a.Menus||{},a.Menus.data={itemTypes:[],l10n:{},settingTransport:"refresh",phpIntMax:0,defaultSettingValues:{nav_menu:{},nav_menu_item:{}},locationSlugMappedToName:{}},"undefined"!=typeof _wpCustomizeNavMenusSettings&&c.extend(a.Menus.data,_wpCustomizeNavMenusSettings),a.Menus.generatePlaceholderAutoIncrementId=function(){return-Math.ceil(a.Menus.data.phpIntMax*Math.random())},a.Menus.AvailableItemModel=Backbone.Model.extend(c.extend({id:null},a.Menus.data.defaultSettingValues.nav_menu_item)),a.Menus.AvailableItemCollection=Backbone.Collection.extend({model:a.Menus.AvailableItemModel,sort_key:"order",comparator:function(a){return-a.get(this.sort_key)},sortByField:function(a){this.sort_key=a,this.sort()}}),a.Menus.availableMenuItems=new a.Menus.AvailableItemCollection(a.Menus.data.availableMenuItems),a.Menus.insertAutoDraftPost=function(d){var e,f=c.Deferred();return e=b.ajax.post("customize-nav-menus-insert-auto-draft",{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",params:d}),e.done(function(b){b.post_id&&(a("nav_menus_created_posts").set(a("nav_menus_created_posts").get().concat([b.post_id])),"page"===d.post_type&&(a.section.has("static_front_page")&&a.section("static_front_page").activate(),a.control.each(function(a){var c;"dropdown-pages"===a.params.type&&(c=a.container.find('select[name^="_customize-dropdown-pages-"]'),c.append(new Option(d.post_title,b.post_id)))})),f.resolve(b))}),e.fail(function(a){var b=a||"";"undefined"!=typeof a.message&&(b=a.message),console.error(b),f.rejectWith(b)}),f.promise()},a.Menus.AvailableMenuItemsPanelView=b.Backbone.View.extend({el:"#available-menu-items",events:{"input #menu-items-search":"debounceSearch","keyup #menu-items-search":"debounceSearch","focus .menu-item-tpl":"focus","click .menu-item-tpl":"_submit","click #custom-menu-item-submit":"_submitLink","keypress #custom-menu-item-name":"_submitLink","click .new-content-item .add-content":"_submitNew","keypress .create-item-input":"_submitNew",keydown:"keyboardAccessible"},selected:null,currentMenuControl:null,debounceSearch:null,$search:null,$clearResults:null,searchTerm:"",rendered:!1,pages:{},sectionContent:"",loading:!1,addingNew:!1,initialize:function(){var b=this;a.panel.has("nav_menus")&&(this.$search=c("#menu-items-search"),this.$clearResults=this.$el.find(".clear-results"),this.sectionContent=this.$el.find(".available-menu-items-list"),this.debounceSearch=_.debounce(b.search,500),_.bindAll(this,"close"),c("#customize-controls, .customize-section-back").on("click keydown",function(a){var d=c(a.target).is(".item-delete, .item-delete *"),e=c(a.target).is(".add-new-menu-item, .add-new-menu-item *");!c("body").hasClass("adding-menu-items")||d||e||b.close()}),this.$clearResults.on("click",function(){b.$search.val("").focus().trigger("keyup")}),this.$el.on("input","#custom-menu-item-name.invalid, #custom-menu-item-url.invalid",function(){c(this).removeClass("invalid")}),a.panel("nav_menus").container.bind("expanded",function(){b.rendered||(b.initList(),b.rendered=!0)}),this.sectionContent.scroll(function(){var a=b.$el.find(".accordion-section.open .available-menu-items-list").prop("scrollHeight"),d=b.$el.find(".accordion-section.open").height();if(!b.loading&&c(this).scrollTop()>.75*a-d){var e=c(this).data("type"),f=c(this).data("object");"search"===e?b.searchTerm&&b.doSearch(b.pages.search):b.loadItems([{type:e,object:f}])}}),a.previewer.bind("url",this.close),b.delegateEvents())},search:function(a){var b=c("#available-menu-items-search"),d=c("#available-menu-items .accordion-section").not(b);a&&this.searchTerm!==a.target.value&&(""===a.target.value||b.hasClass("open")?""===a.target.value&&(b.removeClass("open"),d.show(),this.$clearResults.removeClass("is-visible")):(d.fadeOut(100),b.find(".accordion-section-content").slideDown("fast"),b.addClass("open"),this.$clearResults.addClass("is-visible")),this.searchTerm=a.target.value,this.pages.search=1,this.doSearch(1))},doSearch:function(d){var e,f=this,g=c("#available-menu-items-search"),h=g.find(".accordion-section-content"),i=b.template("available-menu-item");if(f.currentRequest&&f.currentRequest.abort(),!(d<0)){if(d>1)g.addClass("loading-more"),h.attr("aria-busy","true"),b.a11y.speak(a.Menus.data.l10n.itemsLoadingMore);else if(""===f.searchTerm)return h.html(""),void b.a11y.speak("");g.addClass("loading"),f.loading=!0,e=a.previewer.query({excludeCustomizedSaved:!0}),_.extend(e,{"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",search:f.searchTerm,page:d}),f.currentRequest=b.ajax.post("search-avLine truncated
|
||||
})},_handleDeletion:function(){var d,e,f,g=this,h=g.params.menu_id,i=0;d=a.section(g.section()),e=function(){d.container.remove(),a.section.remove(d.id)},d&&d.expanded()?d.collapse({completeCallback:function(){e(),b.a11y.speak(a.Menus.data.l10n.menuDeleted),a.panel("nav_menus").focus()}}):e(),a.each(function(a){/^nav_menu\[/.test(a.id)&&!1!==a()&&(i+=1)}),a.control.each(function(b){if(b.extended(a.controlConstructor.widget_form)&&"nav_menu"===b.params.widget_id_base){var c=b.container.find("select");c.val()===String(h)&&c.prop("selectedIndex",0).trigger("change"),b.container.find(".nav-menu-widget-form-controls:first").toggle(0!==i),b.container.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),b.container.find("option[value="+String(h)+"]").remove()}}),f=c("#available-widgets-list .widget-tpl:has( input.id_base[ value=nav_menu ] )"),f.find(".nav-menu-widget-form-controls:first").toggle(0!==i),f.find(".nav-menu-widget-no-menus-message:first").toggle(0===i),f.find("option[value="+String(h)+"]").remove()},_setupLocations:function(){var b=this;b.container.find(".assigned-menu-location").each(function(){var d,f,g=c(this),h=g.find("input[type=checkbox]"),i=a("nav_menu_locations["+h.data("location-id")+"]");f=function(b){var c=a("nav_menu["+String(b)+"]");b&&c&&c()?g.find(".theme-location-set").show().find("span").text(e(c().name)):g.find(".theme-location-set").hide()},d=new a.Element(h),d.set(i.get()===b.params.menu_id),h.on("change",function(){i.set(this.checked?b.params.menu_id:0)}),i.bind(function(a){d.set(a===b.params.menu_id),f(a)}),f(i.get())})},_setupTitle:function(){var b=this;b.setting.bind(function(d){if(d){var f=a.section(b.section()),g=b.params.menu_id,h=f.headContainer.find(".accordion-section-title"),i=f.contentContainer.find(".customize-section-title h3"),j=f.headContainer.find(".menu-in-location"),k=i.find(".customize-action"),l=e(d.name);h.text(l),j.length&&j.appendTo(h),i.text(l),k.length&&k.prependTo(i),a.control.each(function(a){/^nav_menu_locations\[/.test(a.id)&&a.container.find("option[value="+g+"]").text(l)}),f.contentContainer.find(".customize-control-checkbox input").each(function(){c(this).prop("checked")&&c(".current-menu-location-name-"+c(this).data("location-id")).text(l)})}})},toggleReordering:function(c){var d=this.container.find(".add-new-menu-item"),e=this.container.find(".reorder-toggle"),f=this.$sectionContent.find(".item-title");c=Boolean(c),c!==this.$sectionContent.hasClass("reordering")&&(this.isReordering=c,this.$sectionContent.toggleClass("reordering",c),this.$sectionContent.sortable(this.isReordering?"disable":"enable"),this.isReordering?(d.attr({tabindex:"-1","aria-hidden":"true"}),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOff),b.a11y.speak(a.Menus.data.l10n.reorderModeOn),f.attr("aria-hidden","false")):(d.removeAttr("tabindex aria-hidden"),e.attr("aria-label",a.Menus.data.l10n.reorderLabelOn),b.a11y.speak(a.Menus.data.l10n.reorderModeOff),f.attr("aria-hidden","true")),c&&_(this.getMenuItemControls()).each(function(a){a.collapseForm()}))},getMenuItemControls:function(){var b=this,c=[],d=b.params.menu_id;return a.control.each(function(a){"nav_menu_item"===a.params.type&&a.setting()&&d===a.setting().nav_menu_term_id&&c.push(a)}),c},reflowMenuItems:function(){var a,b=this,c=b.getMenuItemControls();a=function(b){var c=[],d=b.currentParent;_.each(b.menuItemControls,function(a){d===a.setting().menu_item_parent&&c.push(a)}),c.sort(function(a,b){return a.setting().position-b.setting().position}),_.each(c,function(c){b.currentAbsolutePosition+=1,c.priority.set(b.currentAbsolutePosition),c.container.hasClass("menu-item-depth-"+String(b.currentDepth))||(_.each(c.container.prop("className").match(/menu-item-depth-\d+/g),function(a){c.container.removeClass(a)}),c.container.addClass("menu-item-depth-"+String(b.currentDepth))),c.container.data("item-depth",b.currentDepth),b.currentDepth+=1,b.currentParent=c.params.menu_item_id,a(b),b.currentDepth-=1,b.currentParent=d}),c.length&&(_(c).each(function(a){a.container.removeClass("move-up-disabled move-down-disabled move-left-disabled move-right-disabled"),0===b.currentDepth?a.container.addClass("move-left-disabled"):10===b.currentDepth&&a.container.addClass("move-right-disabled")}),c[0].container.addClass("move-up-disabled").addClass("move-right-disabled").toggleClass("move-down-disabled",1===c.length),c[c.length-1].container.addClass("move-down-disabled").toggleClass("move-up-disabled",1===c.length))},a({menuItemControls:c,currentParent:0,currentDepth:0,currentAbsolutePosition:0}),b.container.find(".reorder-toggle").toggle(c.length>1)},debouncedReflowMenuItems:_.debounce(function(){this.reflowMenuItems.apply(this,arguments)},0),addItemToMenu:function(d){var e,f,g,h,i,j=this,k=0,l=10;return _.each(j.getMenuItemControls(),function(a){!1!==a.setting()&&(l=Math.max(l,a.priority()),0===a.setting().menu_item_parent&&(k=Math.max(k,a.setting().position)))}),k+=1,l+=1,d=c.extend({},a.Menus.data.defaultSettingValues.nav_menu_itLine truncated
|
||||
@@ -115,6 +115,15 @@ inlineEditPost = {
|
||||
// enable autocomplete for tags
|
||||
if ( 'post' === type ) {
|
||||
$( 'tr.inline-editor textarea[data-wp-taxonomy]' ).each( function ( i, element ) {
|
||||
/*
|
||||
* While Quick Edit clones the form each time, Bulk Edit always re-uses
|
||||
* the same form. Let's check if an autocomplete instance already exists.
|
||||
*/
|
||||
if ( $( element ).autocomplete( 'instance' ) ) {
|
||||
// jQuery equivalent of `continue` within an `each()` loop.
|
||||
return;
|
||||
}
|
||||
|
||||
$( element ).wpTagsSuggest();
|
||||
} );
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
window.wp=window.wp||{};var inlineEditPost;!function(a,b){inlineEditPost={init:function(){var b=this,c=a("#inline-edit"),d=a("#bulk-edit");b.type=a("table.widefat").hasClass("pages")?"page":"post",b.what="#post-",c.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),d.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),a(".cancel",c).click(function(){return inlineEditPost.revert()}),a(".save",c).click(function(){return inlineEditPost.save(this)}),a("td",c).keydown(function(b){if(13===b.which&&!a(b.target).hasClass("cancel"))return inlineEditPost.save(this)}),a(".cancel",d).click(function(){return inlineEditPost.revert()}),a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var b=a("input.inline-edit-password-input");a(this).prop("checked")?b.val("").prop("disabled",!0):b.prop("disabled",!1)}),a("#the-list").on("click","a.editinline",function(a){a.preventDefault(),inlineEditPost.edit(this)}),a("#bulk-edit").find("fieldset:first").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone()),a('select[name="_status"] option[value="future"]',d).remove(),a("#doaction, #doaction2").click(function(c){var d;b.whichBulkButtonId=a(this).attr("id"),d=b.whichBulkButtonId.substr(2),"edit"===a('select[name="'+d+'"]').val()?(c.preventDefault(),b.setBulk()):a("form#posts-filter tr.inline-editor").length>0&&b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},setBulk:function(){var b="",c=this.type,d=!0;return this.revert(),a("#bulk-edit td").attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a("table.widefat tbody").prepend(a("#bulk-edit")).prepend('<tr class="hidden"></tr>'),a("#bulk-edit").addClass("inline-editor").show(),a('tbody th.check-column input[type="checkbox"]').each(function(){if(a(this).prop("checked")){d=!1;var c,e=a(this).val();c=a("#inline_"+e+" .post_title").html()||inlineEditL10n.notitle,b+='<div id="ttle'+e+'"><a id="_'+e+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}}),d?this.revert():(a("#bulk-titles").html(b),a("#bulk-titles a").click(function(){var b=a(this).attr("id").substr(1);a('table.widefat input[value="'+b+'"]').prop("checked",!1),a("#ttle"+b).remove()}),"post"===c&&a("tr.inline-editor textarea[data-wp-taxonomy]").each(function(b,c){a(c).wpTagsSuggest()}),void a("html, body").animate({scrollTop:0},"fast"))},edit:function(b){var c,d,e,f,g,h,i,j,k,l,m,n=this,o=!0;for(n.revert(),"object"==typeof b&&(b=n.getId(b)),c=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===n.type&&c.push("post_parent"),d=a("#inline-edit").clone(!0),a("td",d).attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a(n.what+b).removeClass("is-expanded").hide().after(d).after('<tr class="hidden"></tr>'),e=a("#inline_"+b),a(':input[name="post_author"] option[value="'+a(".post_author",e).text()+'"]',d).val()||a(':input[name="post_author"]',d).prepend('<option value="'+a(".post_author",e).text()+'">'+a("#"+n.type+"-"+b+" .author").text()+"</option>"),1===a(':input[name="post_author"] option',d).length&&a("label.inline-edit-author",d).hide(),k=0;k<c.length;k++)l=a("."+c[k],e),l.find("img").replaceWith(function(){return this.alt}),l=l.text(),a(':input[name="'+c[k]+'"]',d).val(l);if("open"===a(".comment_status",e).text()&&a('input[name="comment_status"]',d).prop("checked",!0),"open"===a(".ping_status",e).text()&&a('input[name="ping_status"]',d).prop("checked",!0),"sticky"===a(".sticky",e).text()&&a('input[name="sticky"]',d).prop("checked",!0),a(".post_category",e).each(function(){var c,e=a(this).text();e&&(c=a(this).attr("id").replace("_"+b,""),a("ul."+c+"-checklist :checkbox",d).val(e.split(",")))}),a(".tags_input",e).each(function(){var c=a(this),e=a(this).attr("id").replace("_"+b,""),f=a("textarea.tax_input_"+e,d),g=inlineEditL10n.comma;c.find("img").replaceWith(function(){return this.alt}),c=c.text(),c&&(","!==g&&(c=c.replace(/,/g,g)),f.val(c)),f.wpTagsSuggest()}),f=a("._status",e).text(),"future"!==f&&a('select[name="_status"] option[value="future"]',d).remove(),m=a(".inline-edit-password-input").prop("disabled",!1),"private"===f&&(a('input[name="keep_private"]',d).prop("checked",!0),m.val("").prop("disabled",!0)),g=a('select[name="post_parent"] option[value="'+b+'"]',d),g.length>0){for(h=g[0].className.split("-")[1],i=g;o&&(i=i.next("option"),0!==i.length);)j=i[0].className.split("-")[1],j<=h?o=!1:(i.remove(),i=g);g.remove()}return a(d).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",d).focus(),!1},save:function(c){var d,e,f=a(".post_status_page").val()||"";return"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save",post_type:typenow,post_ID:c,edit_date:"true",post_status:f},e=a("#Line truncated
|
||||
window.wp=window.wp||{};var inlineEditPost;!function(a,b){inlineEditPost={init:function(){var b=this,c=a("#inline-edit"),d=a("#bulk-edit");b.type=a("table.widefat").hasClass("pages")?"page":"post",b.what="#post-",c.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),d.keyup(function(a){if(27===a.which)return inlineEditPost.revert()}),a(".cancel",c).click(function(){return inlineEditPost.revert()}),a(".save",c).click(function(){return inlineEditPost.save(this)}),a("td",c).keydown(function(b){if(13===b.which&&!a(b.target).hasClass("cancel"))return inlineEditPost.save(this)}),a(".cancel",d).click(function(){return inlineEditPost.revert()}),a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var b=a("input.inline-edit-password-input");a(this).prop("checked")?b.val("").prop("disabled",!0):b.prop("disabled",!1)}),a("#the-list").on("click","a.editinline",function(a){a.preventDefault(),inlineEditPost.edit(this)}),a("#bulk-edit").find("fieldset:first").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone()),a('select[name="_status"] option[value="future"]',d).remove(),a("#doaction, #doaction2").click(function(c){var d;b.whichBulkButtonId=a(this).attr("id"),d=b.whichBulkButtonId.substr(2),"edit"===a('select[name="'+d+'"]').val()?(c.preventDefault(),b.setBulk()):a("form#posts-filter tr.inline-editor").length>0&&b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},setBulk:function(){var b="",c=this.type,d=!0;return this.revert(),a("#bulk-edit td").attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a("table.widefat tbody").prepend(a("#bulk-edit")).prepend('<tr class="hidden"></tr>'),a("#bulk-edit").addClass("inline-editor").show(),a('tbody th.check-column input[type="checkbox"]').each(function(){if(a(this).prop("checked")){d=!1;var c,e=a(this).val();c=a("#inline_"+e+" .post_title").html()||inlineEditL10n.notitle,b+='<div id="ttle'+e+'"><a id="_'+e+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}}),d?this.revert():(a("#bulk-titles").html(b),a("#bulk-titles a").click(function(){var b=a(this).attr("id").substr(1);a('table.widefat input[value="'+b+'"]').prop("checked",!1),a("#ttle"+b).remove()}),"post"===c&&a("tr.inline-editor textarea[data-wp-taxonomy]").each(function(b,c){a(c).autocomplete("instance")||a(c).wpTagsSuggest()}),void a("html, body").animate({scrollTop:0},"fast"))},edit:function(b){var c,d,e,f,g,h,i,j,k,l,m,n=this,o=!0;for(n.revert(),"object"==typeof b&&(b=n.getId(b)),c=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order","page_template"],"page"===n.type&&c.push("post_parent"),d=a("#inline-edit").clone(!0),a("td",d).attr("colspan",a("th:visible, td:visible",".widefat:first thead").length),a(n.what+b).removeClass("is-expanded").hide().after(d).after('<tr class="hidden"></tr>'),e=a("#inline_"+b),a(':input[name="post_author"] option[value="'+a(".post_author",e).text()+'"]',d).val()||a(':input[name="post_author"]',d).prepend('<option value="'+a(".post_author",e).text()+'">'+a("#"+n.type+"-"+b+" .author").text()+"</option>"),1===a(':input[name="post_author"] option',d).length&&a("label.inline-edit-author",d).hide(),k=0;k<c.length;k++)l=a("."+c[k],e),l.find("img").replaceWith(function(){return this.alt}),l=l.text(),a(':input[name="'+c[k]+'"]',d).val(l);if("open"===a(".comment_status",e).text()&&a('input[name="comment_status"]',d).prop("checked",!0),"open"===a(".ping_status",e).text()&&a('input[name="ping_status"]',d).prop("checked",!0),"sticky"===a(".sticky",e).text()&&a('input[name="sticky"]',d).prop("checked",!0),a(".post_category",e).each(function(){var c,e=a(this).text();e&&(c=a(this).attr("id").replace("_"+b,""),a("ul."+c+"-checklist :checkbox",d).val(e.split(",")))}),a(".tags_input",e).each(function(){var c=a(this),e=a(this).attr("id").replace("_"+b,""),f=a("textarea.tax_input_"+e,d),g=inlineEditL10n.comma;c.find("img").replaceWith(function(){return this.alt}),c=c.text(),c&&(","!==g&&(c=c.replace(/,/g,g)),f.val(c)),f.wpTagsSuggest()}),f=a("._status",e).text(),"future"!==f&&a('select[name="_status"] option[value="future"]',d).remove(),m=a(".inline-edit-password-input").prop("disabled",!1),"private"===f&&(a('input[name="keep_private"]',d).prop("checked",!0),m.val("").prop("disabled",!0)),g=a('select[name="post_parent"] option[value="'+b+'"]',d),g.length>0){for(h=g[0].className.split("-")[1],i=g;o&&(i=i.next("option"),0!==i.length);)j=i[0].className.split("-")[1],j<=h?o=!1:(i.remove(),i=g);g.remove()}return a(d).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",d).focus(),!1},save:function(c){var d,e,f=a(".post_status_page").val()||"";return"object"==typeof c&&(c=this.getId(c)),a("table.widefat .spinner").addClass("is-active"),d={action:"inline-save",post_type:typenow,post_ID:c,edit_daLine truncated
|
||||
@@ -120,7 +120,9 @@
|
||||
},
|
||||
minLength: 2,
|
||||
position: {
|
||||
my: 'left top+2'
|
||||
my: 'left top+2',
|
||||
at: 'left bottom',
|
||||
collision: 'none'
|
||||
},
|
||||
messages: {
|
||||
noResults: window.uiAutocompleteL10n.noResults,
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
!function(a){function b(a){return a.split(new RegExp(e+"\\s*"))}function c(a){return b(a).pop()}if("undefined"!=typeof window.tagsSuggestL10n&&"undefined"!=typeof window.uiAutocompleteL10n){var d=0,e=window.tagsSuggestL10n.tagDelimiter||",";a.fn.wpTagsSuggest=function(f){var g,h,i=a(this);f=f||{};var j=f.taxonomy||i.attr("data-wp-taxonomy")||"post_tag";return delete f.taxonomy,f=a.extend({source:function(b,e){var f;return h===b.term?void e(g):(f=c(b.term),a.get(window.ajaxurl,{action:"ajax-tag-search",tax:j,q:f}).always(function(){i.removeClass("ui-autocomplete-loading")}).done(function(a){var b,c=[];if(a){a=a.split("\n");for(b in a){var f=++d;c.push({id:f,name:a[b]})}g=c,e(c)}else e(c)}),void(h=b.term))},focus:function(a,b){i.attr("aria-activedescendant","wp-tags-autocomplete-"+b.item.id),a.preventDefault()},select:function(c,d){var f=b(i.val());return f.pop(),f.push(d.item.name,""),i.val(f.join(e+" ")),a.ui.keyCode.TAB===c.keyCode?(window.wp.a11y.speak(window.tagsSuggestL10n.termSelected,"assertive"),c.preventDefault()):a.ui.keyCode.ENTER===c.keyCode&&(c.preventDefault(),c.stopPropagation()),!1},open:function(){i.attr("aria-expanded","true")},close:function(){i.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2"},messages:{noResults:window.uiAutocompleteL10n.noResults,results:function(a){return a>1?window.uiAutocompleteL10n.manyResults.replace("%d",a):window.uiAutocompleteL10n.oneResult}}},f),i.on("keydown",function(){i.removeAttr("aria-activedescendant")}).autocomplete(f).autocomplete("instance")._renderItem=function(b,c){return a('<li role="option" id="wp-tags-autocomplete-'+c.id+'">').text(c.name).appendTo(b)},i.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":i.autocomplete("widget").attr("id")}).on("focus",function(){var a=b(i.val()).pop();a&&i.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(a,b){b.item.attr("aria-selected","true")}).on("menublur",function(){a(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}}(jQuery);
|
||||
!function(a){function b(a){return a.split(new RegExp(e+"\\s*"))}function c(a){return b(a).pop()}if("undefined"!=typeof window.tagsSuggestL10n&&"undefined"!=typeof window.uiAutocompleteL10n){var d=0,e=window.tagsSuggestL10n.tagDelimiter||",";a.fn.wpTagsSuggest=function(f){var g,h,i=a(this);f=f||{};var j=f.taxonomy||i.attr("data-wp-taxonomy")||"post_tag";return delete f.taxonomy,f=a.extend({source:function(b,e){var f;return h===b.term?void e(g):(f=c(b.term),a.get(window.ajaxurl,{action:"ajax-tag-search",tax:j,q:f}).always(function(){i.removeClass("ui-autocomplete-loading")}).done(function(a){var b,c=[];if(a){a=a.split("\n");for(b in a){var f=++d;c.push({id:f,name:a[b]})}g=c,e(c)}else e(c)}),void(h=b.term))},focus:function(a,b){i.attr("aria-activedescendant","wp-tags-autocomplete-"+b.item.id),a.preventDefault()},select:function(c,d){var f=b(i.val());return f.pop(),f.push(d.item.name,""),i.val(f.join(e+" ")),a.ui.keyCode.TAB===c.keyCode?(window.wp.a11y.speak(window.tagsSuggestL10n.termSelected,"assertive"),c.preventDefault()):a.ui.keyCode.ENTER===c.keyCode&&(c.preventDefault(),c.stopPropagation()),!1},open:function(){i.attr("aria-expanded","true")},close:function(){i.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},messages:{noResults:window.uiAutocompleteL10n.noResults,results:function(a){return a>1?window.uiAutocompleteL10n.manyResults.replace("%d",a):window.uiAutocompleteL10n.oneResult}}},f),i.on("keydown",function(){i.removeAttr("aria-activedescendant")}).autocomplete(f).autocomplete("instance")._renderItem=function(b,c){return a('<li role="option" id="wp-tags-autocomplete-'+c.id+'">').text(c.name).appendTo(b)},i.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":i.autocomplete("widget").attr("id")}).on("focus",function(){var a=b(i.val()).pop();a&&i.autocomplete("search")}).autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(a,b){b.item.attr("aria-selected","true")}).on("menublur",function(){a(this).find('[aria-selected="true"]').removeAttr("aria-selected")}),this}}}(jQuery);
|
||||
@@ -156,7 +156,7 @@ $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_t
|
||||
$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
|
||||
$submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
|
||||
|
||||
$customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' );
|
||||
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
|
||||
$submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
|
||||
|
||||
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
|
||||
|
||||
@@ -584,7 +584,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
|
||||
esc_url( add_query_arg( array(
|
||||
array( 'autofocus' => $focus ),
|
||||
'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
|
||||
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
|
||||
), admin_url( 'customize.php' ) ) ),
|
||||
__( 'Manage with Live Preview' )
|
||||
);
|
||||
|
||||
@@ -355,7 +355,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
esc_url( add_query_arg(
|
||||
array(
|
||||
array( 'autofocus' => array( 'panel' => 'widgets' ) ),
|
||||
'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
||||
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
|
||||
),
|
||||
admin_url( 'customize.php' )
|
||||
) ),
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
//Backcompat for pre this function making it into WordPress
|
||||
if ( ! function_exists( 'wp_debug_backtrace_summary' ) ) {
|
||||
/**
|
||||
* Return a comma separated string of functions that have been called to get to the current point in code.
|
||||
* @link http://core.trac.wordpress.org/ticket/19589
|
||||
* @since 3.4
|
||||
*
|
||||
* @param string $ignore_class A class to ignore all function calls within - useful when you want to just give info about the callee
|
||||
* @param string $skip_frames A number of stack frames to skip - useful for unwinding back to the source of the issue
|
||||
* @param bool $pretty Whether or not you want a comma separated string or raw array returned
|
||||
* @return string|array Either a string containing a reversed comma separated trace or an array of individual calls.
|
||||
*/
|
||||
function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
|
||||
$trace = debug_backtrace( false );
|
||||
$caller = array();
|
||||
$check_class = ! is_null( $ignore_class );
|
||||
$skip_frames++; // skip this function
|
||||
|
||||
foreach ( $trace as $call ) {
|
||||
if ( $skip_frames > 0 ) {
|
||||
$skip_frames--;
|
||||
} elseif ( isset( $call['class'] ) ) {
|
||||
if ( $check_class && $ignore_class == $call['class'] )
|
||||
continue; // Filter out calls
|
||||
|
||||
$caller[] = "{$call['class']}{$call['type']}{$call['function']}";
|
||||
} else {
|
||||
if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) {
|
||||
$caller[] = "{$call['function']}('{$call['args'][0]}')";
|
||||
} elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) {
|
||||
$caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')";
|
||||
} else {
|
||||
$caller[] = $call['function'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $pretty )
|
||||
return join( ', ', array_reverse( $caller ) );
|
||||
else
|
||||
return $caller;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1 +1 @@
|
||||
#wpadminbar #wp-admin-bar-debug-bar{float:right;}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922;background-image:-moz-linear-gradient(bottom,#ee6f00,#ff8922);background-image:-webkit-gradient(linear,left bottom,left top,from(#ee6f00),to(#ff8922));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00;background-image:-moz-linear-gradient(bottom,#ff8922,#ee6f00);background-image:-webkit-gradient(linear,left bottom,left top,from(#ff8922),to(#ee6f00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #884000;}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#f44;background-image:-moz-linear-gradient(bottom,#d00,#f44);background-image:-webkit-gradient(linear,left bottom,left top,from(#d00),to(#f44));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00;background-image:-moz-linear-gradient(bottom,#f44,#d00);background-image:-webkit-gradient(linear,left bottom,left top,from(#f44),to(#d00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #700;}#wpadminbar #wp-admin-bar-debug-bar ul{right:0;}#querylist{display:none;position:fixed;height:33%;min-height:350px;font-family:"Helvetica Neue",sans-serif;left:0;right:0;bottom:0;background:#f1f1f1;z-index:99000;color:#000;line-height:150%!important;text-align:left;font-size:12px;}#querylist a{border:0;}.debug-bar-visible #querylist{display:block;}.debug-bar-maximized #querylist{position:fixed;top:28px;height:auto;}body.debug-bar-maximized.debug-bar-visible{overflow:hidden;}#debug-bar-info{height:60px;width:100%;position:absolute;z-index:200;background:#f1f1f1;border-bottom:1px solid #fff;box-shadow:0 0 6px rgba(0,0,0,0.4);background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-moz-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-o-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#dfdfdf));background-image:-webkit-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:linear-gradient(top,#f9f9f9,#dfdfdf);}#debug-bar-menu{position:absolute;top:61px;left:0;width:250px;bottom:0;z-index:100;overflow:hidden;text-shadow:0 1px 1px rgba(0,0,0,0.9);background:#333;-webkit-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);-moz-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);}#debug-menu-targets{overflow:auto;position:absolute;top:61px;left:250px;right:0;bottom:0;z-index:150;}#debug-status{float:left;padding-left:20px;color:#bbb;font-size:14px;line-height:60px;}.debug-status{float:left;margin-right:40px;}#debug-status .debug-status-title{color:#555;font-weight:500;line-height:18px;font-size:12px;margin-top:10px;}#debug-status .debug-status-data{color:#999;font-weight:200;line-height:20px;font-size:18px;}#debug-status #debug-status-warning{font-weight:bold;color:red;}#debug-status #debug-status-site{font-weight:bold;}#querylist pre{font-size:12px;padding:10px;}#querylist .left{float:left;}#querylist .right{float:right;}#querylist h1,#querylist h2,#querylist h3{font-weight:normal;}#debug-menu-links{overflow:hidden;list-style:none;margin:0;padding:0;}#debug-menu-links li{float:left;margin-bottom:0!important;}#debug-menu-links li a{padding:0 20px;width:210px;line-height:40px;outline:none;display:block;margin:0;color:#fff!important;text-decoration:none!important;font-weight:500!important;font-size:14px;}#debug-menu-links li a.current{background:rgba(0,0,0,0.2);}#querylist h2{float:left;min-width:150px;border:1px solid #eee;padding:5px 10px 15px;clear:none;text-align:center;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important;}#querylist h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px;}#object-cache-stats h2{border:none;float:none;text-align:left;font-size:22px;margin-bottom:0;}#querylist h3{margin-bottom:15px;}#querylist ol.wpd-queries{padding:0!important;margin:0!important;list-style:none;clear:left;}#querylist ol.wpd-queries li{padding:10px;background:#Line truncated
|
||||
#debug-menu-links li a,#querylist a:hover{text-decoration:none!important}#wpadminbar #wp-admin-bar-debug-bar{float:right}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e))}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922;background-image:-moz-linear-gradient(bottom,#ee6f00,#ff8922);background-image:-webkit-gradient(linear,left bottom,left top,from(#ee6f00),to(#ff8922))}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00;background-image:-moz-linear-gradient(bottom,#ff8922,#ee6f00);background-image:-webkit-gradient(linear,left bottom,left top,from(#ff8922),to(#ee6f00))}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #884000}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#f44;background-image:-moz-linear-gradient(bottom,#d00,#f44);background-image:-webkit-gradient(linear,left bottom,left top,from(#d00),to(#f44))}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00;background-image:-moz-linear-gradient(bottom,#f44,#d00);background-image:-webkit-gradient(linear,left bottom,left top,from(#f44),to(#d00))}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #700}#wpadminbar #wp-admin-bar-debug-bar ul{right:0}#querylist{direction:ltr;display:none;position:fixed;height:33%;min-height:350px;font-family:"Helvetica Neue",sans-serif;left:0;right:0;bottom:0;background:#f1f1f1;z-index:99000;color:#000;line-height:150%!important;text-align:left;font-size:12px}.debug-bar-visible #querylist{display:block}.debug-bar-maximized #querylist{position:fixed;top:28px;height:auto}body.debug-bar-maximized.debug-bar-visible{overflow:hidden}#debug-bar-menu,#debug-menu-targets{overflow:auto;position:absolute;top:61px;bottom:0}#debug-bar-info{height:60px;width:100%;position:absolute;z-index:200;background:#f1f1f1;border-bottom:1px solid #fff;box-shadow:0 0 6px rgba(0,0,0,.4);background-image:-ms-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-moz-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-o-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#dfdfdf));background-image:-webkit-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:linear-gradient(top,#f9f9f9,#dfdfdf)}#debug-bar-menu{left:0;width:250px;z-index:100;text-shadow:0 1px 1px rgba(0,0,0,.9);background:#333;-webkit-box-shadow:inset -3px 0 6px rgba(0,0,0,.4);-moz-box-shadow:inset -3px 0 6px rgba(0,0,0,.4);box-shadow:inset -3px 0 6px rgba(0,0,0,.4)}#debug-menu-targets{left:250px;right:0;z-index:150}#debug-status{float:left;padding-left:20px;color:#bbb;font-size:14px;line-height:60px}.debug-status{float:left;margin-right:40px}#debug-status .debug-status-title{color:#555;font-weight:500;line-height:18px;font-size:12px;margin-top:10px}#debug-status .debug-status-data{color:#999;font-weight:200;line-height:20px;font-size:18px}#debug-status #debug-status-warning{font-weight:700;color:red}#debug-status #debug-status-site{font-weight:700}#querylist pre{font-size:12px;padding:10px}#querylist .left{float:left}#querylist .right{float:right}#querylist h1,#querylist h2,#querylist h3{font-weight:400}#debug-menu-links{overflow:hidden;list-style:none;margin:0;padding:0}#debug-menu-links li{float:left;margin-bottom:0!important}#debug-menu-links li a{box-sizing:content-box;padding:0 20px;width:210px;line-height:32px;outline:0;display:block;margin:0;color:#fff!important;font-weight:500!important;font-size:14px}#debug-menu-links li a.current{background:rgba(0,0,0,.2)}#querylist h2{float:left;min-width:150px;border:1px solid #eee;padding:5px 10px 15px;clear:none;text-align:center;color:#000;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important}#querylist h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px}#querylist h2 span#debug-bar-js-error-count{font-size:inherit;color:inherit;text-transform:inherit;white-space:inherit;display:inherit;margin-bottom:inherit}#object-cache-stats h2{border:none;float:none;text-align:left;font-size:22px;margin-bottom:0}#querylist h3{margin-bottom:15px}#querylist oLine truncated
|
||||
@@ -59,6 +59,7 @@
|
||||
*/
|
||||
|
||||
#querylist {
|
||||
direction: ltr;
|
||||
display: none;
|
||||
position: fixed;
|
||||
height: 33%;
|
||||
@@ -121,7 +122,7 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
|
||||
overflow: hidden;
|
||||
overflow: auto;
|
||||
text-shadow: 0 1px 1px rgba( 0, 0, 0, 0.9 );
|
||||
background: #333;
|
||||
-webkit-box-shadow: inset -3px 0 6px rgba( 0, 0, 0, 0.4 );
|
||||
@@ -203,9 +204,10 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
}
|
||||
|
||||
#debug-menu-links li a {
|
||||
box-sizing: content-box;
|
||||
padding: 0 20px;
|
||||
width: 210px;
|
||||
line-height: 40px;
|
||||
line-height: 32px;
|
||||
outline: none;
|
||||
display: block;
|
||||
margin: 0;
|
||||
@@ -226,6 +228,7 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
padding: 5px 10px 15px;
|
||||
clear: none;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
font-family: georgia, times, serif;
|
||||
font-size: 28px;
|
||||
margin: 15px 10px 15px 0 !important;
|
||||
@@ -240,6 +243,15 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#querylist h2 span#debug-bar-js-error-count {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
text-transform: inherit;
|
||||
white-space: inherit;
|
||||
display: inherit;
|
||||
margin-bottom: inherit;
|
||||
}
|
||||
|
||||
#object-cache-stats h2 {
|
||||
border: none;
|
||||
float: none;
|
||||
@@ -300,6 +312,21 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
line-height: 180% !important;
|
||||
}
|
||||
|
||||
#querylist table {
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
#querylist td, #querylist th {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
#querylist table,
|
||||
#querylist table th,
|
||||
#querylist table td {
|
||||
border: 0px none;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#debug-bar-php ol.debug-bar-php-list {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
@@ -335,24 +362,31 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query ol.debug-bar-wp-query-list {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
list-style: none;
|
||||
clear: left;
|
||||
#debug-bar-wp-query table.debug-bar-wp-query-list {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
cell-padding: 1em;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query ol.debug-bar-wp-query-list li, #debug-bar-wp-query p, #debug-bar-request p {
|
||||
padding: 10px;
|
||||
margin: 0 0 10px 0;
|
||||
background: #f0f0f0;
|
||||
#debug-bar-wp-query table.debug-bar-wp-query-list td {
|
||||
padding: 0.5em 5px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query ol.debug-bar-wp-query-list li ol {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
list-style: none;
|
||||
clear: left;
|
||||
#debug-bar-wp-query table.debug-bar-wp-query-list th {
|
||||
padding: 0.5em 5px;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query table.debug-bar-wp-query-list tr:nth-child(2n+1) {
|
||||
background-color: #E8E8E8;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query table.debug-bar-wp-query-list tr td:first-of-type {
|
||||
font-size: 140%;
|
||||
padding: 0.3em 0.5em;
|
||||
}
|
||||
|
||||
#debug-bar-wp-query h3, #debug-bar-request h3 {
|
||||
@@ -363,6 +397,12 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
margin: 15px 10px 15px 0 !important;
|
||||
}
|
||||
|
||||
#debug-bar-request p {
|
||||
padding: 10px;
|
||||
margin: 0 0 10px 0;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
* Actions: Maximize / restore
|
||||
* ========================================================================= */
|
||||
@@ -419,7 +459,8 @@ body.debug-bar-maximized.debug-bar-visible {
|
||||
* JS Error item styling
|
||||
* ========================================================================= */
|
||||
|
||||
#debug-menu-links li a#debug-menu-link-Debug_Bar_JS {
|
||||
#debug-menu-links li a#debug-menu-link-Debug_Bar_JS,
|
||||
#wp-admin-bar-debug-bar-Debug_Bar_JS {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
Plugin URI: https://wordpress.org/plugins/debug-bar/
|
||||
Description: Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
||||
Author: wordpressdotorg
|
||||
Version: 0.8.4
|
||||
Version: 0.9
|
||||
Author URI: https://wordpress.org/
|
||||
Text Domain: debug-bar
|
||||
*/
|
||||
|
||||
/***
|
||||
@@ -16,46 +17,83 @@
|
||||
*
|
||||
* They are not used when a regular user is logged in.
|
||||
*/
|
||||
|
||||
class Debug_Bar {
|
||||
var $panels = array();
|
||||
public $panels = array();
|
||||
|
||||
function __construct() {
|
||||
if ( defined('DOING_AJAX') && DOING_AJAX )
|
||||
add_action( 'admin_init', array( &$this, 'init_ajax' ) );
|
||||
add_action( 'admin_bar_init', array( &$this, 'init' ) );
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||
add_action( 'admin_init', array( $this, 'init_ajax' ) );
|
||||
}
|
||||
add_action( 'admin_bar_init', array( $this, 'init' ) );
|
||||
}
|
||||
|
||||
function Debug_Bar() {
|
||||
Debug_Bar::__construct();
|
||||
_deprecated_constructor( __METHOD__, '0.8.3', __CLASS__ );
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
function init() {
|
||||
if ( ! is_super_admin() || ! is_admin_bar_showing() || $this->is_wp_login() )
|
||||
if ( ! $this->enable_debug_bar() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu' ), 1000 );
|
||||
add_action( 'admin_footer', array( &$this, 'render' ), 1000 );
|
||||
add_action( 'wp_footer', array( &$this, 'render' ), 1000 );
|
||||
add_action( 'wp_head', array( &$this, 'ensure_ajaxurl' ), 1 );
|
||||
add_filter( 'body_class', array( &$this, 'body_class' ) );
|
||||
add_filter( 'admin_body_class', array( &$this, 'body_class' ) );
|
||||
load_plugin_textdomain( 'debug-bar' );
|
||||
|
||||
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
|
||||
add_action( 'admin_footer', array( $this, 'render' ), 1000 );
|
||||
add_action( 'wp_footer', array( $this, 'render' ), 1000 );
|
||||
add_action( 'wp_head', array( $this, 'ensure_ajaxurl' ), 1 );
|
||||
add_filter( 'body_class', array( $this, 'body_class' ) );
|
||||
add_filter( 'admin_body_class', array( $this, 'body_class' ) );
|
||||
|
||||
$this->requirements();
|
||||
$this->enqueue();
|
||||
$this->init_panels();
|
||||
}
|
||||
|
||||
/* Are we on the wp-login.php page?
|
||||
* We can get here while logged in and break the page as the admin bar isn't shown and otherthings the js relies on aren't available.
|
||||
/**
|
||||
* Are we on the wp-login.php page?
|
||||
*
|
||||
* We can get here while logged in and break the page as the admin bar
|
||||
* is not shown and other things the js relies on are not available.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_wp_login() {
|
||||
return 'wp-login.php' == basename( $_SERVER['SCRIPT_NAME'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Should the debug bar functionality be enabled?
|
||||
*
|
||||
* @since 0.9
|
||||
*
|
||||
* @param bool $ajax Whether this is an ajax call or not. Defaults to false.
|
||||
* @return bool
|
||||
*/
|
||||
function enable_debug_bar( $ajax = false ) {
|
||||
$enable = false;
|
||||
|
||||
if ( $ajax && is_super_admin() ) {
|
||||
$enable = true;
|
||||
} elseif ( ! $ajax && ( is_super_admin() && is_admin_bar_showing() && ! $this->is_wp_login() ) ) {
|
||||
$enable = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for overruling of whether the debug bar functionality will be enabled.
|
||||
*
|
||||
* @since 0.9
|
||||
*
|
||||
* @param bool $enable Whether the debug bar will be enabled or not.
|
||||
*/
|
||||
return apply_filters( 'debug_bar_enable', $enable );
|
||||
}
|
||||
|
||||
function init_ajax() {
|
||||
if ( ! is_super_admin() )
|
||||
if ( ! $this->enable_debug_bar( true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->requirements();
|
||||
$this->init_panels();
|
||||
@@ -63,20 +101,21 @@ class Debug_Bar {
|
||||
|
||||
function requirements() {
|
||||
$path = plugin_dir_path( __FILE__ );
|
||||
require_once( $path . '/compat.php' );
|
||||
$recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js' );
|
||||
foreach ( $recs as $rec )
|
||||
|
||||
foreach ( $recs as $rec ) {
|
||||
require_once "$path/panels/class-debug-bar-$rec.php";
|
||||
}
|
||||
}
|
||||
|
||||
function enqueue() {
|
||||
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
||||
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
|
||||
|
||||
wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20120317' );
|
||||
wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20170515' );
|
||||
|
||||
wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20121228.2', true );
|
||||
wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20170515', true );
|
||||
|
||||
do_action('debug_bar_enqueue_scripts');
|
||||
do_action( 'debug_bar_enqueue_scripts' );
|
||||
}
|
||||
|
||||
function init_panels() {
|
||||
@@ -99,21 +138,16 @@ class Debug_Bar {
|
||||
|
||||
function ensure_ajaxurl() { ?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
|
||||
//]]>
|
||||
//<![CDATA[
|
||||
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
// memory_get_peak_usage is PHP >= 5.2.0 only
|
||||
function safe_memory_get_peak_usage() {
|
||||
if ( function_exists( 'memory_get_peak_usage' ) ) {
|
||||
$usage = memory_get_peak_usage();
|
||||
} else {
|
||||
$usage = memory_get_usage();
|
||||
}
|
||||
return $usage;
|
||||
return function_exists( 'memory_get_peak_usage' ) ? memory_get_peak_usage() : memory_get_usage();
|
||||
}
|
||||
|
||||
function admin_bar_menu() {
|
||||
@@ -126,36 +160,43 @@ class Debug_Bar {
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'debug-bar',
|
||||
'parent' => 'top-secondary',
|
||||
'title' => apply_filters( 'debug_bar_title', __('Debug', 'debug-bar') ),
|
||||
'title' => apply_filters( 'debug_bar_title', __( 'Debug', 'debug-bar' ) ),
|
||||
'meta' => array( 'class' => $classes ),
|
||||
) );
|
||||
|
||||
// @todo: Uncomment and finish me!
|
||||
// foreach ( $this->panels as $panel_key => $panel ) {
|
||||
// if ( ! $panel->is_visible() )
|
||||
// continue;
|
||||
//
|
||||
// $panel_class = get_class( $panel );
|
||||
//
|
||||
// $wp_admin_bar->add_menu( array(
|
||||
// 'parent' => 'debug-bar',
|
||||
// 'id' => "debug-bar-$panel_class",
|
||||
// 'title' => $panel->title(),
|
||||
// ) );
|
||||
// }
|
||||
foreach ( $this->panels as $panel_key => $panel ) {
|
||||
$panel->prerender();
|
||||
if ( ! $panel->is_visible() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$panel_class = get_class( $panel );
|
||||
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'parent' => 'debug-bar',
|
||||
'id' => "debug-bar-$panel_class",
|
||||
'title' => $panel->title(),
|
||||
'href' => '#debug-menu-target-' . esc_attr( $panel_class ),
|
||||
'meta' => array(
|
||||
'rel' => '#debug-menu-link-' . esc_attr( $panel_class ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
function body_class( $classes ) {
|
||||
if ( is_array( $classes ) )
|
||||
if ( is_array( $classes ) ) {
|
||||
$classes[] = 'debug-bar-maximized';
|
||||
else
|
||||
} else {
|
||||
$classes .= ' debug-bar-maximized ';
|
||||
}
|
||||
|
||||
if ( isset( $_GET['debug-bar'] ) ) {
|
||||
if ( is_array( $classes ) )
|
||||
if ( is_array( $classes ) ) {
|
||||
$classes[] = 'debug-bar-visible';
|
||||
else
|
||||
} else {
|
||||
$classes .= ' debug-bar-visible ';
|
||||
}
|
||||
}
|
||||
|
||||
return $classes;
|
||||
@@ -164,95 +205,121 @@ class Debug_Bar {
|
||||
function render() {
|
||||
global $wpdb;
|
||||
|
||||
if ( empty( $this->panels ) )
|
||||
if ( empty( $this->panels ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->panels as $panel_key => $panel ) {
|
||||
$panel->prerender();
|
||||
if ( ! $panel->is_visible() )
|
||||
if ( ! $panel->is_visible() ) {
|
||||
unset( $this->panels[ $panel_key ] );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<div id='querylist'>
|
||||
<div id='querylist'>
|
||||
|
||||
<div id="debug-bar-actions">
|
||||
<span class="maximize">+</span>
|
||||
<span class="restore">–</span>
|
||||
<span class="close">×</span>
|
||||
</div>
|
||||
<div id="debug-bar-actions">
|
||||
<span class="maximize">+</span>
|
||||
<span class="restore">–</span>
|
||||
<span class="close">×</span>
|
||||
</div>
|
||||
|
||||
<div id='debug-bar-info'>
|
||||
<div id="debug-status">
|
||||
<?php //@todo: Add a links to information about WP_DEBUG, PHP version, MySQL version, and Peak Memory.
|
||||
$statuses = array();
|
||||
$statuses[] = array( 'site', php_uname( 'n' ), sprintf( __( '#%d', 'debug-bar' ), get_current_blog_id() ) );
|
||||
$statuses[] = array( 'php', __('PHP', 'debug-bar'), phpversion() );
|
||||
$db_title = empty( $wpdb->is_mysql ) ? __( 'DB', 'debug-bar' ) : 'MySQL';
|
||||
$statuses[] = array( 'db', $db_title, $wpdb->db_version() );
|
||||
$statuses[] = array( 'memory', __('Memory Usage', 'debug-bar'), sprintf( __('%s bytes', 'debug-bar'), number_format_i18n( $this->safe_memory_get_peak_usage() ) ) );
|
||||
<div id='debug-bar-info'>
|
||||
<div id="debug-status">
|
||||
<?php //@todo: Add a links to information about WP_DEBUG, PHP version, MySQL version, and Peak Memory.
|
||||
$statuses = array();
|
||||
$statuses[] = array(
|
||||
'site',
|
||||
php_uname( 'n' ),
|
||||
/* translators: %d is the site id number in a multi-site setting. */
|
||||
sprintf( __( '#%d', 'debug-bar' ), get_current_blog_id() ),
|
||||
);
|
||||
$statuses[] = array(
|
||||
'php',
|
||||
__( 'PHP', 'debug-bar' ),
|
||||
phpversion(),
|
||||
);
|
||||
$db_title = empty( $wpdb->is_mysql ) ? __( 'DB', 'debug-bar' ) : __( 'MySQL', 'debug-bar' );
|
||||
$statuses[] = array(
|
||||
'db',
|
||||
$db_title,
|
||||
$wpdb->db_version(),
|
||||
);
|
||||
$statuses[] = array(
|
||||
'memory',
|
||||
__( 'Memory Usage', 'debug-bar' ),
|
||||
/* translators: %s is a formatted number representing the memory usage. */
|
||||
sprintf( __( '%s bytes', 'debug-bar' ), number_format_i18n( $this->safe_memory_get_peak_usage() ) ),
|
||||
);
|
||||
|
||||
if ( ! WP_DEBUG )
|
||||
$statuses[] = array( 'warning', __('Please Enable', 'debug-bar'), 'WP_DEBUG' );
|
||||
if ( ! WP_DEBUG ) {
|
||||
$statuses[] = array(
|
||||
'warning',
|
||||
__( 'Please Enable', 'debug-bar' ),
|
||||
'WP_DEBUG',
|
||||
);
|
||||
}
|
||||
|
||||
$statuses = apply_filters( 'debug_bar_statuses', $statuses );
|
||||
$statuses = apply_filters( 'debug_bar_statuses', $statuses );
|
||||
|
||||
foreach ( $statuses as $status ):
|
||||
list( $slug, $title, $data ) = $status;
|
||||
foreach ( $statuses as $status ):
|
||||
list( $slug, $title, $data ) = $status;
|
||||
|
||||
?><div id='debug-status-<?php echo esc_attr( $slug ); ?>' class='debug-status'>
|
||||
<div class='debug-status-title'><?php echo $title; ?></div>
|
||||
<?php if ( ! empty( $data ) ): ?>
|
||||
?>
|
||||
<div id='debug-status-<?php echo esc_attr( $slug ); ?>' class='debug-status'>
|
||||
<div class='debug-status-title'><?php echo $title; ?></div>
|
||||
<?php if ( ! empty( $data ) ): ?>
|
||||
<div class='debug-status-data'><?php echo $data; ?></div>
|
||||
<?php endif; ?>
|
||||
</div><?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div><?php
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='debug-bar-menu'>
|
||||
<ul id="debug-menu-links">
|
||||
<div id='debug-bar-menu'>
|
||||
<ul id="debug-menu-links">
|
||||
|
||||
<?php
|
||||
$current = ' current';
|
||||
foreach ( $this->panels as $panel ) :
|
||||
$class = get_class( $panel );
|
||||
?>
|
||||
<li><a
|
||||
id="debug-menu-link-<?php echo esc_attr( $class ); ?>"
|
||||
class="debug-menu-link<?php echo $current; ?>"
|
||||
href="#debug-menu-target-<?php echo esc_attr( $class ); ?>">
|
||||
<?php
|
||||
// Not escaping html here, so panels can use html in the title.
|
||||
echo $panel->title();
|
||||
<?php
|
||||
$current = ' current';
|
||||
foreach ( $this->panels as $panel ) :
|
||||
$class = get_class( $panel );
|
||||
?>
|
||||
<li><a
|
||||
id="debug-menu-link-<?php echo esc_attr( $class ); ?>"
|
||||
class="debug-menu-link<?php echo $current; ?>"
|
||||
href="#debug-menu-target-<?php echo esc_attr( $class ); ?>">
|
||||
<?php
|
||||
// Not escaping html here, so panels can use html in the title.
|
||||
echo $panel->title();
|
||||
?>
|
||||
</a></li>
|
||||
<?php
|
||||
$current = '';
|
||||
endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="debug-menu-targets"><?php
|
||||
$current = ' style="display: block"';
|
||||
foreach ( $this->panels as $panel ) :
|
||||
$class = get_class( $panel ); ?>
|
||||
|
||||
<div id="debug-menu-target-<?php echo $class; ?>" class="debug-menu-target" <?php echo $current; ?>>
|
||||
<?php $panel->render(); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$current = '';
|
||||
endforeach;
|
||||
?>
|
||||
</a></li>
|
||||
<?php
|
||||
$current = '';
|
||||
endforeach; ?>
|
||||
</div>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="debug-menu-targets"><?php
|
||||
$current = ' style="display: block"';
|
||||
foreach ( $this->panels as $panel ) :
|
||||
$class = get_class( $panel ); ?>
|
||||
|
||||
<div id="debug-menu-target-<?php echo $class; ?>" class="debug-menu-target" <?php echo $current; ?>>
|
||||
<?php $panel->render(); ?>
|
||||
<?php do_action( 'debug_bar' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$current = '';
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'debug_bar' ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +1,67 @@
|
||||
(function() {
|
||||
( function() {
|
||||
var count, list, dbjsError,
|
||||
rawCount = 0,
|
||||
errors = [];
|
||||
|
||||
window.onerror = function( errorMsg, url, lineNumber ) {
|
||||
if ( ! document.getElementById( 'debug-bar-js-error-count' ) )
|
||||
errors[ errors.length ] = [errorMsg, url, lineNumber];
|
||||
else
|
||||
dbjsError(errorMsg, url, lineNumber);
|
||||
}
|
||||
window.onerror = function ( errorMsg, url, lineNumber ) {
|
||||
if ( ! document.getElementById( 'debug-bar-js-error-count' ) ) {
|
||||
errors[ errors.length ] = [ errorMsg, url, lineNumber ];
|
||||
} else {
|
||||
dbjsError( errorMsg, url, lineNumber );
|
||||
}
|
||||
};
|
||||
|
||||
jQuery(document).ready( function(){
|
||||
for ( err in errors )
|
||||
dbjsError( errors[err][0], errors[err][1], errors[err][2] );
|
||||
|
||||
});
|
||||
|
||||
dbjsError = function( errorMsg, url, lineNumber ) {
|
||||
jQuery( function () {
|
||||
for ( err in errors ) {
|
||||
dbjsError( errors[ err ][0], errors[ err ][1], errors[ err ][2] );
|
||||
}
|
||||
} );
|
||||
|
||||
dbjsError = function dbjsError( errorMsg, url, lineNumber ) {
|
||||
var errorLine, place, button, tab;
|
||||
|
||||
rawCount++;
|
||||
|
||||
if ( !count )
|
||||
if ( ! count ) {
|
||||
count = document.getElementById( 'debug-bar-js-error-count' );
|
||||
if ( !list )
|
||||
}
|
||||
if ( ! list ) {
|
||||
list = document.getElementById( 'debug-bar-js-errors' );
|
||||
}
|
||||
|
||||
if ( !count || !list )
|
||||
if ( ! count || ! list ) {
|
||||
return; // threw way too early... @todo cache these?
|
||||
}
|
||||
|
||||
if ( 1 == rawCount ) {
|
||||
button = document.getElementById( 'wp-admin-bar-debug-bar' );
|
||||
if ( !button )
|
||||
return; // how did this happen?
|
||||
if ( button.className.indexOf( 'debug-bar-php-warning-summary' ) === -1 )
|
||||
button.className = button.className + ' debug-bar-php-warning-summary';
|
||||
|
||||
tab = document.getElementById('debug-menu-link-Debug_Bar_JS');
|
||||
if ( tab )
|
||||
tab.style.display = 'block';
|
||||
if ( ! button ) {
|
||||
return; // how did this happen?
|
||||
}
|
||||
|
||||
if ( -1 === button.className.indexOf( 'debug-bar-php-warning-summary' ) ) {
|
||||
button.className = button.className + ' debug-bar-php-warning-summary';
|
||||
}
|
||||
|
||||
[ 'debug-menu-link-Debug_Bar_JS', 'wp-admin-bar-debug-bar-Debug_Bar_JS' ].map( function( id ) {
|
||||
tab = document.getElementById( id );
|
||||
if ( tab ) {
|
||||
tab.style.display = 'block';
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
count.textContent = rawCount;
|
||||
|
||||
errorLine = document.createElement( 'li' );
|
||||
errorLine.className = 'debug-bar-js-error';
|
||||
errorLine.textContent = errorMsg;
|
||||
|
||||
place = document.createElement( 'span' );
|
||||
place.textContent = url + ' line ' + lineNumber;
|
||||
|
||||
errorLine.appendChild( place );
|
||||
list.appendChild( errorLine );
|
||||
|
||||
};
|
||||
|
||||
})();
|
||||
} )();
|
||||
@@ -1 +1 @@
|
||||
(function(){var count,list,dbjsError,rawCount=0,errors=[];window.onerror=function(errorMsg,url,lineNumber){if(!document.getElementById("debug-bar-js-error-count")){errors[errors.length]=[errorMsg,url,lineNumber]}else{dbjsError(errorMsg,url,lineNumber)}};jQuery(document).ready(function(){for(err in errors){dbjsError(errors[err][0],errors[err][1],errors[err][2])}});dbjsError=function(errorMsg,url,lineNumber){var errorLine,place,button,tab;rawCount++;if(!count){count=document.getElementById("debug-bar-js-error-count")}if(!list){list=document.getElementById("debug-bar-js-errors")}if(!count||!list){return}if(1==rawCount){button=document.getElementById("wp-admin-bar-debug-bar");if(!button){return}if(button.className.indexOf("debug-bar-php-warning-summary")===-1){button.className=button.className+" debug-bar-php-warning-summary"}tab=document.getElementById("debug-menu-link-Debug_Bar_JS");if(tab){tab.style.display="block"}}count.textContent=rawCount;errorLine=document.createElement("li");errorLine.className="debug-bar-js-error";errorLine.textContent=errorMsg;place=document.createElement("span");place.textContent=url+" line "+lineNumber;errorLine.appendChild(place);list.appendChild(errorLine)}})();
|
||||
!function(){var e,i,t,r=0,n=[];window.onerror=function(e,i,r){document.getElementById("debug-bar-js-error-count")?t(e,i,r):n[n.length]=[e,i,r]},jQuery(function(){for(err in n)t(n[err][0],n[err][1],n[err][2])}),t=function(t,n,a){var s,o,u,d;if(r++,e||(e=document.getElementById("debug-bar-js-error-count")),i||(i=document.getElementById("debug-bar-js-errors")),e&&i){if(1==r){if(u=document.getElementById("wp-admin-bar-debug-bar"),!u)return;-1===u.className.indexOf("debug-bar-php-warning-summary")&&(u.className=u.className+" debug-bar-php-warning-summary"),["debug-menu-link-Debug_Bar_JS","wp-admin-bar-debug-bar-Debug_Bar_JS"].map(function(e){d=document.getElementById(e),d&&(d.style.display="block")})}e.textContent=r,s=document.createElement("li"),s.className="debug-bar-js-error",s.textContent=t,o=document.createElement("span"),o.textContent=n+" line "+a,s.appendChild(o),i.appendChild(s)}}}();
|
||||
@@ -1,106 +1,123 @@
|
||||
var wpDebugBar;
|
||||
|
||||
(function($) {
|
||||
( function( $ ) {
|
||||
var api;
|
||||
|
||||
var api;
|
||||
wpDebugBar = api = {
|
||||
// The element that we will pad to prevent the debug bar
|
||||
// from overlapping the bottom of the page.
|
||||
body: undefined,
|
||||
|
||||
wpDebugBar = api = {
|
||||
// The element that we will pad to prevent the debug bar
|
||||
// from overlapping the bottom of the page.
|
||||
body: undefined,
|
||||
init: function init() {
|
||||
// If we're not in the admin, pad the body.
|
||||
api.body = $( document.body );
|
||||
|
||||
init: function() {
|
||||
// If we're not in the admin, pad the body.
|
||||
api.body = $(document.body);
|
||||
|
||||
api.toggle.init();
|
||||
api.tabs();
|
||||
api.actions.init();
|
||||
},
|
||||
|
||||
isVisible: function() {
|
||||
return api.body.hasClass( 'debug-bar-visible' );
|
||||
},
|
||||
|
||||
toggle: {
|
||||
init: function() {
|
||||
$('#wp-admin-bar-debug-bar').click( function(e) {
|
||||
e.preventDefault();
|
||||
api.toggle.visibility();
|
||||
});
|
||||
api.toggle.init();
|
||||
api.tabs();
|
||||
api.actions.init();
|
||||
},
|
||||
visibility: function( show ) {
|
||||
show = typeof show == 'undefined' ? ! api.isVisible() : show;
|
||||
|
||||
// Show/hide the debug bar.
|
||||
api.body.toggleClass( 'debug-bar-visible', show );
|
||||
isVisible: function isVisible() {
|
||||
return api.body.hasClass( 'debug-bar-visible' );
|
||||
},
|
||||
|
||||
// Press/unpress the button.
|
||||
$(this).toggleClass( 'active', show );
|
||||
}
|
||||
},
|
||||
toggle: {
|
||||
init: function init() {
|
||||
$( '#wp-admin-bar-debug-bar' ).click( function onClickAdminBarMenu( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
tabs: function() {
|
||||
var debugMenuLinks = $('.debug-menu-link'),
|
||||
debugMenuTargets = $('.debug-menu-target');
|
||||
// Click on submenu item.
|
||||
if ( event.target.hash ) {
|
||||
var $menuLink = $( event.target.rel );
|
||||
|
||||
debugMenuLinks.click( function(e) {
|
||||
var t = $(this);
|
||||
// Open/close debug bar.
|
||||
if ( ! api.isVisible() ) {
|
||||
api.toggle.visibility();
|
||||
} else if ( $menuLink.hasClass( 'current' ) ) {
|
||||
$menuLink.removeClass( 'current' );
|
||||
api.toggle.visibility();
|
||||
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( t.hasClass('current') )
|
||||
return;
|
||||
// Deselect other tabs and hide other panels.
|
||||
$( '.debug-menu-target' ).hide().trigger( 'debug-bar-hide' );
|
||||
$( '.debug-menu-link' ).removeClass( 'current' );
|
||||
|
||||
// Deselect other tabs and hide other panels.
|
||||
debugMenuTargets.hide().trigger('debug-bar-hide');
|
||||
debugMenuLinks.removeClass('current');
|
||||
$menuLink.addClass( 'current' );
|
||||
$( event.target.hash ).show().trigger( 'debug-bar-show' );
|
||||
} else {
|
||||
api.toggle.visibility();
|
||||
}
|
||||
} );
|
||||
},
|
||||
visibility: function visibility( show ) {
|
||||
show = typeof show == 'undefined' ? ! api.isVisible() : show;
|
||||
|
||||
// Select the current tab and show the current panel.
|
||||
t.addClass('current');
|
||||
// The hashed component of the href is the id that we want to display.
|
||||
$('#' + this.href.substr( this.href.indexOf( '#' ) + 1 ) ).show().trigger('debug-bar-show');
|
||||
});
|
||||
},
|
||||
// Show/hide the debug bar.
|
||||
api.body.toggleClass( 'debug-bar-visible', show );
|
||||
|
||||
actions: {
|
||||
init: function() {
|
||||
var actions = $('#debug-bar-actions');
|
||||
// Press/unpress the button.
|
||||
$( this ).toggleClass( 'active', show );
|
||||
}
|
||||
},
|
||||
|
||||
// Close the panel with the esc key if it's open
|
||||
// 27 = esc
|
||||
$(document).keydown( function( e ) {
|
||||
var key = e.key || e.which || e.keyCode;
|
||||
if ( 27 != key || ! api.isVisible() )
|
||||
tabs: function tabs() {
|
||||
var debugMenuLinks = $( '.debug-menu-link' ),
|
||||
debugMenuTargets = $( '.debug-menu-target' );
|
||||
|
||||
debugMenuLinks.click( function onClickLink( event ) {
|
||||
var $this = $( this );
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if ( $this.hasClass( 'current' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
return api.actions.close();
|
||||
});
|
||||
// Deselect other tabs and hide other panels.
|
||||
debugMenuTargets.hide().trigger( 'debug-bar-hide' );
|
||||
debugMenuLinks.removeClass( 'current' );
|
||||
|
||||
$('.maximize', actions).click( api.actions.maximize );
|
||||
$('.restore', actions).click( api.actions.restore );
|
||||
$('.close', actions).click( api.actions.close );
|
||||
// Select the current tab and show the current panel.
|
||||
$this.addClass( 'current' );
|
||||
// The hashed component of the href is the id that we want to display.
|
||||
$( '#' + this.href.substr( this.href.indexOf( '#' ) + 1 ) ).show().trigger( 'debug-bar-show' );
|
||||
} );
|
||||
},
|
||||
maximize: function() {
|
||||
api.body.removeClass('debug-bar-partial');
|
||||
api.body.addClass('debug-bar-maximized');
|
||||
},
|
||||
restore: function() {
|
||||
api.body.removeClass('debug-bar-maximized');
|
||||
api.body.addClass('debug-bar-partial');
|
||||
},
|
||||
close: function() {
|
||||
api.toggle.visibility( false );
|
||||
console.log( 'boo');
|
||||
|
||||
actions: {
|
||||
init: function init() {
|
||||
var actions = $( '#debug-bar-actions' );
|
||||
|
||||
// Close the panel with the esc key if it's open.
|
||||
$( document ).keydown( function maybeClosePanel( event ) {
|
||||
var key = event.key || event.which || event.keyCode;
|
||||
|
||||
if ( 27 /* esc */ === key && api.isVisible() ) {
|
||||
event.preventDefault();
|
||||
api.actions.close();
|
||||
}
|
||||
} );
|
||||
|
||||
$( '.maximize', actions ).click( api.actions.maximize );
|
||||
$( '.restore', actions ).click( api.actions.restore );
|
||||
$( '.close', actions ).click( api.actions.close );
|
||||
},
|
||||
maximize: function maximize() {
|
||||
api.body.removeClass( 'debug-bar-partial' );
|
||||
api.body.addClass( 'debug-bar-maximized' );
|
||||
},
|
||||
restore: function restore() {
|
||||
api.body.removeClass( 'debug-bar-maximized' );
|
||||
api.body.addClass( 'debug-bar-partial' );
|
||||
},
|
||||
close: function close() {
|
||||
api.toggle.visibility( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
wpDebugBar.Panel = function() {
|
||||
$( wpDebugBar.init );
|
||||
|
||||
};
|
||||
|
||||
$(document).ready( wpDebugBar.init );
|
||||
|
||||
})(jQuery);
|
||||
} )( jQuery );
|
||||
@@ -1 +1 @@
|
||||
var wpDebugBar;(function(i){var e;wpDebugBar=e={body:void 0,init:function(){e.body=i(document.body),e.toggle.init(),e.tabs(),e.actions.init()},isVisible:function(){return e.body.hasClass("debug-bar-visible")},toggle:{init:function(){i("#wp-admin-bar-debug-bar").click(function(i){i.preventDefault(),e.toggle.visibility()})},visibility:function(t){t=t===void 0?!e.isVisible():t,e.body.toggleClass("debug-bar-visible",t),i(this).toggleClass("active",t)}},tabs:function(){var e=i(".debug-menu-link"),t=i(".debug-menu-target");e.click(function(a){var n=i(this);a.preventDefault(),n.hasClass("current")||(t.hide().trigger("debug-bar-hide"),e.removeClass("current"),n.addClass("current"),i("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=i("#debug-bar-actions");i(document).keydown(function(i){var t=i.key||i.which||i.keyCode;if(27==t&&e.isVisible())return i.preventDefault(),e.actions.close()}),i(".maximize",t).click(e.actions.maximize),i(".restore",t).click(e.actions.restore),i(".close",t).click(e.actions.close)},maximize:function(){e.body.removeClass("debug-bar-partial"),e.body.addClass("debug-bar-maximized")},restore:function(){e.body.removeClass("debug-bar-maximized"),e.body.addClass("debug-bar-partial")},close:function(){e.toggle.visibility(!1),console.log("boo")}}},wpDebugBar.Panel=function(){},i(document).ready(wpDebugBar.init)})(jQuery);
|
||||
var wpDebugBar;!function(e){var i;wpDebugBar=i={body:void 0,init:function(){i.body=e(document.body),i.toggle.init(),i.tabs(),i.actions.init()},isVisible:function(){return i.body.hasClass("debug-bar-visible")},toggle:{init:function(){e("#wp-admin-bar-debug-bar").click(function(t){if(t.preventDefault(),t.target.hash){var s=e(t.target.rel);if(i.isVisible()){if(s.hasClass("current"))return s.removeClass("current"),void i.toggle.visibility()}else i.toggle.visibility();e(".debug-menu-target").hide().trigger("debug-bar-hide"),e(".debug-menu-link").removeClass("current"),s.addClass("current"),e(t.target.hash).show().trigger("debug-bar-show")}else i.toggle.visibility()})},visibility:function(t){t=void 0===t?!i.isVisible():t,i.body.toggleClass("debug-bar-visible",t),e(this).toggleClass("active",t)}},tabs:function(){var i=e(".debug-menu-link"),t=e(".debug-menu-target");i.click(function(s){var r=e(this);s.preventDefault(),r.hasClass("current")||(t.hide().trigger("debug-bar-hide"),i.removeClass("current"),r.addClass("current"),e("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=e("#debug-bar-actions");e(document).keydown(function(e){var t=e.key||e.which||e.keyCode;27===t&&i.isVisible()&&(e.preventDefault(),i.actions.close())}),e(".maximize",t).click(i.actions.maximize),e(".restore",t).click(i.actions.restore),e(".close",t).click(i.actions.close)},maximize:function(){i.body.removeClass("debug-bar-partial"),i.body.addClass("debug-bar-maximized")},restore:function(){i.body.removeClass("debug-bar-maximized"),i.body.addClass("debug-bar-partial")},close:function(){i.toggle.visibility(!1)}}},e(wpDebugBar.init)}(jQuery);
|
||||
@@ -1,21 +1,23 @@
|
||||
<?php
|
||||
|
||||
// Alot of this code is massaged from Andrew Nacin's log-deprecated-notices plugin
|
||||
|
||||
class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
var $deprecated_functions = array();
|
||||
var $deprecated_files = array();
|
||||
var $deprecated_arguments = array();
|
||||
private $deprecated_functions = array();
|
||||
private $deprecated_files = array();
|
||||
private $deprecated_arguments = array();
|
||||
|
||||
function init() {
|
||||
$this->title( __('Deprecated', 'debug-bar') );
|
||||
$this->title( __( 'Deprecated', 'debug-bar' ) );
|
||||
|
||||
add_action( 'deprecated_function_run', array( &$this, 'deprecated_function_run' ), 10, 3 );
|
||||
add_action( 'deprecated_file_included', array( &$this, 'deprecated_file_included' ), 10, 4 );
|
||||
add_action( 'deprecated_argument_run', array( &$this, 'deprecated_argument_run' ), 10, 3 );
|
||||
add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ), 10, 3 );
|
||||
add_action( 'deprecated_file_included', array( $this, 'deprecated_file_included' ), 10, 4 );
|
||||
add_action( 'deprecated_argument_run', array( $this, 'deprecated_argument_run' ), 10, 3 );
|
||||
|
||||
// Silence E_NOTICE for deprecated usage.
|
||||
foreach ( array( 'function', 'file', 'argument' ) as $item )
|
||||
foreach ( array( 'function', 'file', 'argument' ) as $item ) {
|
||||
add_filter( "deprecated_{$item}_trigger_error", '__return_false' );
|
||||
}
|
||||
}
|
||||
|
||||
function prerender() {
|
||||
@@ -28,15 +30,15 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
|
||||
function render() {
|
||||
echo "<div id='debug-bar-deprecated'>";
|
||||
echo '<h2><span>Total Functions:</span>' . number_format( count( $this->deprecated_functions ) ) . "</h2>\n";
|
||||
echo '<h2><span>Total Arguments:</span>' . number_format( count( $this->deprecated_arguments ) ) . "</h2>\n";
|
||||
echo '<h2><span>Total Files:</span>' . number_format( count( $this->deprecated_files ) ) . "</h2>\n";
|
||||
echo '<h2><span>', __( 'Total Functions:', 'debug-bar' ), '</span>', number_format_i18n( count( $this->deprecated_functions ) ), "</h2>\n";
|
||||
echo '<h2><span>', __( 'Total Arguments:', 'debug-bar' ), '</span>', number_format_i18n( count( $this->deprecated_arguments ) ), "</h2>\n";
|
||||
echo '<h2><span>', __( 'Total Files:', 'debug-bar' ), '</span>', number_format_i18n( count( $this->deprecated_files ) ), "</h2>\n";
|
||||
if ( count( $this->deprecated_functions ) ) {
|
||||
echo '<ol class="debug-bar-deprecated-list">';
|
||||
foreach ( $this->deprecated_functions as $location => $message_stack) {
|
||||
list( $message, $stack) = $message_stack;
|
||||
foreach ( $this->deprecated_functions as $location => $message_stack ) {
|
||||
list( $message, $stack ) = $message_stack;
|
||||
echo "<li class='debug-bar-deprecated-function'>";
|
||||
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
||||
echo str_replace( ABSPATH, '', $location ) . ' - ' . strip_tags( $message );
|
||||
echo "<br/>";
|
||||
echo $stack;
|
||||
echo "</li>";
|
||||
@@ -45,10 +47,10 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
}
|
||||
if ( count( $this->deprecated_files ) ) {
|
||||
echo '<ol class="debug-bar-deprecated-list">';
|
||||
foreach ( $this->deprecated_files as $location => $message_stack) {
|
||||
list( $message, $stack) = $message_stack;
|
||||
foreach ( $this->deprecated_files as $location => $message_stack ) {
|
||||
list( $message, $stack ) = $message_stack;
|
||||
echo "<li class='debug-bar-deprecated-file'>";
|
||||
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
||||
echo str_replace( ABSPATH, '', $location ) . ' - ' . strip_tags( $message );
|
||||
echo "<br/>";
|
||||
echo $stack;
|
||||
echo "</li>";
|
||||
@@ -57,10 +59,10 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
}
|
||||
if ( count( $this->deprecated_arguments ) ) {
|
||||
echo '<ol class="debug-bar-deprecated-list">';
|
||||
foreach ( $this->deprecated_arguments as $location => $message_stack) {
|
||||
list( $message, $stack) = $message_stack;
|
||||
foreach ( $this->deprecated_arguments as $location => $message_stack ) {
|
||||
list( $message, $stack ) = $message_stack;
|
||||
echo "<li class='debug-bar-deprecated-argument'>";
|
||||
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
||||
echo str_replace( ABSPATH, '', $location ) . ' - ' . strip_tags( $message );
|
||||
echo "<br/>";
|
||||
echo $stack;
|
||||
echo "</li>";
|
||||
@@ -70,41 +72,52 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function deprecated_function_run($function, $replacement, $version) {
|
||||
function deprecated_function_run( $function, $replacement, $version ) {
|
||||
$backtrace = debug_backtrace( false );
|
||||
$bt = 4;
|
||||
$bt = 4;
|
||||
|
||||
// Check if we're a hook callback.
|
||||
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
||||
$bt = 6;
|
||||
}
|
||||
$file = $backtrace[ $bt ]['file'];
|
||||
$line = $backtrace[ $bt ]['line'];
|
||||
if ( ! is_null($replacement) )
|
||||
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 'debug-bar'), $function, $version, $replacement );
|
||||
else
|
||||
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $function, $version );
|
||||
|
||||
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
||||
$location = $backtrace[ $bt ]['file'] . ':' . $backtrace[ $bt ]['line'];
|
||||
|
||||
if ( ! is_null( $replacement ) ) {
|
||||
/* translators: %1$s is a function or file name, %2$s a version number, %3$s an alternative function or file to use. */
|
||||
$message = sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 'debug-bar' ), $function, $version, $replacement );
|
||||
} else {
|
||||
/* translators: %1$s is a function or file name, %2$s a version number. */
|
||||
$message = sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar' ), $function, $version );
|
||||
}
|
||||
|
||||
$this->deprecated_functions[ $location ] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
||||
}
|
||||
|
||||
function deprecated_file_included( $old_file, $replacement, $version, $message ) {
|
||||
$backtrace = debug_backtrace( false );
|
||||
$file = $backtrace[4]['file'];
|
||||
$file_abs = str_replace(ABSPATH, '', $file);
|
||||
$line = $backtrace[4]['line'];
|
||||
$message = empty( $message ) ? '' : ' ' . $message;
|
||||
if ( ! is_null( $replacement ) )
|
||||
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 'debug-bar'), $file_abs, $version, $replacement ) . $message;
|
||||
else
|
||||
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $file_abs, $version ) . $message;
|
||||
$file = $backtrace[4]['file'];
|
||||
$file_abs = str_replace( ABSPATH, '', $file );
|
||||
$location = $file . ':' . $backtrace[4]['line'];
|
||||
$message = empty( $message ) ? '' : ' ' . $message;
|
||||
|
||||
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, 4 ) );
|
||||
if ( ! is_null( $replacement ) ) {
|
||||
/* translators: %1$s is a function or file name, %2$s a version number, %3$s an alternative function or file to use. */
|
||||
$message = sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 'debug-bar' ), $file_abs, $version, $replacement ) . $message;
|
||||
} else {
|
||||
/* translators: %1$s is a function or file name, %2$s a version number. */
|
||||
$message = sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar' ), $file_abs, $version ) . $message;
|
||||
}
|
||||
|
||||
$this->deprecated_files[ $location ] = array( $message, wp_debug_backtrace_summary( null, 4 ) );
|
||||
}
|
||||
|
||||
function deprecated_argument_run( $function, $message, $version) {
|
||||
function deprecated_argument_run( $function, $message, $version ) {
|
||||
$backtrace = debug_backtrace( false );
|
||||
if ( $function === 'define()' ) {
|
||||
$this->deprecated_functions[] = array( $message, '' );
|
||||
|
||||
if ( 'define()' === $function ) {
|
||||
$this->deprecated_arguments[] = array( $message, '' );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,9 +125,15 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
||||
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
||||
$bt = 6;
|
||||
}
|
||||
$file = $backtrace[ $bt ]['file'];
|
||||
$line = $backtrace[ $bt ]['line'];
|
||||
|
||||
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
||||
$location = $backtrace[ $bt ]['file'] . ':' . $backtrace[ $bt ]['line'];
|
||||
|
||||
if ( ! is_null( $message ) ) {
|
||||
$message = sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), $function, $version, $message );
|
||||
} else {
|
||||
$message = sprintf( __( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $function, $version );
|
||||
}
|
||||
|
||||
$this->deprecated_arguments[ $location ] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Debug_Bar_JS extends Debug_Bar_Panel {
|
||||
var $real_error_handler = array();
|
||||
public $real_error_handler = array();
|
||||
|
||||
function init() {
|
||||
$this->title( __('JavaScript', 'debug-bar') );
|
||||
$this->title( __( 'JavaScript', 'debug-bar' ) );
|
||||
|
||||
// attach here instead of debug_bar_enqueue_scripts
|
||||
// because we want to be as early as possible!
|
||||
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
||||
wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js$suffix.js", dirname(__FILE__) ), array(), '20111216' );
|
||||
/*
|
||||
* attach here instead of debug_bar_enqueue_scripts
|
||||
* because we want to be as early as possible!
|
||||
*/
|
||||
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.dev' : '';
|
||||
wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js$suffix.js", dirname( __FILE__ ) ), array( 'jquery' ), '20111216' );
|
||||
}
|
||||
|
||||
function render() {
|
||||
echo '<div id="debug-bar-js">';
|
||||
echo '<h2><span>' . __( 'Total Errors:', 'debug-bar' ) . "</span><div id='debug-bar-js-error-count'>0</div></h2>\n";
|
||||
echo '<h2><span>' . __( 'Total Errors:', 'debug-bar' ) . "</span><span id='debug-bar-js-error-count'>0</span></h2>\n";
|
||||
echo '<ol class="debug-bar-js-list" id="debug-bar-js-errors"></ol>' . "\n";
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
|
||||
class Debug_Bar_Object_Cache extends Debug_Bar_Panel {
|
||||
function init() {
|
||||
$this->title( __('Object Cache', 'debug-bar') );
|
||||
$this->title( __( 'Object Cache', 'debug-bar' ) );
|
||||
}
|
||||
|
||||
function prerender() {
|
||||
global $wp_object_cache;
|
||||
$this->set_visible( is_object($wp_object_cache) && method_exists($wp_object_cache, 'stats') );
|
||||
$this->set_visible( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, 'stats' ) );
|
||||
}
|
||||
|
||||
function render() {
|
||||
global $wp_object_cache;
|
||||
|
||||
ob_start();
|
||||
echo "<div id='object-cache-stats'>";
|
||||
$wp_object_cache->stats();
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
<?php
|
||||
|
||||
class Debug_Bar_Panel {
|
||||
var $_title = '';
|
||||
var $_visible = true;
|
||||
public $_title = '';
|
||||
public $_visible = true;
|
||||
|
||||
function __construct( $title = '' ) {
|
||||
$this->title( $title );
|
||||
|
||||
if ( $this->init() === false ) {
|
||||
$this->set_visible( false );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter( 'debug_bar_classes', array( &$this, 'debug_bar_classes' ) );
|
||||
add_filter( 'debug_bar_classes', array( $this, 'debug_bar_classes' ) );
|
||||
}
|
||||
|
||||
function Debug_Bar_Panel( $title = '' ) {
|
||||
Debug_Bar_Panel::__construct( $title );
|
||||
_deprecated_constructor( __METHOD__, '0.8.3', __CLASS__ );
|
||||
self::__construct( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,9 +41,17 @@ class Debug_Bar_Panel {
|
||||
$this->_visible = $visible;
|
||||
}
|
||||
|
||||
function title( $title=NULL ) {
|
||||
if ( ! isset( $title ) )
|
||||
/**
|
||||
* Get/set title.
|
||||
*
|
||||
* @param null $title
|
||||
* @return string|void
|
||||
*/
|
||||
function title( $title = null ) {
|
||||
if ( ! isset( $title ) ) {
|
||||
return $this->_title;
|
||||
}
|
||||
|
||||
$this->_title = $title;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Debug_Bar_PHP extends Debug_Bar_Panel {
|
||||
var $warnings = array();
|
||||
var $notices = array();
|
||||
var $real_error_handler = array();
|
||||
public $warnings = array();
|
||||
public $notices = array();
|
||||
public $real_error_handler = array();
|
||||
|
||||
function init() {
|
||||
if ( ! WP_DEBUG )
|
||||
if ( ! WP_DEBUG ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->title( __('Notices / Warnings', 'debug-bar') );
|
||||
$this->title( __( 'Notices / Warnings', 'debug-bar' ) );
|
||||
|
||||
$this->real_error_handler = set_error_handler( array( &$this, 'error_handler' ) );
|
||||
}
|
||||
@@ -19,73 +20,92 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
|
||||
}
|
||||
|
||||
function debug_bar_classes( $classes ) {
|
||||
if ( count( $this->warnings ) )
|
||||
if ( count( $this->warnings ) ) {
|
||||
$classes[] = 'debug-bar-php-warning-summary';
|
||||
elseif ( count( $this->notices ) )
|
||||
} elseif ( count( $this->notices ) ) {
|
||||
$classes[] = 'debug-bar-php-notice-summary';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
function error_handler( $type, $message, $file, $line ) {
|
||||
$_key = md5( $file . ':' . $line . ':' . $message );
|
||||
|
||||
if ( ! defined( 'E_DEPRECATED' ) ) {
|
||||
define( 'E_DEPRECATED', 8192 );
|
||||
}
|
||||
if ( ! defined( 'E_USER_DEPRECATED' ) ) {
|
||||
define( 'E_USER_DEPRECATED', 16384 );
|
||||
}
|
||||
|
||||
switch ( $type ) {
|
||||
case E_WARNING :
|
||||
case E_USER_WARNING :
|
||||
$this->warnings[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
|
||||
case E_WARNING:
|
||||
case E_USER_WARNING:
|
||||
$this->warnings[ $_key ] = array(
|
||||
$file . ':' . $line,
|
||||
$message,
|
||||
wp_debug_backtrace_summary( __CLASS__ ),
|
||||
);
|
||||
break;
|
||||
case E_NOTICE :
|
||||
case E_USER_NOTICE :
|
||||
$this->notices[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
|
||||
case E_NOTICE:
|
||||
case E_USER_NOTICE:
|
||||
$this->notices[ $_key ] = array(
|
||||
$file . ':' . $line,
|
||||
$message,
|
||||
wp_debug_backtrace_summary( __CLASS__ ),
|
||||
);
|
||||
break;
|
||||
case E_STRICT :
|
||||
case E_STRICT:
|
||||
// TODO
|
||||
break;
|
||||
case E_DEPRECATED :
|
||||
case E_USER_DEPRECATED :
|
||||
case E_DEPRECATED:
|
||||
case E_USER_DEPRECATED:
|
||||
// TODO
|
||||
break;
|
||||
case 0 :
|
||||
case 0:
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
|
||||
if ( null != $this->real_error_handler )
|
||||
if ( null != $this->real_error_handler ) {
|
||||
return call_user_func( $this->real_error_handler, $type, $message, $file, $line );
|
||||
else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function render() {
|
||||
echo "<div id='debug-bar-php'>";
|
||||
echo '<h2><span>Total Warnings:</span>' . number_format( count( $this->warnings ) ) . "</h2>\n";
|
||||
echo '<h2><span>Total Notices:</span>' . number_format( count( $this->notices ) ) . "</h2>\n";
|
||||
echo '<h2><span>', __( 'Total Warnings:', 'debug-bar' ), '</span>', number_format_i18n( count( $this->warnings ) ), "</h2>\n";
|
||||
echo '<h2><span>', __( 'Total Notices:', 'debug-bar' ), '</span>', number_format_i18n( count( $this->notices ) ), "</h2>\n";
|
||||
|
||||
if ( count( $this->warnings ) ) {
|
||||
echo '<ol class="debug-bar-php-list">';
|
||||
foreach ( $this->warnings as $location_message_stack ) {
|
||||
list( $location, $message, $stack) = $location_message_stack;
|
||||
echo '<li class="debug-bar-php-warning">WARNING: ';
|
||||
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
||||
list( $location, $message, $stack ) = $location_message_stack;
|
||||
echo '<li class="debug-bar-php-warning">', __( 'WARNING:', 'debug-bar' ), ' ';
|
||||
echo str_replace( ABSPATH, '', $location ) . ' - ' . strip_tags( $message );
|
||||
echo '<br/>';
|
||||
echo $stack;
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ol>';
|
||||
}
|
||||
|
||||
if ( count( $this->notices ) ) {
|
||||
echo '<ol class="debug-bar-php-list">';
|
||||
foreach ( $this->notices as $location_message_stack) {
|
||||
list( $location, $message, $stack) = $location_message_stack;
|
||||
echo '<li class="debug-bar-php-notice">NOTICE: ';
|
||||
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
||||
foreach ( $this->notices as $location_message_stack ) {
|
||||
list( $location, $message, $stack ) = $location_message_stack;
|
||||
echo '<li class="debug-bar-php-notice">', __( 'NOTICE:', 'debug-bar' ), ' ';
|
||||
echo str_replace( ABSPATH, '', $location ) . ' - ' . strip_tags( $message );
|
||||
echo '<br/>';
|
||||
echo $stack;
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ol>';
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +1,93 @@
|
||||
<?php
|
||||
|
||||
class Debug_Bar_Queries extends Debug_Bar_Panel {
|
||||
|
||||
function init() {
|
||||
$this->title( __('Queries', 'debug-bar') );
|
||||
$this->title( __( 'Queries', 'debug-bar' ) );
|
||||
}
|
||||
|
||||
function prerender() {
|
||||
$this->set_visible( defined('SAVEQUERIES') && SAVEQUERIES || ! empty($GLOBALS['EZSQL_ERROR']) );
|
||||
$this->set_visible( defined( 'SAVEQUERIES' ) && SAVEQUERIES || ! empty( $GLOBALS['EZSQL_ERROR'] ) );
|
||||
}
|
||||
|
||||
function debug_bar_classes( $classes ) {
|
||||
if ( ! empty($GLOBALS['EZSQL_ERROR']) )
|
||||
if ( ! empty( $GLOBALS['EZSQL_ERROR'] ) ) {
|
||||
$classes[] = 'debug-bar-php-warning-summary';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
function render() {
|
||||
global $wpdb, $EZSQL_ERROR;
|
||||
|
||||
$out = '';
|
||||
$out = '';
|
||||
$total_time = 0;
|
||||
|
||||
if ( !empty($wpdb->queries) ) {
|
||||
$show_many = isset($_GET['debug_queries']);
|
||||
if ( ! empty( $wpdb->queries ) ) {
|
||||
$show_many = isset( $_GET['debug_queries'] );
|
||||
|
||||
if ( $wpdb->num_queries > 500 && !$show_many )
|
||||
$out .= "<p>" . sprintf( __('There are too many queries to show easily! <a href="%s">Show them anyway</a>', 'debug-bar'), esc_url( add_query_arg( 'debug_queries', 'true' ) ) ) . "</p>";
|
||||
if ( $wpdb->num_queries > 500 && ! $show_many ) {
|
||||
/* translators: %s = a url. */
|
||||
$out .= "<p>" . sprintf( __( 'There are too many queries to show easily! <a href="%s">Show them anyway</a>', 'debug-bar' ), esc_url( add_query_arg( 'debug_queries', 'true' ) ) ) . "</p>";
|
||||
}
|
||||
|
||||
$out .= '<ol class="wpd-queries">';
|
||||
$counter = 0;
|
||||
|
||||
foreach ( $wpdb->queries as $q ) {
|
||||
list($query, $elapsed, $debug) = $q;
|
||||
list( $query, $elapsed, $debug ) = $q;
|
||||
|
||||
$total_time += $elapsed;
|
||||
|
||||
if ( ++$counter > 500 && ! $show_many )
|
||||
if ( ++$counter > 500 && ! $show_many ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$debug = explode( ', ', $debug );
|
||||
$debug = array_diff( $debug, array( 'require_once', 'require', 'include_once', 'include' ) );
|
||||
$debug = implode( ', ', $debug );
|
||||
$debug = str_replace( array( 'do_action, call_user_func_array' ), array( 'do_action' ), $debug );
|
||||
$query = nl2br(esc_html($query));
|
||||
$debug = esc_html( $debug );
|
||||
$query = nl2br( esc_html( $query ) );
|
||||
/* translators: %0.1f = duration in microseconds. */
|
||||
$time = esc_html( sprintf( __( '%0.1f ms', 'debug-bar' ), number_format_i18n( ( $elapsed * 1000 ), 1 ) ) );
|
||||
|
||||
$out .= "<li>$query<br/><div class='qdebug'>$debug <span>#{$counter} (" . number_format(sprintf('%0.1f', $elapsed * 1000), 1, '.', ',') . "ms)</span></div></li>\n";
|
||||
/* translators: %d = duration time in microseconds. */
|
||||
$out .= "<li>$query<br/><div class='qdebug'>$debug <span>#$counter ($time)</span></div></li>\n";
|
||||
}
|
||||
$out .= '</ol>';
|
||||
} else if ( 0 === $wpdb->num_queries ) {
|
||||
$out .= "<p><strong>" . __( 'There are no queries on this page.', 'debug-bar' ) . "</strong></p>";
|
||||
} else {
|
||||
if ( $wpdb->num_queries == 0 )
|
||||
$out .= "<p><strong>" . __('There are no queries on this page.', 'debug-bar') . "</strong></p>";
|
||||
else
|
||||
$out .= "<p><strong>" . __('SAVEQUERIES must be defined to show the query log.', 'debug-bar') . "</strong></p>";
|
||||
$out .= "<p><strong>" . __( 'SAVEQUERIES must be defined to show the query log.', 'debug-bar' ) . "</strong></p>";
|
||||
}
|
||||
|
||||
if ( ! empty($EZSQL_ERROR) ) {
|
||||
if ( ! empty( $EZSQL_ERROR ) ) {
|
||||
$out .= '<h3>' . __( 'Database Errors', 'debug-bar' ) . '</h3>';
|
||||
$out .= '<ol class="wpd-queries">';
|
||||
|
||||
foreach ( $EZSQL_ERROR as $e ) {
|
||||
$query = nl2br(esc_html($e['query']));
|
||||
$out .= "<li>$query<br/><div class='qdebug'>{$e['error_str']}</div></li>\n";
|
||||
foreach ( $EZSQL_ERROR as $error ) {
|
||||
$query = nl2br( esc_html( $error['query'] ) );
|
||||
$message = esc_html( $error['error_str'] );
|
||||
$out .= "<li>$query<br/><div class='qdebug'>$message</div></li>\n";
|
||||
}
|
||||
$out .= '</ol>';
|
||||
}
|
||||
|
||||
$heading = '';
|
||||
if ( $wpdb->num_queries )
|
||||
$heading .= '<h2><span>Total Queries:</span>' . number_format( $wpdb->num_queries ) . "</h2>\n";
|
||||
if ( $total_time )
|
||||
$heading .= '<h2><span>Total query time:</span>' . number_format(sprintf('%0.1f', $total_time * 1000), 1) . " ms</h2>\n";
|
||||
if ( ! empty($EZSQL_ERROR) )
|
||||
$heading .= '<h2><span>Total DB Errors:</span>' . number_format( count($EZSQL_ERROR) ) . "</h2>\n";
|
||||
if ( $wpdb->num_queries ) {
|
||||
$heading .= '<h2><span>' . __( 'Total Queries:', 'debug-bar' ) . '</span>' . number_format_i18n( $wpdb->num_queries ) . "</h2>\n";
|
||||
}
|
||||
if ( $total_time ) {
|
||||
$heading .= '<h2><span>' . __( 'Total query time:', 'debug-bar' ) . '</span>';
|
||||
/* translators: %0.1f = duration in microseconds. */
|
||||
$heading .= sprintf( __( '%0.1f ms', 'debug-bar' ), number_format_i18n( ( $total_time * 1000 ), 1 ) ) . "</h2>\n";
|
||||
}
|
||||
if ( ! empty( $EZSQL_ERROR ) ) {
|
||||
$heading .= '<h2><span>' . __( 'Total DB Errors:', 'debug-bar' ) . '</span>' . number_format_i18n( count( $EZSQL_ERROR ) ) . "</h2>\n";
|
||||
}
|
||||
|
||||
$out = $heading . $out;
|
||||
|
||||
echo $out;
|
||||
echo $heading . $out;
|
||||
}
|
||||
}
|
||||
@@ -14,36 +14,40 @@ class Debug_Bar_Request extends Debug_Bar_Panel {
|
||||
|
||||
echo "<div id='debug-bar-request'>";
|
||||
|
||||
if ( empty($wp->request) )
|
||||
$request = 'None';
|
||||
else
|
||||
if ( empty( $wp->request ) ) {
|
||||
$request = __( 'None', 'debug-bar' );
|
||||
} else {
|
||||
$request = $wp->request;
|
||||
}
|
||||
|
||||
echo '<h3>Request:</h3>';
|
||||
echo '<h3>', __( 'Request:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $request ) . '</p>';
|
||||
|
||||
if ( empty($wp->query_string) )
|
||||
$query_string = 'None';
|
||||
else
|
||||
if ( empty( $wp->query_string ) ) {
|
||||
$query_string = __( 'None', 'debug-bar' );
|
||||
} else {
|
||||
$query_string = $wp->query_string;
|
||||
}
|
||||
|
||||
echo '<h3>Query String:</h3>';
|
||||
echo '<h3>', __( 'Query String:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $query_string ) . '</p>';
|
||||
|
||||
if ( empty($wp->matched_rule) )
|
||||
$matched_rule = 'None';
|
||||
else
|
||||
if ( empty( $wp->matched_rule ) ) {
|
||||
$matched_rule = __( 'None', 'debug-bar' );
|
||||
} else {
|
||||
$matched_rule = $wp->matched_rule;
|
||||
}
|
||||
|
||||
echo '<h3>Matched Rewrite Rule:</h3>';
|
||||
echo '<h3>', __( 'Matched Rewrite Rule:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $matched_rule ) . '</p>';
|
||||
|
||||
if ( empty($wp->matched_query) )
|
||||
$matched_query = 'None';
|
||||
else
|
||||
if ( empty( $wp->matched_query ) ) {
|
||||
$matched_query = __( 'None', 'debug-bar' );
|
||||
} else {
|
||||
$matched_query = $wp->matched_query;
|
||||
}
|
||||
|
||||
echo '<h3>Matched Rewrite Query:</h3>';
|
||||
echo '<h3>', __( 'Matched Rewrite Query:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $matched_query ) . '</p>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
@@ -2,105 +2,112 @@
|
||||
|
||||
class Debug_Bar_WP_Query extends Debug_Bar_Panel {
|
||||
function init() {
|
||||
$this->title( __('WP Query', 'debug-bar') );
|
||||
$this->title( __( 'WP Query', 'debug-bar' ) );
|
||||
}
|
||||
|
||||
function prerender() {
|
||||
$this->set_visible( defined('SAVEQUERIES') && SAVEQUERIES );
|
||||
$this->set_visible( defined( 'SAVEQUERIES' ) && SAVEQUERIES );
|
||||
}
|
||||
|
||||
function render() {
|
||||
global $template, $wp_query;
|
||||
|
||||
$queried_object = get_queried_object();
|
||||
if ( $queried_object && isset( $queried_object->post_type ) )
|
||||
if ( $queried_object && isset( $queried_object->post_type ) ) {
|
||||
$post_type_object = get_post_type_object( $queried_object->post_type );
|
||||
}
|
||||
|
||||
echo "<div id='debug-bar-wp-query'>";
|
||||
echo '<h2><span>Queried Object ID:</span>' . get_queried_object_id() . "</h2>\n";
|
||||
echo '<h2><span>', __( 'Queried Object ID:', 'debug-bar' ), '</span>', get_queried_object_id(), "</h2>\n";
|
||||
|
||||
// Determine the query type. Follows the template loader order.
|
||||
$type = '';
|
||||
if ( is_404() )
|
||||
$type = '404';
|
||||
elseif ( is_search() )
|
||||
$type = 'Search';
|
||||
elseif ( is_tax() )
|
||||
$type = 'Taxonomy';
|
||||
elseif ( is_front_page() )
|
||||
$type = 'Front Page';
|
||||
elseif ( is_home() )
|
||||
$type = 'Home';
|
||||
elseif ( is_attachment() )
|
||||
$type = 'Attachment';
|
||||
elseif ( is_single() )
|
||||
$type = 'Single';
|
||||
elseif ( is_page() )
|
||||
$type = 'Page';
|
||||
elseif ( is_category() )
|
||||
$type = 'Category';
|
||||
elseif ( is_tag() )
|
||||
$type = 'Tag';
|
||||
elseif ( is_author() )
|
||||
$type = 'Author';
|
||||
elseif ( is_date() )
|
||||
$type = 'Date';
|
||||
elseif ( is_archive() )
|
||||
$type = 'Archive';
|
||||
elseif ( is_paged() )
|
||||
$type = 'Paged';
|
||||
|
||||
if ( !empty($type) )
|
||||
echo '<h2><span>Query Type:</span>' . $type . "</h2>\n";
|
||||
|
||||
if ( !empty($template) )
|
||||
echo '<h2><span>Query Template:</span>' . basename($template) . "</h2>\n";
|
||||
|
||||
$show_on_front = get_option( 'show_on_front' );
|
||||
$page_on_front = get_option( 'page_on_front' );
|
||||
$page_for_posts = get_option( 'page_for_posts' );
|
||||
|
||||
echo '<h2><span>Show on Front:</span>' . $show_on_front . "</h2>\n";
|
||||
if ( 'page' == $show_on_front ) {
|
||||
echo '<h2><span>Page for Posts:</span>' . $page_for_posts . "</h2>\n";
|
||||
echo '<h2><span>Page on Front:</span>' . $page_on_front . "</h2>\n";
|
||||
if ( is_404() ) {
|
||||
$type = __( '404', 'debug-bar' );
|
||||
} elseif ( is_search() ) {
|
||||
$type = __( 'Search', 'debug-bar' );
|
||||
} elseif ( is_tax() ) {
|
||||
$type = __( 'Taxonomy', 'debug-bar' );
|
||||
} elseif ( is_front_page() ) {
|
||||
$type = __( 'Front Page', 'debug-bar' );
|
||||
} elseif ( is_home() ) {
|
||||
$type = __( 'Home', 'debug-bar' );
|
||||
} elseif ( is_attachment() ) {
|
||||
$type = __( 'Attachment', 'debug-bar' );
|
||||
} elseif ( is_single() ) {
|
||||
$type = __( 'Single', 'debug-bar' );
|
||||
} elseif ( is_page() ) {
|
||||
$type = __( 'Page', 'debug-bar' );
|
||||
} elseif ( is_category() ) {
|
||||
$type = __( 'Category', 'debug-bar' );
|
||||
} elseif ( is_tag() ) {
|
||||
$type = __( 'Tag', 'debug-bar' );
|
||||
} elseif ( is_author() ) {
|
||||
$type = __( 'Author', 'debug-bar' );
|
||||
} elseif ( is_date() ) {
|
||||
$type = __( 'Date', 'debug-bar' );
|
||||
} elseif ( is_archive() ) {
|
||||
$type = __( 'Archive', 'debug-bar' );
|
||||
} elseif ( is_paged() ) {
|
||||
$type = __( 'Paged', 'debug-bar' );
|
||||
}
|
||||
|
||||
if ( isset( $post_type_object ) )
|
||||
echo '<h2><span>Post Type:</span>' . $post_type_object->labels->singular_name . "</h2>\n";
|
||||
if ( ! empty( $type ) ) {
|
||||
echo '<h2><span>', __( 'Query Type:', 'debug-bar' ), '</span>', $type, "</h2>\n";
|
||||
}
|
||||
|
||||
if ( ! empty( $template ) ) {
|
||||
echo '<h2><span>', __( 'Query Template:', 'debug-bar' ), '</span>', basename( $template ), "</h2>\n";
|
||||
}
|
||||
|
||||
$show_on_front = get_option( 'show_on_front' );
|
||||
$page_on_front = get_option( 'page_on_front' );
|
||||
$page_for_posts = get_option( 'page_for_posts' );
|
||||
|
||||
echo '<h2><span>', __( 'Show on Front:', 'debug-bar' ), '</span>', $show_on_front, "</h2>\n";
|
||||
if ( 'page' == $show_on_front ) {
|
||||
echo '<h2><span>', __( 'Page for Posts:', 'debug-bar' ), '</span>', $page_for_posts, "</h2>\n";
|
||||
echo '<h2><span>', __( 'Page on Front:', 'debug-bar' ), '</span>', $page_on_front, "</h2>\n";
|
||||
}
|
||||
|
||||
if ( isset( $post_type_object ) ) {
|
||||
echo '<h2><span>', __( 'Post Type:', 'debug-bar' ), '</span>', $post_type_object->labels->singular_name, "</h2>\n";
|
||||
}
|
||||
|
||||
echo '<div class="clear"></div>';
|
||||
|
||||
if ( empty($wp_query->query) )
|
||||
$query = 'None';
|
||||
else
|
||||
if ( empty( $wp_query->query ) ) {
|
||||
$query = __( 'None', 'debug-bar' );
|
||||
} else {
|
||||
$query = http_build_query( $wp_query->query );
|
||||
}
|
||||
|
||||
echo '<h3>Query Arguments:</h3>';
|
||||
echo '<h3>', __( 'Query Arguments:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $query ) . '</p>';
|
||||
|
||||
if ( ! empty($wp_query->request) ) {
|
||||
echo '<h3>Query SQL:</h3>';
|
||||
if ( ! empty( $wp_query->request ) ) {
|
||||
echo '<h3>', __( 'Query SQL:', 'debug-bar' ), '</h3>';
|
||||
echo '<p>' . esc_html( $wp_query->request ) . '</p>';
|
||||
}
|
||||
|
||||
if ( ! is_null( $queried_object ) ) {
|
||||
echo '<h3>Queried Object:</h3>';
|
||||
echo '<ol class="debug-bar-wp-query-list">';
|
||||
$this->_recursive_print_kv($queried_object);
|
||||
echo '</ol>';
|
||||
echo '<h3>', __( 'Queried Object:', 'debug-bar' ), '</h3>';
|
||||
echo '<table class="debug-bar-wp-query-list"><tbody>';
|
||||
$this->_recursive_print_kv( $queried_object );
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
protected function _recursive_print_kv( $kv_array ) {
|
||||
foreach ( $kv_array as $key => $value ) {
|
||||
if( is_object( $value ) || is_array( $value ) ) {
|
||||
printf( '<li>%s => <ol>', $key );
|
||||
$this->_recursive_print_kv( $value );
|
||||
echo '</ol></li>';
|
||||
} else {
|
||||
echo "<li>{$key} => {$value}</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function _recursive_print_kv( $kv_array ) {
|
||||
foreach ( $kv_array as $key => $value ) {
|
||||
if ( is_object( $value ) || is_array( $value ) ) {
|
||||
echo '<tr><th>', $key, '</th> <td>⇒</td> <td>';
|
||||
$this->_recursive_print_kv( $value );
|
||||
echo '</td></tr>';
|
||||
} else {
|
||||
echo '<tr><th>', $key, '</th> <td>⇒</td> <td>', $value, '</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
=== Debug Bar ===
|
||||
Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka, dd32
|
||||
Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka, dd32, jrf, obenland
|
||||
Tags: debug
|
||||
Tested up to: 4.5
|
||||
Stable tag: 0.8.4
|
||||
Requires at least: 3.1
|
||||
Tested up to: 4.8
|
||||
Stable tag: 0.9
|
||||
Requires at least: 3.4
|
||||
|
||||
Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
||||
|
||||
@@ -13,14 +13,27 @@ Adds a debug menu to the admin bar that shows query, cache, and other helpful de
|
||||
|
||||
A must for developers!
|
||||
|
||||
When WP_DEBUG is enabled it also tracks PHP Warnings and Notices to make them easier to find.
|
||||
When `WP_DEBUG` is enabled it also tracks PHP Warnings and Notices to make them easier to find.
|
||||
|
||||
When SAVEQUERIES is enabled the mysql queries are tracked and displayed.
|
||||
When `SAVEQUERIES` is enabled the mysql queries are tracked and displayed.
|
||||
|
||||
To enable these options, add the following code to your `wp-config.php` file:
|
||||
`
|
||||
define( 'WP_DEBUG', true );
|
||||
define( 'SAVEQUERIES', true );
|
||||
`
|
||||
|
||||
Add a PHP/MySQL console with the [Debug Bar Console plugin](https://wordpress.org/plugins/debug-bar-console/).
|
||||
|
||||
There are numerous other add-ons available to get more insight into, for instance, the registered Post Types, Shortcodes, WP Cron, Language file loading, Actions and Filters and so on. Just [search the plugin directory for 'Debug Bar'](https://wordpress.org/plugins/search/debug+bar/).
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 0.9 =
|
||||
Added panel navigation to toolbar.
|
||||
Improved localization support.
|
||||
Security fixes.
|
||||
|
||||
= 0.8.4 =
|
||||
Updated to avoid incompatibilities with some extensions.
|
||||
|
||||
@@ -81,6 +94,11 @@ Initial Release
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 0.9 =
|
||||
Added panel navigation to toolbar.
|
||||
Improved localization support.
|
||||
Security fixes.
|
||||
|
||||
= 0.8.4 =
|
||||
Updated to avoid incompatibilities with some extensions.
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
add_action( 'admin_init', 'duplicate_post_jetpack_init' );
|
||||
|
||||
|
||||
function duplicate_post_jetpack_init() {
|
||||
add_filter('duplicate_post_blacklist_filter', 'duplicate_post_jetpack_add_to_blacklist', 10, 1 );
|
||||
|
||||
if (class_exists('WPCom_Markdown')){
|
||||
add_action('duplicate_post_pre_copy', 'duplicate_post_jetpack_disable_markdown', 10);
|
||||
add_action('duplicate_post_post_copy', 'duplicate_post_jetpack_enable_markdown', 10);
|
||||
}
|
||||
}
|
||||
|
||||
function duplicate_post_jetpack_add_to_blacklist($meta_blacklist) {
|
||||
$meta_blacklist[] = '_wpas*'; //Jetpack Publicize
|
||||
$meta_blacklist[] = '_publicize*'; //Jetpack Publicize
|
||||
|
||||
$meta_blacklist[] = '_jetpack*'; //Jetpack Subscriptions etc.
|
||||
|
||||
return $meta_blacklist;
|
||||
}
|
||||
|
||||
// Markdown
|
||||
function duplicate_post_jetpack_disable_markdown(){
|
||||
WPCom_Markdown::get_instance()->unload_markdown_for_posts();
|
||||
}
|
||||
|
||||
function duplicate_post_jetpack_enable_markdown(){
|
||||
WPCom_Markdown::get_instance()->load_markdown_for_posts();
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
add_action( 'admin_init', 'duplicate_post_wpml_init' );
|
||||
|
||||
function duplicate_post_wpml_init() {
|
||||
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
||||
add_action('dp_duplicate_page', 'duplicate_post_wpml_copy_translations', 10, 3);
|
||||
add_action('dp_duplicate_post', 'duplicate_post_wpml_copy_translations', 10, 3);
|
||||
}
|
||||
}
|
||||
|
||||
function duplicate_post_wpml_copy_translations($post_id, $post, $status = '') {
|
||||
global $sitepress;
|
||||
|
||||
remove_action('dp_duplicate_page', 'duplicate_post_wpml_copy_translations', 10);
|
||||
remove_action('dp_duplicate_post', 'duplicate_post_wpml_copy_translations', 10);
|
||||
|
||||
$current_language = $sitepress->get_current_language();
|
||||
$trid = $sitepress->get_element_trid($post->ID);
|
||||
if (!empty($trid)) {
|
||||
$translations = $sitepress->get_element_translations($trid);
|
||||
$new_trid = $sitepress->get_element_trid($post_id);
|
||||
foreach ($translations as $code => $details) {
|
||||
if ($code != $current_language) {
|
||||
$translation = get_post($details->element_id);
|
||||
$new_post_id = duplicate_post_create_duplicate($translation, $status);
|
||||
$sitepress->set_element_language_details($new_post_id, 'post_' . $translation->post_type, $new_trid, $code, $current_language);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -5,6 +5,9 @@ if(!is_admin())
|
||||
|
||||
require_once (dirname(__FILE__).'/duplicate-post-options.php');
|
||||
|
||||
require_once (dirname(__FILE__).'/compat/duplicate-post-wpml.php');
|
||||
require_once (dirname(__FILE__).'/compat/duplicate-post-jetpack.php');
|
||||
|
||||
/**
|
||||
* Wrapper for the option 'duplicate_post_version'
|
||||
*/
|
||||
@@ -19,11 +22,70 @@ function duplicate_post_get_current_version() {
|
||||
return DUPLICATE_POST_CURRENT_VERSION;
|
||||
}
|
||||
|
||||
|
||||
add_action('admin_init','duplicate_post_admin_init');
|
||||
|
||||
function duplicate_post_admin_init(){
|
||||
duplicate_post_plugin_upgrade();
|
||||
|
||||
if (get_option('duplicate_post_show_row') == 1){
|
||||
add_filter('post_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
|
||||
add_filter('page_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
|
||||
}
|
||||
|
||||
if (get_site_option('duplicate_post_show_notice') == 1){
|
||||
if(is_multisite()){
|
||||
add_action( 'network_admin_notices', 'duplicate_post_show_update_notice' );
|
||||
} else {
|
||||
add_action( 'admin_notices', 'duplicate_post_show_update_notice' );
|
||||
}
|
||||
add_action( 'wp_ajax_duplicate_post_dismiss_notice', 'duplicate_post_dismiss_notice' );
|
||||
}
|
||||
|
||||
if (get_option('duplicate_post_show_submitbox') == 1){
|
||||
add_action( 'post_submitbox_start', 'duplicate_post_add_duplicate_post_button' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect actions to functions
|
||||
*/
|
||||
add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
|
||||
add_action('admin_action_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
|
||||
|
||||
add_filter('removable_query_args', 'duplicate_post_add_removable_query_arg', 10, 1);
|
||||
|
||||
// Using our action hooks
|
||||
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_post_meta_info', 10, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_post_meta_info', 10, 2);
|
||||
|
||||
if(get_option('duplicate_post_copychildren') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_children', 20, 3);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_children', 20, 3);
|
||||
}
|
||||
|
||||
if(get_option('duplicate_post_copyattachments') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_attachments', 30, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_attachments', 30, 2);
|
||||
}
|
||||
|
||||
if(get_option('duplicate_post_copycomments') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_comments', 40, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_comments', 40, 2);
|
||||
}
|
||||
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_post_taxonomies', 50, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_post_taxonomies', 50, 2);
|
||||
|
||||
add_filter('plugin_row_meta', 'duplicate_post_add_plugin_links', 10, 2);
|
||||
|
||||
add_action( 'admin_notices', 'duplicate_post_action_admin_notice' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Plugin upgrade
|
||||
*/
|
||||
add_action('admin_init','duplicate_post_plugin_upgrade');
|
||||
|
||||
function duplicate_post_plugin_upgrade() {
|
||||
$installed_version = duplicate_post_get_installed_version();
|
||||
|
||||
@@ -123,59 +185,43 @@ function duplicate_post_plugin_upgrade() {
|
||||
|
||||
}
|
||||
|
||||
if (get_option('duplicate_post_show_row') == 1){
|
||||
add_filter('post_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
|
||||
add_filter('page_row_actions', 'duplicate_post_make_duplicate_link_row',10,2);
|
||||
/**
|
||||
* Shows the update notice
|
||||
*/
|
||||
function duplicate_post_show_update_notice() {
|
||||
if(!current_user_can( 'manage_options')) return;
|
||||
$class = 'notice is-dismissible';
|
||||
$message = '<strong><a href="https://duplicate-post.lopo.it/">'.esc_html__('Check out the new documentation for Duplicate Post!', 'duplicate-post').'</a></strong><br/>';
|
||||
$message .= '<em>'.esc_html__('Duplicate Post is now also compatible with WPML!', 'duplicate-post').'</em><br/>';
|
||||
$message .= '<strong>'.sprintf(wp_kses(__('Help me develop the plugin and provide support by <a href="%s">donating even a small sum</a>.', 'duplicate-post'), array( 'a' => array( 'href' => array() ) ) ), "https://duplicate-post.lopo.it/donate").'</strong>';
|
||||
global $wp_version;
|
||||
if( version_compare($wp_version, '4.2') < 0 ){
|
||||
$message .= ' | <a id="duplicate-post-dismiss-notice" href="javascript:duplicate_post_dismiss_notice();">'.__('Dismiss this notice.').'</a>';
|
||||
}
|
||||
echo '<div id="duplicate-post-notice" class="'.$class.'"><p>'.$message.'</p></div>';
|
||||
echo "<script>
|
||||
function duplicate_post_dismiss_notice(){
|
||||
var data = {
|
||||
'action': 'duplicate_post_dismiss_notice',
|
||||
};
|
||||
|
||||
jQuery.post(ajaxurl, data, function(response) {
|
||||
jQuery('#duplicate-post-notice').hide();
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('body').on('click', '.notice-dismiss', function(){
|
||||
duplicate_post_dismiss_notice();
|
||||
});
|
||||
});
|
||||
</script>";
|
||||
}
|
||||
|
||||
|
||||
if (get_site_option('duplicate_post_show_notice') == 1){
|
||||
/**
|
||||
* Shows the update notice
|
||||
*/
|
||||
function duplicate_post_show_update_notice() {
|
||||
if(!current_user_can( 'manage_options')) return;
|
||||
$class = 'notice is-dismissible';
|
||||
$message = '<strong>'.esc_html__('Duplicate Post has new features!', 'duplicate-post').'</strong><br/>';
|
||||
$message .= '<em>'.esc_html__('Clone posts in bulk (WP 4.7+)', 'duplicate-post').' — '.esc_html__('Wildcards in custom field names', 'duplicate-post').' — '.esc_html__('Options for thumbnail, post format, post template, author, menu order', 'duplicate-post').'</em><br/>';
|
||||
$message .= sprintf(__('Please <a href="%s">review the settings</a> to make sure it works as you expect.', 'duplicate-post'), admin_url('options-general.php?page=duplicatepost')).'<br/>';
|
||||
$message .= '<strong>'.__('Help me develop the plugin and provide support by <a href="http://lopo.it/duplicate-post-plugin">donating even a small sum</a>.', 'duplicate-post').'</strong>';
|
||||
global $wp_version;
|
||||
if( version_compare($wp_version, '4.2') < 0 ){
|
||||
$message .= ' | <a id="duplicate-post-dismiss-notice" href="javascript:duplicate_post_dismiss_notice();">'.__('Dismiss this notice.').'</a>';
|
||||
}
|
||||
echo '<div id="duplicate-post-notice" class="'.$class.'"><p>'.$message.'</p></div>';
|
||||
echo "<script>
|
||||
function duplicate_post_dismiss_notice(){
|
||||
var data = {
|
||||
'action': 'duplicate_post_dismiss_notice',
|
||||
};
|
||||
|
||||
jQuery.post(ajaxurl, data, function(response) {
|
||||
jQuery('#duplicate-post-notice').hide();
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('body').on('click', '.notice-dismiss', function(){
|
||||
duplicate_post_dismiss_notice();
|
||||
});
|
||||
});
|
||||
</script>";
|
||||
}
|
||||
|
||||
if(is_multisite()){
|
||||
add_action( 'network_admin_notices', 'duplicate_post_show_update_notice' );
|
||||
} else {
|
||||
add_action( 'admin_notices', 'duplicate_post_show_update_notice' );
|
||||
}
|
||||
add_action( 'wp_ajax_duplicate_post_dismiss_notice', 'duplicate_post_dismiss_notice' );
|
||||
|
||||
function duplicate_post_dismiss_notice() {
|
||||
$result = update_site_option('duplicate_post_show_notice', 0);
|
||||
return $result;
|
||||
wp_die();
|
||||
}
|
||||
function duplicate_post_dismiss_notice() {
|
||||
$result = update_site_option('duplicate_post_show_notice', 0);
|
||||
return $result;
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,10 +242,6 @@ function duplicate_post_make_duplicate_link_row($actions, $post) {
|
||||
/**
|
||||
* Add a button in the post/page edit screen to create a clone
|
||||
*/
|
||||
if (get_option('duplicate_post_show_submitbox') == 1){
|
||||
add_action( 'post_submitbox_start', 'duplicate_post_add_duplicate_post_button' );
|
||||
}
|
||||
|
||||
function duplicate_post_add_duplicate_post_button() {
|
||||
if ( isset( $_GET['post'] )){
|
||||
$id = $_GET['post'];
|
||||
@@ -216,12 +258,6 @@ function duplicate_post_add_duplicate_post_button() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect actions to functions
|
||||
*/
|
||||
add_action('admin_action_duplicate_post_save_as_new_post', 'duplicate_post_save_as_new_post');
|
||||
add_action('admin_action_duplicate_post_save_as_new_post_draft', 'duplicate_post_save_as_new_post_draft');
|
||||
|
||||
/*
|
||||
* This function calls the creation of a new copy of the selected post (as a draft)
|
||||
* then redirects to the edit post screen
|
||||
@@ -230,8 +266,6 @@ function duplicate_post_save_as_new_post_draft(){
|
||||
duplicate_post_save_as_new_post('draft');
|
||||
}
|
||||
|
||||
add_filter('removable_query_args', 'duplicate_post_add_removable_query_arg', 10, 1);
|
||||
|
||||
function duplicate_post_add_removable_query_arg( $removable_query_args ){
|
||||
$removable_query_args[] = 'cloned';
|
||||
return $removable_query_args;
|
||||
@@ -248,14 +282,31 @@ function duplicate_post_save_as_new_post($status = ''){
|
||||
|
||||
// Get the original post
|
||||
$id = (isset($_GET['post']) ? $_GET['post'] : $_POST['post']);
|
||||
$post = get_post($id);
|
||||
|
||||
check_admin_referer('duplicate-post_' . $id);
|
||||
|
||||
$post = get_post($id);
|
||||
|
||||
// Copy the post and insert it
|
||||
if (isset($post) && $post!=null) {
|
||||
$new_id = duplicate_post_create_duplicate($post, $status);
|
||||
|
||||
if ($status == ''){
|
||||
$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'cloned', 'ids'), admin_url( 'edit.php?post_type='.$post->post_type) );
|
||||
$sendback = wp_get_referer();
|
||||
if ( ! $sendback ||
|
||||
strpos( $sendback, 'post.php' ) !== false ||
|
||||
strpos( $sendback, 'post-new.php' ) !== false ) {
|
||||
if ( 'attachment' == $post_type ) {
|
||||
$sendback = admin_url( 'upload.php' );
|
||||
} else {
|
||||
$sendback = admin_url( 'edit.php' );
|
||||
if ( ! empty( $post_type ) ) {
|
||||
$sendback = add_query_arg( 'post_type', $post_type, $sendback );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'cloned', 'ids'), $sendback );
|
||||
}
|
||||
// Redirect to the post list screen
|
||||
wp_redirect( add_query_arg( array( 'cloned' => 1, 'ids' => $post->ID), $sendback ) );
|
||||
} else {
|
||||
@@ -279,7 +330,7 @@ function duplicate_post_copy_post_taxonomies($new_id, $post) {
|
||||
wp_set_object_terms( $new_id, NULL, 'category' );
|
||||
|
||||
$post_taxonomies = get_object_taxonomies($post->post_type);
|
||||
// severl plugins just add support to post-formats but don't register post_format taxonomy
|
||||
// several plugins just add support to post-formats but don't register post_format taxonomy
|
||||
if(post_type_supports($post->post_type, 'post-formats') && !in_array('post_format', $post_taxonomies)){
|
||||
$post_taxonomies[] = 'post_format';
|
||||
}
|
||||
@@ -315,9 +366,6 @@ function duplicate_post_copy_post_meta_info($new_id, $post) {
|
||||
$meta_blacklist = array_filter($meta_blacklist);
|
||||
$meta_blacklist = array_map('trim', $meta_blacklist);
|
||||
}
|
||||
$meta_blacklist[] = '_wpas_done_all'; //Jetpack Publicize
|
||||
$meta_blacklist[] = '_wpas_done_'; //Jetpack Publicize
|
||||
$meta_blacklist[] = '_wpas_mess'; //Jetpack Publicize
|
||||
$meta_blacklist[] = '_edit_lock'; // edit lock
|
||||
$meta_blacklist[] = '_edit_last'; // edit lock
|
||||
if(get_option('duplicate_post_copytemplate') == 0){
|
||||
@@ -429,13 +477,13 @@ function duplicate_post_copy_attachments($new_id, $post){
|
||||
/**
|
||||
* Copy children posts
|
||||
*/
|
||||
function duplicate_post_copy_children($new_id, $post){
|
||||
function duplicate_post_copy_children($new_id, $post, $status = ''){
|
||||
// get children
|
||||
$children = get_posts(array( 'post_type' => 'any', 'numberposts' => -1, 'post_status' => 'any', 'post_parent' => $post->ID ));
|
||||
// clone old attachments
|
||||
foreach($children as $child){
|
||||
if ($child->post_type == 'attachment') continue;
|
||||
duplicate_post_create_duplicate($child, '', $new_id);
|
||||
duplicate_post_create_duplicate($child, $status, $new_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,29 +525,6 @@ function duplicate_post_copy_comments($new_id, $post){
|
||||
}
|
||||
}
|
||||
|
||||
// Using our action hooks
|
||||
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_post_meta_info', 10, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_post_meta_info', 10, 2);
|
||||
|
||||
if(get_option('duplicate_post_copychildren') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_children', 20, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_children', 20, 2);
|
||||
}
|
||||
|
||||
if(get_option('duplicate_post_copyattachments') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_attachments', 30, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_attachments', 30, 2);
|
||||
}
|
||||
|
||||
if(get_option('duplicate_post_copycomments') == 1){
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_comments', 40, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_comments', 40, 2);
|
||||
}
|
||||
|
||||
add_action('dp_duplicate_post', 'duplicate_post_copy_post_taxonomies', 50, 2);
|
||||
add_action('dp_duplicate_page', 'duplicate_post_copy_post_taxonomies', 50, 2);
|
||||
|
||||
/**
|
||||
* Create a duplicate from a post
|
||||
*/
|
||||
@@ -610,9 +635,9 @@ function duplicate_post_create_duplicate($post, $status = '', $parent_id = '') {
|
||||
// If you have written a plugin which uses non-WP database tables to save
|
||||
// information about a post you can hook this action to dupe that data.
|
||||
if ($post->post_type == 'page' || is_post_type_hierarchical( $post->post_type ))
|
||||
do_action( 'dp_duplicate_page', $new_post_id, $post );
|
||||
do_action( 'dp_duplicate_page', $new_post_id, $post, $status );
|
||||
else
|
||||
do_action( 'dp_duplicate_post', $new_post_id, $post );
|
||||
do_action( 'dp_duplicate_post', $new_post_id, $post, $status );
|
||||
|
||||
delete_post_meta($new_post_id, '_dp_original');
|
||||
add_post_meta($new_post_id, '_dp_original', $post->ID);
|
||||
@@ -623,20 +648,15 @@ function duplicate_post_create_duplicate($post, $status = '', $parent_id = '') {
|
||||
}
|
||||
|
||||
//Add some links on the plugin page
|
||||
add_filter('plugin_row_meta', 'duplicate_post_add_plugin_links', 10, 2);
|
||||
|
||||
function duplicate_post_add_plugin_links($links, $file) {
|
||||
if ( $file == plugin_basename(dirname(__FILE__).'/duplicate-post.php') ) {
|
||||
$links[] = '<a href="http://lopo.it/duplicate-post-plugin">' . esc_html__('Donate', 'duplicate-post') . '</a>';
|
||||
$links[] = '<a href="https://translate.wordpress.org/projects/wp-plugins/duplicate-post">' . esc_html__('Translate', 'duplicate-post') . '</a>';
|
||||
$links[] = '<a href="https://duplicate-post.lopo.it/">' . esc_html__('Documentation', 'duplicate-post') . '</a>';
|
||||
$links[] = '<a href="https://duplicate-post.lopo.it/donate">' . esc_html__('Donate', 'duplicate-post') . '</a>';
|
||||
}
|
||||
return $links;
|
||||
}
|
||||
|
||||
/*** NOTICES ***/
|
||||
|
||||
add_action( 'admin_notices', 'duplicate_post_action_admin_notice' );
|
||||
|
||||
function duplicate_post_action_admin_notice() {
|
||||
if ( ! empty( $_REQUEST['cloned'] ) ) {
|
||||
$copied_posts = intval( $_REQUEST['cloned'] );
|
||||
@@ -652,7 +672,6 @@ function duplicate_post_action_admin_notice() {
|
||||
|
||||
|
||||
/*** BULK ACTIONS ***/
|
||||
|
||||
add_action('admin_init', 'duplicate_post_add_bulk_filters_for_enabled_post_types');
|
||||
|
||||
function duplicate_post_add_bulk_filters_for_enabled_post_types(){
|
||||
|
||||
@@ -57,7 +57,7 @@ function duplicate_post_get_clone_post_link( $id = 0, $context = 'display', $dra
|
||||
if ( !$post_type_object )
|
||||
return;
|
||||
|
||||
return apply_filters( 'duplicate_post_get_clone_post_link', admin_url( "admin.php". $action ), $post->ID, $context );
|
||||
return wp_nonce_url(apply_filters( 'duplicate_post_get_clone_post_link', admin_url( "admin.php". $action ), $post->ID, $context ), 'duplicate-post_' . $post->ID);
|
||||
}
|
||||
/**
|
||||
* Display duplicate post link for post.
|
||||
@@ -85,12 +85,12 @@ function duplicate_post_clone_post_link( $link = null, $before = '', $after = ''
|
||||
/**
|
||||
* Get original post .
|
||||
*
|
||||
* @param int $id Optional. Post ID.
|
||||
* @param int $post Optional. Post ID or Post object.
|
||||
* @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N.
|
||||
* @return mixed Post data
|
||||
*/
|
||||
function duplicate_post_get_original($id = 0 , $output = OBJECT){
|
||||
if ( !$post = get_post( $id ) )
|
||||
function duplicate_post_get_original($post = null , $output = OBJECT){
|
||||
if ( !$post = get_post( $post ) )
|
||||
return;
|
||||
$original_ID = get_post_meta( $post->ID, '_dp_original');
|
||||
if (empty($original_ID)) return null;
|
||||
@@ -134,9 +134,14 @@ function duplicate_post_add_css() {
|
||||
}
|
||||
}
|
||||
|
||||
if (get_option ( 'duplicate_post_show_adminbar' ) == 1) {
|
||||
add_action ( 'wp_before_admin_bar_render', 'duplicate_post_admin_bar_render' );
|
||||
add_action ( 'wp_enqueue_scripts', 'duplicate_post_add_css' );
|
||||
|
||||
add_action('init', 'duplicate_post_init');
|
||||
|
||||
function duplicate_post_init(){
|
||||
if (get_option ( 'duplicate_post_show_adminbar' ) == 1) {
|
||||
add_action ( 'wp_before_admin_bar_render', 'duplicate_post_admin_bar_render' );
|
||||
add_action ( 'wp_enqueue_scripts', 'duplicate_post_add_css' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@ if ( !defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
if ( is_admin() ){ // admin actions
|
||||
add_action('admin_menu', 'duplicate_post_menu');
|
||||
add_action( 'admin_init', 'duplicate_post_register_settings');
|
||||
add_action( 'admin_menu', 'duplicate_post_menu' );
|
||||
add_action( 'admin_init', 'duplicate_post_register_settings' );
|
||||
}
|
||||
|
||||
function duplicate_post_register_settings() { // whitelist options
|
||||
@@ -86,11 +86,10 @@ function duplicate_post_options() {
|
||||
<br/>
|
||||
<?php esc_html_e('Donate whatever sum you choose, even just 10¢.', 'duplicate-post'); ?>
|
||||
<br/>
|
||||
<a href="http://lopo.it/duplicate-post-plugin"><img id="donate-button" style="margin: 0px auto;" src="<?php echo plugins_url( 'donate.png', __FILE__ ); ?>" alt="Donate"/></a>
|
||||
<a href="https://duplicate-post.lopo.it/donate"><img id="donate-button" style="margin: 0px auto;" src="<?php echo plugins_url( 'donate.png', __FILE__ ); ?>" alt="Donate"/></a>
|
||||
<br/>
|
||||
<a href="http://lopo.it/duplicate-post-plugin"><?php esc_html_e('Visit plugin site'); ?></a>
|
||||
- <a href="https://translate.wordpress.org/projects/wp-plugins/duplicate-post"><?php esc_html_e('Translate', 'duplicate-post'); ?></a>
|
||||
- <a href="https://wordpress.org/plugins/duplicate-post/faq/"><?php esc_html_e('FAQ', 'duplicate-post'); ?></a>
|
||||
<a href="https://duplicate-post.lopo.it/"><?php esc_html_e('Documentation', 'duplicate-post'); ?></a>
|
||||
- <a href="https://translate.wordpress.org/projects/wp-plugins/duplicate-post"><?php esc_html_e('Translate', 'duplicate-post'); ?></a>
|
||||
- <a href="https://wordpress.org/support/plugin/duplicate-post"><?php esc_html_e('Support Forum', 'duplicate-post'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -233,13 +232,13 @@ img#donate-button{
|
||||
<?php esc_html_e("Password", 'default'); ?>
|
||||
</label> <label> <input type="checkbox"
|
||||
name="duplicate_post_copyattachments" value="1" <?php if(get_option('duplicate_post_copyattachments') == 1) echo 'checked="checked"'; ?>"/>
|
||||
<?php esc_html_e("Attachments", 'duplicate-post'); ?>
|
||||
<?php esc_html_e("Attachments", 'duplicate-post'); ?> <small>(<?php esc_html_e("you probably want this unchecked, unless you have very special requirements", 'duplicate-post'); ?>)</small>
|
||||
</label> <label> <input type="checkbox"
|
||||
name="duplicate_post_copychildren" value="1" <?php if(get_option('duplicate_post_copychildren') == 1) echo 'checked="checked"'; ?>"/>
|
||||
<?php esc_html_e("Children", 'duplicate-post'); ?>
|
||||
</label> <label> <input type="checkbox"
|
||||
name="duplicate_post_copycomments" value="1" <?php if(get_option('duplicate_post_copycomments') == 1) echo 'checked="checked"'; ?>"/>
|
||||
<?php esc_html_e("Comments", 'default'); ?> (<?php esc_html_e("except pingbacks and trackbacks", 'duplicate-post'); ?>)
|
||||
<?php esc_html_e("Comments", 'default'); ?> <small>(<?php esc_html_e("except pingbacks and trackbacks", 'duplicate-post'); ?>)</small>
|
||||
</label> <label> <input type="checkbox"
|
||||
name="duplicate_post_copymenuorder" value="1" <?php if(get_option('duplicate_post_copymenuorder') == 1) echo 'checked="checked"'; ?>"/>
|
||||
<?php esc_html_e("Menu order", 'default'); ?>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#wpadminbar #wp-admin-bar-new_draft > .ab-item::before {
|
||||
content: "\f498\f344\f498";
|
||||
content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M18.9 4.3c0.6 0 1.1 0.5 1.1 1.1v13.6c0 0.6-0.5 1.1-1.1 1.1h-10.7c-0.6 0-1.1-0.5-1.1-1.1v-3.2h-6.1c-0.6 0-1.1-0.5-1.1-1.1v-7.5c0-0.6 0.3-1.4 0.8-1.8l4.6-4.6c0.4-0.4 1.2-0.8 1.8-0.8h4.6c0.6 0 1.1 0.5 1.1 1.1v3.7c0.4-0.3 1-0.4 1.4-0.4h4.6zM12.9 6.7l-3.3 3.3h3.3v-3.3zM5.7 2.4l-3.3 3.3h3.3v-3.3zM7.9 9.6l3.5-3.5v-4.6h-4.3v4.6c0 0.6-0.5 1.1-1.1 1.1h-4.6v7.1h5.7v-2.9c0-0.6 0.3-1.4 0.8-1.8zM18.6 18.6v-12.9h-4.3v4.6c0 0.6-0.5 1.1-1.1 1.1h-4.6v7.1h10z' fill='rgba(240,245,250,.6)'/></svg>");
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Duplicate Post
|
||||
Plugin URI: http://lopo.it/duplicate-post-plugin/
|
||||
Plugin URI: https://duplicate-post.lopo.it/
|
||||
Description: Clone posts and pages.
|
||||
Version: 3.1.2
|
||||
Version: 3.2
|
||||
Author: Enrico Battocchi
|
||||
Author URI: http://lopo.it
|
||||
Author URI: https://lopo.it
|
||||
Text Domain: duplicate-post
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
// Version of the plugin
|
||||
define('DUPLICATE_POST_CURRENT_VERSION', '3.1.2' );
|
||||
define('DUPLICATE_POST_CURRENT_VERSION', '3.2' );
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
=== Duplicate Post ===
|
||||
Contributors: lopo
|
||||
Donate link: http://lopo.it/duplicate-post-plugin/
|
||||
Donate link: https://duplicate-post.lopo.it/
|
||||
Tags: duplicate post, copy, clone
|
||||
Requires at least: 3.6
|
||||
Tested up to: 4.7
|
||||
Stable tag: 3.1.2
|
||||
Stable tag: 3.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Clone posts and pages.
|
||||
Copy posts of any type with a click!
|
||||
|
||||
== Description ==
|
||||
|
||||
This plugin allows to clone a post or page, or edit it as a new draft.
|
||||
If you find this useful, [**please consider donating**](http://lopo.it/duplicate-post-plugin/) whatever sum you choose, **even just 10 cents**. It's been downloaded thousands of times: just a few cents from every user would help me develop the plugin and improve support.
|
||||
|
||||
This plugin allows users to clone posts of any type, or copy them to new drafts for further editing.
|
||||
If you find this useful, [**please consider donating**](https://duplicate-post.lopo.it/) whatever sum you choose, **even just 10 cents**. Just a few cents from every user would help me develop the plugin and improve support.
|
||||
|
||||
How it works:
|
||||
|
||||
@@ -32,13 +31,9 @@ How it works:
|
||||
|
||||
There is also a **template tag**, so you can put it in your templates and clone your posts/pages from the front-end. Clicking on the link will lead you to the edit page for the new draft, just like the admin bar link.
|
||||
|
||||
In the Options page under Settings it is now possible to choose what to copy, and you can also set a prefix (or a suffix) to place before (or after) the title of the cloned post/page.
|
||||
Duplicate Post has many useful settings to customize its behavior and restrict its use to certain roles or post types. Check out the extensive documentation on [the plugin's site](https://duplicate-post.lopo.it).
|
||||
|
||||
You can also restrict the plugin to certain post types, and allow only some roles to clone posts or pages.
|
||||
|
||||
If you want to contribute to translate the plugin in languages other than English, there is a [translation project](https://translate.wordpress.org/projects/wp-plugins/duplicate-post) available: [contact me](http://lopo.it/contatti/) if you wish to become an editor for your language.
|
||||
|
||||
**If you're a plugin developer**, I suggest to read the section made just for you under "Other Notes", to ensure compatibility between your plugin(s) and mine.
|
||||
**If you're a plugin developer**, I suggest you to read the [Developer's Guide](https://duplicate-post.lopo.it/docs/developers-guide/) to ensure compatibility between your plugin(s) and mine. Feel free to [contact me](https://duplicate-post.lopo.it/contact) so we can keep in touch and collaborate.
|
||||
|
||||
Thanks for all the suggestions, bug reports, translations and donations, they're frankly too many to be listed here!
|
||||
|
||||
@@ -57,20 +52,18 @@ Use WordPress' Add New Plugin feature, searching "Duplicate Post", or download t
|
||||
|
||||
First, check your version of WordPress: the plugin is not supposed to work on old versions anymore. Make sure also to upgrade to the last version of the plugin!
|
||||
|
||||
Then try to deactivate and re-activate it, some user have reported that this fixes the problem.
|
||||
Then try to deactivate and re-activate it, some user have reported that this fixes some problems.
|
||||
|
||||
Pay also attention to the new "Roles allowed to copy" option: it should convert the former "user level" option to the new standard, but unknown problems may arise. Make sure that your role is enabled.
|
||||
Pay also attention to the "Permissions" tab in the Settings: make sure the plugin is enabled for the desired roles and post types.
|
||||
|
||||
From version 3.0 onwards, post types must be enabled in the Options: check them as well.
|
||||
|
||||
If not, maybe there is some kind of conflict with other plugins: feel free [to write me](http://lopo.it/contatti/) and we'll try to discover a solution (it will be *really* helpful if you try to deactivate all your other plugins one by one to see which one conflicts with mine... But do it only if you know what you're doing, I will not be responsible of any problem you may experience).
|
||||
If it still doesn't work, maybe there is some kind of conflict with other plugins: feel free [to write in the forum](https://wordpress.org/support/plugin/duplicate-post) and we'll try to discover a solution (it will be *really* helpful if you try to deactivate all your other plugins one by one to see which one conflicts with mine... But do it only if you know what you're doing, I will not be responsible of any problem you may experience).
|
||||
|
||||
= The plugin is not translated in my language! =
|
||||
|
||||
From version 3.0 the plugin's translations are managed by the WordPress.org platform and the plugin is shipped without language files, so first of all update translations under Dashboard->Updates.
|
||||
|
||||
If Duplicate Post is still in English, or if there are some untraslated strings, you can help traslating to your language [here](https://translate.wordpress.org/projects/wp-plugins/duplicate-post): you only need a WordPress.org account.
|
||||
[Contact me](http://lopo.it/contatti/) if you wish to become an editor for your language.
|
||||
[Contact me](https://duplicate-post.lopo.it/contact) if you wish to become an editor for your language.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
@@ -83,6 +76,9 @@ If Duplicate Post is still in English, or if there are some untraslated strings,
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 3.2 =
|
||||
new website + WPML compatibility + various fixes
|
||||
|
||||
= 3.1.2 =
|
||||
Fixes the problem with custom fields
|
||||
|
||||
@@ -142,13 +138,21 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 3.1.2 =
|
||||
= 3.2 (2017-04-04) =
|
||||
* new website with extensive documentation
|
||||
* WPML compatibility, thanks to WPML team
|
||||
* improved Jetpack compatibility (Subscriptions, Markdown)
|
||||
* small changes to hooks
|
||||
* improved security with nonces
|
||||
* various small fixes
|
||||
|
||||
= 3.1.2 (2016-12-13) =
|
||||
* Fix for custom fields not copied
|
||||
|
||||
= 3.1.1 =
|
||||
= 3.1.1 (2016-12-13) =
|
||||
* Fix for nasty update nag (plus a failsafe checkbox)
|
||||
|
||||
= 3.1 =
|
||||
= 3.1 (2016-12-13) =
|
||||
* Bulk clone action added (WP 4.7+)
|
||||
* Wildcards enabled for custom fields to skip
|
||||
* Options to copy post author, post format (moved from taxonomies), menu order, post template
|
||||
@@ -158,22 +162,22 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
||||
* Probable fix for repeated clone bug
|
||||
* Other minor bugs fixed
|
||||
|
||||
= 3.0.3 =
|
||||
= 3.0.3 (2016-10-29) =
|
||||
* Notices in admin after copying
|
||||
* Fixes warning in custom post type archives
|
||||
* Uses site options for version and notice
|
||||
* Minor fixes
|
||||
|
||||
= 3.0.2 =
|
||||
= 3.0.2 (2016-10-18) =
|
||||
* Can now be enabled for every custom post type with visible UI (not just public ones)
|
||||
* Admin bar CSS only enqueued when needed
|
||||
* New "Donate" button
|
||||
* Fixes for minor bugs and typos
|
||||
|
||||
= 3.0.1 =
|
||||
= 3.0.1 (2016-10-09) =
|
||||
* Fixes the issues for people upgrading from an older version
|
||||
|
||||
= 3.0 =
|
||||
= 3.0 (2016-10-09) =
|
||||
* Settings page redesigned
|
||||
* More options to enable/disable copy of every part of a post
|
||||
* Enable/disable cloning for every custom post type
|
||||
@@ -183,40 +187,40 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
||||
* Translations removed to use WP.org's official translation project
|
||||
* Checked PHP 7 compatibility
|
||||
|
||||
= 2.6 =
|
||||
= 2.6 (2014-04-27) =
|
||||
* PHP 5.4 (Strict Standards) compatible
|
||||
* Fixed possible XSS and SQL injections
|
||||
* other bugs
|
||||
* Updated and added translations
|
||||
* Tested up to WP 3.8.1
|
||||
|
||||
= 2.4.1 =
|
||||
= 2.4.1 (2014-02-22) =
|
||||
* Fixed regression about draft permalinks
|
||||
* Fixed bug with guid
|
||||
* Don't clone to_ping and pinged (maybe there will be an option about those later)
|
||||
|
||||
= 2.4 =
|
||||
= 2.4 (2012-04-29) =
|
||||
* New option to clone the children of the original page
|
||||
* Licence changed to GPLv2 or later
|
||||
* Fixed publishing dates for drafts
|
||||
* Fixed bug with prefix/suffix
|
||||
* Translation project moved to GlotPress
|
||||
|
||||
= 2.3 =
|
||||
= 2.3 (2012-04-06) =
|
||||
* Added options to choose where to show the "Clone" links
|
||||
* Clone attachments (i.e. references in the DB, not physical files)
|
||||
* Fix for untranslated user roles
|
||||
* Some other fixes (missing checks, PHP warnings and errors, etc.)
|
||||
|
||||
= 2.2 =
|
||||
= 2.2 (2012-02-01) =
|
||||
* Fix for problems when copying serialized meta fields
|
||||
* Fix for multiple _dp_original field
|
||||
* Removed deprecated parameter when adding options
|
||||
|
||||
= 2.1.1 =
|
||||
= 2.1.1 (2012-01-04) =
|
||||
* Can't rely on activation hook for upgrade, this caused problems with new options
|
||||
|
||||
= 2.1 =
|
||||
= 2.1 (2012-01-03) =
|
||||
* Even more code cleaning (no more custom queries, using WP API)
|
||||
* Term order preserved when copying
|
||||
* Stopped using deprecated User levels, now it uses Roles and Capabilities
|
||||
@@ -224,16 +228,16 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
||||
* duplicate_post_get_original template tag
|
||||
* Settings link in plugin list, 'Donate' and 'Translate' link in option page
|
||||
|
||||
= 2.0.2 =
|
||||
= 2.0.2 (2011-12-12) =
|
||||
* Fixed bug for permalinks
|
||||
* Two links on posts list: clone immediately or copy to a new draft to edit.
|
||||
* Tested on multisite mode.
|
||||
|
||||
= 2.0.1 =
|
||||
= 2.0.1 (2011-12-08) =
|
||||
* Fixed bug for action filters
|
||||
* New option so you can choose if cloning from the posts list must copy the post status (draft, published, pending) too.
|
||||
|
||||
= 2.0 =
|
||||
= 2.0 (2011-12-08) =
|
||||
* WP 3.3 compatibility (still not tested against multiblog feature, so beware)
|
||||
* Minimum WP version: 3.0
|
||||
* Code cleanup
|
||||
@@ -242,88 +246,49 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
||||
* Added suffix option
|
||||
* Added template tag
|
||||
|
||||
= 1.1.2 =
|
||||
= 1.1.2 (2011-04-08) =
|
||||
* WP 3.1.1 compatibility (still not tested against multiblog feature, so beware)
|
||||
* Added complete Polish language files
|
||||
|
||||
= 1.1.1 =
|
||||
= 1.1.1 (2010-06-30) =
|
||||
* Plugin split in two files for faster opening in Plugins list page
|
||||
* fix conflicts with a few other plugins
|
||||
* Added Dutch language files
|
||||
|
||||
= 1.1 =
|
||||
= 1.1 (2010-06-24) =
|
||||
* WP 3.0 compatibility (not tested against multiblog feature, so beware)
|
||||
* Option page: minimum user level, title prefix, fields not to be copied, copy post/page date also
|
||||
* Added German, Swedish, Romanian, Hebrew, Catalan (incomplete) and Polish (incomplete) language files
|
||||
|
||||
= 1.0 =
|
||||
= 1.0 (2010-06-15) =
|
||||
* Better integration with WP 2.7+ interface
|
||||
* Added actions for plugins which store post metadata in self-managed tables
|
||||
* Added French and Spanish language files
|
||||
* Dropped WP 2.6.5 compatibility
|
||||
|
||||
= 0.6.1 =
|
||||
= 0.6.1 (2009-12-03) =
|
||||
* Tested WP 2.9 compatibility
|
||||
|
||||
= 0.6 =
|
||||
= 0.6 (2007-07-21) =
|
||||
* Fix for WP 2.8.1
|
||||
* WPMU compatibility
|
||||
* Internationalization (Italian and Japanese language files shipped)
|
||||
|
||||
= 0.5 =
|
||||
= 0.5 (2009-01-09) =
|
||||
* Fix for post-meta
|
||||
* WP2.7 compatibility
|
||||
|
||||
= 0.4 =
|
||||
= 0.4 (2008-11-23) =
|
||||
* Support for new WP post revision feature
|
||||
|
||||
|
||||
|
||||
== Template tags ==
|
||||
|
||||
I have added the template tag `duplicate_post_clone_post_link( $link, $before, $after, $id )`, which behaves just like [edit_post_link()](http://codex.wordpress.org/Function_Reference/edit_post_link).
|
||||
That means that you can put it in your template (e.g., in single.php or page.php) so you can get a "Clone" link when displaying a post or page.
|
||||
|
||||
The parameters are:
|
||||
|
||||
* *link*
|
||||
(string) (optional) The link text. Default: __('Clone','duplicate-post')
|
||||
|
||||
* *before*
|
||||
(string) (optional) Text to put before the link text. Default: None
|
||||
|
||||
* *after*
|
||||
(string) (optional) Text to put after the link text. Default: None
|
||||
|
||||
* *id*
|
||||
(integer) (optional) Post ID. Default: Current post ID
|
||||
|
||||
Another available template tag is `duplicate_post_get_original($id, $output)` which returns the original post, either as a post object, an associative array or a numeric array (depending on the $output parameter), just as [get_post()](http://codex.wordpress.org/Function_Reference/get_post) does.
|
||||
`duplicate_post_get_original()` relies on the `_dp_original` custom field.
|
||||
|
||||
|
||||
== Action hooks ==
|
||||
|
||||
From version 1.0 onwards, thanks to [Simon Wheatley](http://www.simonwheatley.co.uk/)'s suggestion, Duplicate Post adds two action hooks (*dp_duplicate_post* and *dp_duplicate_page*) which can be used by other developers if their plugins store extra data for posts in non-standard WP tables.
|
||||
Since Duplicate Post knows only of standard WP tables, it can't copy other data relevant to the post which is being copied if this information is stored elsewhere. So, if you're a plugin developer which acts this way, and you want to ensure compatibility with Duplicate Post, you can hook your functions to those actions to make sure that they will be called when a post (or page) is cloned.
|
||||
|
||||
It's very simple. Just write your function that copies post metadata to a new row of your table:
|
||||
`function myplugin_copy_post($new_post_id, $old_post_object){
|
||||
/* your code */
|
||||
}`
|
||||
|
||||
Then hook the function to the action:
|
||||
`add_action( "dp_duplicate_post", "myplugin_copy_post", $priority, 2);`
|
||||
|
||||
dp_duplicate_page is used for pages and hierarchical custom post types; for every other type of posts, dp_duplicate_post is used.
|
||||
|
||||
Please refer to the [Plugin API](http://codex.wordpress.org/Plugin_API) for every information about the subject.
|
||||
= 0.3 (2008-03-01) =
|
||||
* Initial version on WP repository
|
||||
|
||||
== Contribute ==
|
||||
|
||||
If you find this useful and if you want to contribute, there are three ways:
|
||||
|
||||
1. You can [write me](http://lopo.it/contatti/) and submit your bug reports, suggestions and requests for features;
|
||||
1. You can [write me](https://duplicate-post.lopo.it/contact) and submit your bug reports, suggestions and requests for features;
|
||||
2. If you want to translate it to your language (there are just a few lines of text), you can use the [translation project](https://translate.wordpress.org/projects/wp-plugins/duplicate-post);
|
||||
3. Using the plugin is free, but if you want you can support my efforts by donating with PayPal [here](http://lopo.it/duplicate-post-plugin/)
|
||||
3. Using the plugin is free, but if you want you can support my efforts by donating with PayPal [here](https://duplicate-post.lopo.it/donate)
|
||||
|
||||
@@ -97,6 +97,16 @@ class URE_Ajax_Processor {
|
||||
// end of get_users_without_role()
|
||||
|
||||
|
||||
protected function grant_roles() {
|
||||
|
||||
$answer = URE_Grant_Roles::process_user_request();
|
||||
|
||||
return $answer;
|
||||
|
||||
}
|
||||
// end of grant_roles()
|
||||
|
||||
|
||||
protected function _dispatch() {
|
||||
switch ($this->action) {
|
||||
case 'get_caps_to_remove':
|
||||
@@ -105,6 +115,9 @@ class URE_Ajax_Processor {
|
||||
case 'get_users_without_role':
|
||||
$answer = $this->get_users_without_role();
|
||||
break;
|
||||
case 'grant_roles':
|
||||
$answer = $this->grant_roles();
|
||||
break;
|
||||
default:
|
||||
$answer = array('result' => 'error', 'message' => 'unknown action "' . $this->action . '"');
|
||||
}
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ class URE_Capabilities_Groups_Manager {
|
||||
$caps['manage_links'] = array('core', 'others');
|
||||
$caps['upload_files'] = array('core', 'general');
|
||||
$caps['import'] = array('core', 'general');
|
||||
$caps['unfiltered_html'] = array('core');
|
||||
$caps['unfiltered_html'] = array('core','general');
|
||||
if ($multisite) {
|
||||
$caps['unfiltered_html'] = array('deprecated');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* Project: User Role Editor plugin
|
||||
* Author: Vladimir Garagulya
|
||||
* Author email: support@role-editor.com
|
||||
* Author URI: https://www.role-editor.com
|
||||
* License: GPL v2+
|
||||
*
|
||||
* Assign multiple roles to the list of selected users directly from the "Users" page
|
||||
*/
|
||||
|
||||
class URE_Grant_Roles {
|
||||
|
||||
private $lib = null;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
$this->lib = URE_Lib::get_instance();
|
||||
|
||||
add_action('restrict_manage_users', array($this, 'show_grant_roles_html'));
|
||||
add_action('admin_head', array(User_Role_Editor::get_instance(), 'add_css_to_users_page'));
|
||||
add_action('admin_enqueue_scripts', array($this, 'load_js'));
|
||||
}
|
||||
// end of __construct()
|
||||
|
||||
|
||||
private static function validate_users($users) {
|
||||
if (!is_array($users)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($users as $user_id) {
|
||||
if (!is_numeric($user_id)) {
|
||||
return false;
|
||||
}
|
||||
if (!current_user_can('edit_user', $user_id)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// end of validate_users()
|
||||
|
||||
|
||||
private static function validate_roles($roles) {
|
||||
|
||||
$editable_roles = get_editable_roles();
|
||||
$valid_roles = array_keys($editable_roles);
|
||||
foreach($roles as $role) {
|
||||
if (!in_array($role, $valid_roles)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// end of validate_roles()
|
||||
|
||||
|
||||
private static function grant_roles_to_user($user_id, $roles) {
|
||||
|
||||
$user = get_user_by('id', $user_id);
|
||||
if (empty($user)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user->remove_all_caps();
|
||||
foreach($roles as $role) {
|
||||
$user->add_role($role);
|
||||
}
|
||||
|
||||
}
|
||||
// end of grant_roles_to_user()
|
||||
|
||||
|
||||
public static function process_user_request() {
|
||||
|
||||
$users = $_POST['users'];
|
||||
if (!self::validate_users($users)) {
|
||||
$answer = array('result'=>'error', 'message'=>esc_html__('Invalid data at the users list', 'user-role-editor'));
|
||||
return $answer;
|
||||
}
|
||||
|
||||
$roles = $_POST['roles'];
|
||||
if (!self::validate_roles($roles)) {
|
||||
$answer = array('result'=>'error', 'message'=>esc_html__('Invalid data at the roles list', 'user-role-editor'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!current_user_can('edit_users')) {
|
||||
$answer = array('result'=>'error', 'message'=>esc_html__('Not enough permissions', 'user-role-editor'));
|
||||
return $answer;
|
||||
}
|
||||
|
||||
foreach($users as $user_id) {
|
||||
self::grant_roles_to_user($user_id, $roles);
|
||||
}
|
||||
|
||||
$answer = array();
|
||||
|
||||
return $answer;
|
||||
}
|
||||
// end of process_user_request()
|
||||
|
||||
|
||||
private function select_roles_html() {
|
||||
$show_admin_role = $this->lib->show_admin_role_allowed();
|
||||
$roles = get_editable_roles();
|
||||
foreach ($roles as $role_id => $role) {
|
||||
if (!$show_admin_role && $role_id=='administrator') {
|
||||
continue;
|
||||
}
|
||||
echo '<label for="wp_role_' . $role_id . '"><input type="checkbox" id="wp_role_' . $role_id .
|
||||
'" name="ure_roles[]" value="' . $role_id . '" /> ' .
|
||||
esc_html__($role['name'], 'user-role-editor') .' ('. $role_id .')</label><br />'. PHP_EOL;
|
||||
}
|
||||
}
|
||||
// end of show_secondary_roles()
|
||||
|
||||
|
||||
public function show_grant_roles_html() {
|
||||
if (!$this->lib->is_right_admin_path('users.php')) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<input type="button" name="ure_grant_roles" id="ure_grant_roles" class="button"
|
||||
value="Grant Roles" onclick="ure_show_grant_roles_dialog();">
|
||||
<div id="ure_grant_roles_dialog" class="ure-dialog">
|
||||
<div id="ure_grant_roles_content" style="padding: 10px;">
|
||||
<?php
|
||||
$this->select_roles_html();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ure_task_status" style="display:none;position:absolute;top:10px;right:10px;padding:10px;background-color:#000000;color:#ffffff;">
|
||||
<img src="<?php echo URE_PLUGIN_URL .'/images/ajax-loader.gif';?>" width="16" height="16"/> <?php esc_html_e('Working...','user-role-editor');?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
// end of show_grant_roles_button()
|
||||
|
||||
|
||||
public function load_js() {
|
||||
if (isset($_GET['page'])) {
|
||||
return;
|
||||
}
|
||||
if (!$this->lib->is_right_admin_path('users.php')) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
|
||||
wp_register_script('ure-users-grant-roles', plugins_url('/js/users-grant-roles.js', URE_PLUGIN_FULL_PATH));
|
||||
wp_enqueue_script('ure-users-grant-roles', '', array(), false, true);
|
||||
wp_localize_script('ure-users-grant-roles', 'ure_users_grant_roles_data', array(
|
||||
'wp_nonce' => wp_create_nonce('user-role-editor'),
|
||||
'dialog_title'=> esc_html__('Grant roles to selected users', 'user-role-editor'),
|
||||
'select_users_first'=> esc_html__('Select users to which you wish to grant multiple roles!', 'user-role-editor'),
|
||||
'select_roles_first'=> esc_html__('Select role(s) which you wish to grant!', 'user-role-editor')
|
||||
));
|
||||
}
|
||||
// end of load_js()
|
||||
|
||||
}
|
||||
// end of URE_Grant_Roles class
|
||||
@@ -71,7 +71,7 @@ class URE_User_Other_Roles {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_script('jquery-ui-dialog', false, array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
|
||||
wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
|
||||
wp_register_script('ure-jquery-multiple-select', plugins_url('/js/jquery.multiple.select.js', URE_PLUGIN_FULL_PATH));
|
||||
wp_enqueue_script('ure-jquery-multiple-select');
|
||||
wp_register_script('ure-user-profile-other-roles', plugins_url('/js/ure-user-profile-other-roles.js', URE_PLUGIN_FULL_PATH));
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
*/
|
||||
|
||||
class User_Role_Editor {
|
||||
|
||||
protected static $instance = null; // object exemplar reference
|
||||
|
||||
// plugin specific library object: common code stuff, including options data processor
|
||||
protected $lib = null;
|
||||
|
||||
@@ -25,10 +28,43 @@ class User_Role_Editor {
|
||||
// URE pages hook suffixes
|
||||
protected $ure_hook_suffixes = null;
|
||||
|
||||
|
||||
public static function get_instance() {
|
||||
if (self::$instance===null) {
|
||||
self::$instance = new User_Role_Editor();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
// end of get_instance()
|
||||
|
||||
|
||||
/**
|
||||
* Private clone method to prevent cloning of the instance of the *Singleton*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function __clone() {
|
||||
|
||||
}
|
||||
// end of __clone()
|
||||
|
||||
/**
|
||||
* Private unserialize method to prevent unserializing of the *Singleton*
|
||||
* instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function __wakeup() {
|
||||
|
||||
}
|
||||
// end of __wakeup()
|
||||
|
||||
|
||||
/**
|
||||
* class constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
protected function __construct() {
|
||||
|
||||
if (empty($this->lib)) {
|
||||
$this->lib = URE_Lib::get_instance('user_role_editor');
|
||||
@@ -152,11 +188,13 @@ class User_Role_Editor {
|
||||
$count_users_without_role = $this->lib->get_option('count_users_without_role', 0);
|
||||
if ($count_users_without_role) {
|
||||
add_action('restrict_manage_users', array($this, 'move_users_from_no_role_button'));
|
||||
add_action('admin_init', array($this, 'add_css_to_users_page'));
|
||||
add_action('admin_head', array($this, 'add_css_to_users_page'));
|
||||
add_action('admin_footer', array($this, 'add_js_to_users_page'));
|
||||
}
|
||||
}
|
||||
|
||||
new URE_Grant_Roles();
|
||||
|
||||
add_action('wp_ajax_ure_ajax', array($this, 'ure_ajax'));
|
||||
}
|
||||
// end of plugin_init()
|
||||
@@ -247,7 +285,7 @@ class User_Role_Editor {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_script('jquery-ui-dialog', false, array('jquery-ui-core','jquery-ui-button', 'jquery') );
|
||||
wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core','jquery-ui-button', 'jquery') );
|
||||
wp_register_script( 'ure-users-js', plugins_url( '/js/ure-users.js', URE_PLUGIN_FULL_PATH ) );
|
||||
wp_enqueue_script ( 'ure-users-js' );
|
||||
wp_localize_script( 'ure-users-js', 'ure_users_data', array(
|
||||
@@ -791,8 +829,8 @@ class User_Role_Editor {
|
||||
$confirm_role_update = $this->lib->get_option('ure_confirm_role_update', 1);
|
||||
$page_url = $this->lib->get_ure_page_url();
|
||||
|
||||
wp_enqueue_script('jquery-ui-dialog', false, array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
|
||||
wp_enqueue_script('jquery-ui-selectable', false, array('jquery-ui-core', 'jquery'));
|
||||
wp_enqueue_script('jquery-ui-dialog', '', array('jquery-ui-core', 'jquery-ui-button', 'jquery'));
|
||||
wp_enqueue_script('jquery-ui-selectable', '', array('jquery-ui-core', 'jquery'));
|
||||
wp_register_script('ure-js', plugins_url('/js/ure-js.js', URE_PLUGIN_FULL_PATH));
|
||||
wp_enqueue_script('ure-js');
|
||||
wp_localize_script('ure-js', 'ure_data', array(
|
||||
@@ -843,7 +881,7 @@ class User_Role_Editor {
|
||||
|
||||
protected function load_settings_js() {
|
||||
|
||||
wp_enqueue_script('jquery-ui-tabs', false, array('jquery-ui-core', 'jquery'));
|
||||
wp_enqueue_script('jquery-ui-tabs', '', array('jquery-ui-core', 'jquery'));
|
||||
do_action('ure_load_js_settings');
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ require_once(URE_PLUGIN_DIR .'includes/classes/task-queue.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/own-capabilities.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/bbpress.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/assign-role.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/grant-roles.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/user-other-roles.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/protect-admin.php');
|
||||
require_once(URE_PLUGIN_DIR .'includes/classes/ajax-processor.php');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* User Role Editor for users.php */
|
||||
/* User Role Editor: support of 'Without Roles' button for users.php */
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#move_from_no_role_content').append(ure_users_data.to +' <select id="ure_new_role" name="ure_new_role"></select>');
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
|
||||
/*
|
||||
* User Role Editor: support of 'Grant Roles' button for Users page (wp-admin/users.php)
|
||||
*/
|
||||
|
||||
|
||||
function ure_get_selected_checkboxes(item_name) {
|
||||
var items = jQuery('input[type="checkbox"][name="'+ item_name +'\\[\\]"]:checked').map(function() { return this.value; }).get();
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
function ure_show_grant_roles_dialog() {
|
||||
var users = ure_get_selected_checkboxes('users');
|
||||
if (users.length==0) {
|
||||
alert(ure_users_grant_roles_data.select_users_first);
|
||||
return;
|
||||
}
|
||||
jQuery('#ure_grant_roles_dialog').dialog({
|
||||
dialogClass: 'wp-dialog',
|
||||
modal: true,
|
||||
autoOpen: true,
|
||||
closeOnEscape: true,
|
||||
width: 400,
|
||||
height: 400,
|
||||
resizable: false,
|
||||
title: ure_users_grant_roles_data.dialog_title,
|
||||
'buttons': {
|
||||
'OK': function () {
|
||||
if (!ure_grant_roles()) {
|
||||
return false;
|
||||
}
|
||||
jQuery(this).dialog('close');
|
||||
return true;
|
||||
},
|
||||
Cancel: function () {
|
||||
jQuery(this).dialog('close');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function ure_grant_roles() {
|
||||
|
||||
var roles = ure_get_selected_checkboxes('ure_roles');
|
||||
if (roles.length==0) {
|
||||
alert(ure_users_grant_roles_data.select_roles_first);
|
||||
return false;
|
||||
}
|
||||
jQuery('#ure_task_status').show();
|
||||
var users = ure_get_selected_checkboxes('users');
|
||||
var data = {
|
||||
'action': 'ure_ajax',
|
||||
'sub_action':'grant_roles',
|
||||
'users': users,
|
||||
'roles': roles,
|
||||
'wp_nonce': ure_users_grant_roles_data.wp_nonce};
|
||||
jQuery.post(ajaxurl, data, ure_page_reload, 'json');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function ure_set_url_arg(arg_name, arg_value) {
|
||||
var url = window.location.href;
|
||||
var hash = location.hash;
|
||||
url = url.replace(hash, '');
|
||||
if (url.indexOf(arg_name + "=")>=0) {
|
||||
var prefix = url.substring(0, url.indexOf(arg_name));
|
||||
var suffix = url.substring(url.indexOf(arg_name));
|
||||
suffix = suffix.substring(suffix.indexOf("=") + 1);
|
||||
suffix = (suffix.indexOf("&") >= 0) ? suffix.substring(suffix.indexOf("&")) : "";
|
||||
url = prefix + arg_name + "=" + arg_value + suffix;
|
||||
} else {
|
||||
if (url.indexOf("?") < 0) {
|
||||
url += "?" + arg_name + "=" + arg_value;
|
||||
} else {
|
||||
url += "&" + arg_name + "=" + arg_value;
|
||||
}
|
||||
}
|
||||
url = url + hash;
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
function ure_page_reload(response) {
|
||||
|
||||
if (response.result=='error') {
|
||||
jQuery('#ure_task_status').hide();
|
||||
alert(response.message);
|
||||
return;
|
||||
}
|
||||
|
||||
var url = ure_set_url_arg('update', 'promote');
|
||||
document.location = url;
|
||||
}
|
||||
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: User Role Editor 4.19.2\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-12-13 11:10+0700\n"
|
||||
"POT-Creation-Date: 2017-03-04 12:06+0700\n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: Vladimir Garagulya <vladimir@shinephp.com>\n"
|
||||
"Language-Team: https://www.role-editor.com <support@role-editor.com>\n"
|
||||
@@ -22,9 +22,9 @@ msgid "Custom Post Types"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/capabilities-groups-manager.php:75
|
||||
#: ../includes/classes/ure-lib.php:230
|
||||
#: ../includes/classes/user-role-editor.php:525
|
||||
#: ../includes/classes/user-role-editor.php:556
|
||||
#: ../includes/classes/ure-lib.php:232
|
||||
#: ../includes/classes/user-role-editor.php:563
|
||||
#: ../includes/classes/user-role-editor.php:594
|
||||
msgid "User Role Editor"
|
||||
msgstr ""
|
||||
|
||||
@@ -42,7 +42,7 @@ msgid "All"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/capabilities-groups-manager.php:112
|
||||
#: ../includes/classes/user-role-editor.php:497
|
||||
#: ../includes/classes/user-role-editor.php:535
|
||||
#: ../includes/settings-template.php:21
|
||||
msgid "General"
|
||||
msgstr ""
|
||||
@@ -68,7 +68,7 @@ msgid "Users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/capabilities-groups-manager.php:121
|
||||
#: ../includes/classes/user-role-editor.php:515
|
||||
#: ../includes/classes/user-role-editor.php:553
|
||||
#: ../includes/settings-template.php:34
|
||||
msgid "Multisite"
|
||||
msgstr ""
|
||||
@@ -82,9 +82,9 @@ msgid "Custom capabilities"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/capability.php:56 ../includes/classes/capability.php:164
|
||||
#: ../includes/classes/ure-lib.php:1223 ../includes/classes/ure-lib.php:1498
|
||||
#: ../includes/classes/ure-lib.php:1614 ../includes/classes/ure-lib.php:1662
|
||||
#: ../includes/classes/user-role-editor.php:766
|
||||
#: ../includes/classes/ure-lib.php:1225 ../includes/classes/ure-lib.php:1500
|
||||
#: ../includes/classes/ure-lib.php:1616 ../includes/classes/ure-lib.php:1664
|
||||
#: ../includes/classes/user-role-editor.php:804
|
||||
msgid "Insufficient permissions to work with User Role Editor"
|
||||
msgstr ""
|
||||
|
||||
@@ -116,6 +116,34 @@ msgstr ""
|
||||
msgid "capabilities were removed successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:81
|
||||
msgid "Invalid data at the users list"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:87
|
||||
msgid "Invalid data at the roles list"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:92
|
||||
msgid "Not enough permissions"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:137
|
||||
msgid "Working..."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:151
|
||||
msgid "Grant roles to selected users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:152
|
||||
msgid "Select users to which you wish to grant multiple roles!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/grant-roles.php:153
|
||||
msgid "Select role(s) which you wish to grant!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/role-additional-options.php:69
|
||||
msgid "Hide admin bar"
|
||||
msgstr ""
|
||||
@@ -255,414 +283,414 @@ msgid ""
|
||||
"limitation."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:207
|
||||
#: ../includes/classes/ure-lib.php:209
|
||||
msgid "Error: wrong request"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:291
|
||||
#: ../includes/classes/ure-lib.php:293
|
||||
msgid "Error: "
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:291
|
||||
#: ../includes/classes/ure-lib.php:293
|
||||
msgid "Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:292
|
||||
#: ../includes/classes/ure-lib.php:294
|
||||
msgid "does not exist"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:335
|
||||
#: ../includes/classes/ure-lib.php:337
|
||||
msgid "Role is updated successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:337
|
||||
#: ../includes/classes/ure-lib.php:339
|
||||
msgid "Roles are updated for all network"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:343
|
||||
#: ../includes/classes/ure-lib.php:345
|
||||
msgid "Error occured during role(s) update"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:350
|
||||
#: ../includes/classes/ure-lib.php:352
|
||||
msgid "User capabilities are updated successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:355
|
||||
#: ../includes/classes/ure-lib.php:357
|
||||
msgid "Error occured during user update"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:413
|
||||
#: ../includes/classes/ure-lib.php:415
|
||||
msgid "User Roles are restored to WordPress default values. "
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1461
|
||||
#: ../includes/classes/ure-lib.php:1463
|
||||
msgid "Error is occur. Please check the log file."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1507 ../includes/classes/ure-lib.php:1574
|
||||
#: ../includes/classes/ure-lib.php:1509 ../includes/classes/ure-lib.php:1576
|
||||
msgid ""
|
||||
"Error: Role ID must contain latin characters, digits, hyphens or underscore "
|
||||
"only!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1511 ../includes/classes/ure-lib.php:1578
|
||||
#: ../includes/classes/ure-lib.php:1513 ../includes/classes/ure-lib.php:1580
|
||||
msgid ""
|
||||
"Error: WordPress does not support numeric Role name (ID). Add latin "
|
||||
"characters to it."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1526
|
||||
#: ../includes/classes/ure-lib.php:1528
|
||||
#, php-format
|
||||
msgid "Role %s exists already"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1541
|
||||
#: ../includes/classes/ure-lib.php:1543
|
||||
msgid "Error is encountered during new role create operation"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1543
|
||||
#: ../includes/classes/ure-lib.php:1545
|
||||
#, php-format
|
||||
msgid "Role %s is created successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1567
|
||||
#: ../includes/classes/ure-lib.php:1569
|
||||
msgid "Error: Role ID is empty!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1585
|
||||
#: ../includes/classes/ure-lib.php:1587
|
||||
msgid "Error: Empty role display name is not allowed."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1592
|
||||
#: ../includes/classes/ure-lib.php:1594
|
||||
#, php-format
|
||||
msgid "Role %s does not exists"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1600
|
||||
#: ../includes/classes/ure-lib.php:1602
|
||||
#, php-format
|
||||
msgid "Role %s is renamed to %s successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1673
|
||||
#: ../includes/classes/ure-lib.php:1675
|
||||
msgid "Error encountered during role delete operation"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1675
|
||||
#: ../includes/classes/ure-lib.php:1677
|
||||
msgid "Unused roles are deleted successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1677
|
||||
#: ../includes/classes/ure-lib.php:1679
|
||||
#, php-format
|
||||
msgid "Role %s is deleted successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1708
|
||||
#: ../includes/classes/ure-lib.php:1710
|
||||
msgid "Error encountered during default role change operation"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1711
|
||||
#: ../includes/classes/ure-lib.php:1713
|
||||
#, php-format
|
||||
msgid "Default role for new users is set to %s successfully"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1714
|
||||
#: ../includes/classes/ure-lib.php:1716
|
||||
msgid "Can not set Administrator role as a default one"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1716
|
||||
#: ../includes/classes/ure-lib.php:1718
|
||||
msgid "This role does not exist - "
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1732
|
||||
#: ../includes/classes/ure-lib.php:1734
|
||||
msgid "Editor"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1733
|
||||
#: ../includes/classes/ure-lib.php:1735
|
||||
msgid "Author"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1734
|
||||
#: ../includes/classes/ure-lib.php:1736
|
||||
msgid "Contributor"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1735
|
||||
#: ../includes/classes/ure-lib.php:1737
|
||||
msgid "Subscriber"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1737
|
||||
#: ../includes/classes/ure-lib.php:1739
|
||||
msgid "Switch themes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1738
|
||||
#: ../includes/classes/ure-lib.php:1740
|
||||
msgid "Edit themes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1739
|
||||
#: ../includes/classes/ure-lib.php:1741
|
||||
msgid "Activate plugins"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1740
|
||||
#: ../includes/classes/ure-lib.php:1742
|
||||
msgid "Edit plugins"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1741
|
||||
#: ../includes/classes/ure-lib.php:1743
|
||||
msgid "Edit users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1742
|
||||
#: ../includes/classes/ure-lib.php:1744
|
||||
msgid "Edit files"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1743
|
||||
#: ../includes/classes/ure-lib.php:1745
|
||||
msgid "Manage options"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1744
|
||||
#: ../includes/classes/ure-lib.php:1746
|
||||
msgid "Moderate comments"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1745
|
||||
#: ../includes/classes/ure-lib.php:1747
|
||||
msgid "Manage categories"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1746
|
||||
#: ../includes/classes/ure-lib.php:1748
|
||||
msgid "Manage links"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1747
|
||||
#: ../includes/classes/ure-lib.php:1749
|
||||
msgid "Upload files"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1748
|
||||
#: ../includes/classes/ure-lib.php:1750
|
||||
msgid "Import"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1749
|
||||
#: ../includes/classes/ure-lib.php:1751
|
||||
msgid "Unfiltered html"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1750
|
||||
#: ../includes/classes/ure-lib.php:1752
|
||||
msgid "Edit posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1751
|
||||
#: ../includes/classes/ure-lib.php:1753
|
||||
msgid "Edit others posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1752
|
||||
#: ../includes/classes/ure-lib.php:1754
|
||||
msgid "Edit published posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1753
|
||||
#: ../includes/classes/ure-lib.php:1755
|
||||
msgid "Publish posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1754
|
||||
#: ../includes/classes/ure-lib.php:1756
|
||||
msgid "Edit pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1755
|
||||
#: ../includes/classes/ure-lib.php:1757
|
||||
msgid "Read"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1756
|
||||
#: ../includes/classes/ure-lib.php:1758
|
||||
msgid "Level 10"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1757
|
||||
#: ../includes/classes/ure-lib.php:1759
|
||||
msgid "Level 9"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1758
|
||||
#: ../includes/classes/ure-lib.php:1760
|
||||
msgid "Level 8"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1759
|
||||
#: ../includes/classes/ure-lib.php:1761
|
||||
msgid "Level 7"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1760
|
||||
#: ../includes/classes/ure-lib.php:1762
|
||||
msgid "Level 6"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1761
|
||||
#: ../includes/classes/ure-lib.php:1763
|
||||
msgid "Level 5"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1762
|
||||
#: ../includes/classes/ure-lib.php:1764
|
||||
msgid "Level 4"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1763
|
||||
#: ../includes/classes/ure-lib.php:1765
|
||||
msgid "Level 3"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1764
|
||||
#: ../includes/classes/ure-lib.php:1766
|
||||
msgid "Level 2"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1765
|
||||
#: ../includes/classes/ure-lib.php:1767
|
||||
msgid "Level 1"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1766
|
||||
#: ../includes/classes/ure-lib.php:1768
|
||||
msgid "Level 0"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1767
|
||||
#: ../includes/classes/ure-lib.php:1769
|
||||
msgid "Edit others pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1768
|
||||
#: ../includes/classes/ure-lib.php:1770
|
||||
msgid "Edit published pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1769
|
||||
#: ../includes/classes/ure-lib.php:1771
|
||||
msgid "Publish pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1770
|
||||
#: ../includes/classes/ure-lib.php:1772
|
||||
msgid "Delete pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1771
|
||||
#: ../includes/classes/ure-lib.php:1773
|
||||
msgid "Delete others pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1772
|
||||
#: ../includes/classes/ure-lib.php:1774
|
||||
msgid "Delete published pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1773
|
||||
#: ../includes/classes/ure-lib.php:1775
|
||||
msgid "Delete posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1774
|
||||
#: ../includes/classes/ure-lib.php:1776
|
||||
msgid "Delete others posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1775
|
||||
#: ../includes/classes/ure-lib.php:1777
|
||||
msgid "Delete published posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1776
|
||||
#: ../includes/classes/ure-lib.php:1778
|
||||
msgid "Delete private posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1777
|
||||
#: ../includes/classes/ure-lib.php:1779
|
||||
msgid "Edit private posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1778
|
||||
#: ../includes/classes/ure-lib.php:1780
|
||||
msgid "Read private posts"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1779
|
||||
#: ../includes/classes/ure-lib.php:1781
|
||||
msgid "Delete private pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1780
|
||||
#: ../includes/classes/ure-lib.php:1782
|
||||
msgid "Edit private pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1781
|
||||
#: ../includes/classes/ure-lib.php:1783
|
||||
msgid "Read private pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1782
|
||||
#: ../includes/classes/ure-lib.php:1784
|
||||
msgid "Delete users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1783
|
||||
#: ../includes/classes/ure-lib.php:1785
|
||||
msgid "Create users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1784
|
||||
#: ../includes/classes/ure-lib.php:1786
|
||||
msgid "Unfiltered upload"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1785
|
||||
#: ../includes/classes/ure-lib.php:1787
|
||||
msgid "Edit dashboard"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1786
|
||||
#: ../includes/classes/ure-lib.php:1788
|
||||
msgid "Update plugins"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1787
|
||||
#: ../includes/classes/ure-lib.php:1789
|
||||
msgid "Delete plugins"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1788
|
||||
#: ../includes/classes/ure-lib.php:1790
|
||||
msgid "Install plugins"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1789
|
||||
#: ../includes/classes/ure-lib.php:1791
|
||||
msgid "Update themes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1790
|
||||
#: ../includes/classes/ure-lib.php:1792
|
||||
msgid "Install themes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1791
|
||||
#: ../includes/classes/ure-lib.php:1793
|
||||
msgid "Update core"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1792
|
||||
#: ../includes/classes/ure-lib.php:1794
|
||||
msgid "List users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1793
|
||||
#: ../includes/classes/ure-lib.php:1795
|
||||
msgid "Remove users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1794
|
||||
#: ../includes/classes/ure-lib.php:1796
|
||||
msgid "Add users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1795
|
||||
#: ../includes/classes/ure-lib.php:1797
|
||||
msgid "Promote users"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1796
|
||||
#: ../includes/classes/ure-lib.php:1798
|
||||
msgid "Edit theme options"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1797
|
||||
#: ../includes/classes/ure-lib.php:1799
|
||||
msgid "Delete themes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1798
|
||||
#: ../includes/classes/ure-lib.php:1800
|
||||
msgid "Export"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1963
|
||||
#: ../includes/classes/ure-lib.php:1965
|
||||
msgid "Version:"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1964
|
||||
#: ../includes/classes/ure-lib.php:1966
|
||||
msgid "Author's website"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1965
|
||||
#: ../includes/classes/ure-lib.php:1967
|
||||
msgid "Plugin webpage"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1966
|
||||
#: ../includes/classes/ure-lib.php:1968
|
||||
msgid "Plugin download"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1967
|
||||
#: ../includes/classes/user-role-editor.php:474
|
||||
#: ../includes/classes/ure-lib.php:1969
|
||||
#: ../includes/classes/user-role-editor.php:512
|
||||
msgid "Changelog"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:1968
|
||||
#: ../includes/classes/ure-lib.php:1970
|
||||
msgid "FAQ"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/ure-lib.php:2150
|
||||
#: ../includes/classes/ure-lib.php:2152
|
||||
#, php-format
|
||||
msgid "Denied: %s"
|
||||
msgstr ""
|
||||
@@ -677,7 +705,7 @@ msgid "Select additional roles for this user"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-other-roles.php:161
|
||||
#: ../includes/classes/user-role-editor.php:356
|
||||
#: ../includes/classes/user-role-editor.php:394
|
||||
msgid "Capabilities"
|
||||
msgstr ""
|
||||
|
||||
@@ -689,179 +717,179 @@ msgstr ""
|
||||
msgid "Additional Capabilities"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:255
|
||||
#: ../includes/classes/user-role-editor.php:293
|
||||
msgid "Change role for users without role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:256
|
||||
#: ../includes/classes/user-role-editor.php:294
|
||||
msgid "To:"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:257
|
||||
#: ../includes/classes/user-role-editor.php:295
|
||||
msgid "No rights"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:258
|
||||
#: ../includes/classes/user-role-editor.php:296
|
||||
msgid "Provide new role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:330
|
||||
#: ../includes/classes/user-role-editor.php:332
|
||||
#: ../includes/classes/user-role-editor.php:368
|
||||
#: ../includes/classes/user-role-editor.php:370
|
||||
msgid "You do not have permission to edit this user."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:448
|
||||
#: ../includes/classes/user-role-editor.php:461
|
||||
#: ../includes/classes/user-role-editor.php:486
|
||||
#: ../includes/classes/user-role-editor.php:499
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:503
|
||||
#: ../includes/classes/user-role-editor.php:541
|
||||
#: ../includes/settings-template.php:26
|
||||
msgid "Additional Modules"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:509
|
||||
#: ../includes/classes/user-role-editor.php:547
|
||||
#: ../includes/settings-template.php:30
|
||||
msgid "Default Roles"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:619
|
||||
#: ../includes/classes/user-role-editor.php:637
|
||||
#: ../includes/classes/user-role-editor.php:682
|
||||
#: ../includes/classes/user-role-editor.php:657
|
||||
#: ../includes/classes/user-role-editor.php:675
|
||||
#: ../includes/classes/user-role-editor.php:720
|
||||
msgid "User Role Editor options are updated"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:665
|
||||
#: ../includes/classes/user-role-editor.php:703
|
||||
msgid "Default Roles are updated"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:691
|
||||
#: ../includes/classes/user-role-editor.php:729
|
||||
msgid ""
|
||||
"You do not have sufficient permissions to manage options for User Role "
|
||||
"Editor."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:804
|
||||
#: ../includes/classes/user-role-editor.php:842
|
||||
msgid "Confirm"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:805
|
||||
#: ../includes/classes/user-role-editor.php:843
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:806
|
||||
#: ../includes/classes/user-role-editor.php:844
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:807
|
||||
#: ../includes/classes/user-role-editor.php:845
|
||||
msgid "Select All"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:808
|
||||
#: ../includes/classes/user-role-editor.php:846
|
||||
msgid "Unselect All"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:809
|
||||
#: ../includes/classes/user-role-editor.php:847
|
||||
msgid "Reverse"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:810
|
||||
#: ../includes/classes/user-role-editor.php:848
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:811
|
||||
#: ../includes/classes/user-role-editor.php:849
|
||||
msgid "Please confirm permissions update"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:812
|
||||
#: ../includes/classes/user-role-editor.php:850
|
||||
msgid "Add New Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:813
|
||||
#: ../includes/classes/user-role-editor.php:818
|
||||
#: ../includes/classes/user-role-editor.php:851
|
||||
#: ../includes/classes/user-role-editor.php:856
|
||||
msgid "Rename Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:814
|
||||
#: ../includes/classes/user-role-editor.php:852
|
||||
msgid " Role name (ID) can not be empty!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:815
|
||||
#: ../includes/classes/user-role-editor.php:853
|
||||
msgid ""
|
||||
" Role name (ID) must contain latin characters, digits, hyphens or underscore "
|
||||
"only!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:816
|
||||
#: ../includes/classes/user-role-editor.php:854
|
||||
msgid ""
|
||||
" WordPress does not support numeric Role name (ID). Add latin characters to "
|
||||
"it."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:817
|
||||
#: ../includes/classes/user-role-editor.php:855
|
||||
msgid "Add Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:819
|
||||
#: ../includes/classes/user-role-editor.php:857
|
||||
msgid "Delete Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:820
|
||||
#: ../includes/classes/user-role-editor.php:858
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:821
|
||||
#: ../includes/classes/user-role-editor.php:859
|
||||
msgid "Add Capability"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:822
|
||||
#: ../includes/classes/user-role-editor.php:831
|
||||
#: ../includes/classes/user-role-editor.php:860
|
||||
#: ../includes/classes/user-role-editor.php:869
|
||||
msgid "Delete Capability"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:823
|
||||
#: ../includes/classes/user-role-editor.php:861
|
||||
msgid "Reset"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:824
|
||||
#: ../includes/classes/user-role-editor.php:862
|
||||
msgid "DANGER! Resetting will restore default settings from WordPress Core."
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:825
|
||||
#: ../includes/classes/user-role-editor.php:863
|
||||
msgid ""
|
||||
"If any plugins have changed capabilities in any way upon installation (such "
|
||||
"as S2Member, WooCommerce, and many more), those capabilities will be DELETED!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:826
|
||||
#: ../includes/classes/user-role-editor.php:864
|
||||
msgid ""
|
||||
"For more information on how to undo changes and restore plugin capabilities "
|
||||
"go to"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:828
|
||||
#: ../includes/classes/user-role-editor.php:866
|
||||
msgid "Continue?"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:829
|
||||
#: ../includes/classes/user-role-editor.php:867
|
||||
msgid "Default Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:830
|
||||
#: ../includes/classes/user-role-editor.php:868
|
||||
msgid "Set New Default Role"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:832
|
||||
#: ../includes/classes/user-role-editor.php:870
|
||||
msgid ""
|
||||
"Warning! Be careful - removing critical capability could crash some plugin "
|
||||
"or other custom code"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:833
|
||||
#: ../includes/classes/user-role-editor.php:871
|
||||
msgid " Capability name (ID) can not be empty!"
|
||||
msgstr ""
|
||||
|
||||
#: ../includes/classes/user-role-editor.php:834
|
||||
#: ../includes/classes/user-role-editor.php:872
|
||||
msgid ""
|
||||
" Capability name (ID) must contain latin characters, digits, hyphens or "
|
||||
"underscore only!"
|
||||
|
||||
@@ -3,8 +3,8 @@ Contributors: shinephp
|
||||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladimir%40shinephp%2ecom&lc=RU&item_name=ShinePHP%2ecom&item_number=User%20Role%20Editor%20WordPress%20plugin¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
||||
Tags: user, role, editor, security, access, permission, capability
|
||||
Requires at least: 4.0
|
||||
Tested up to: 4.7
|
||||
Stable tag: 4.31.1
|
||||
Tested up to: 4.7.3
|
||||
Stable tag: 4.32.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
@@ -24,7 +24,7 @@ Multi-site support is provided.
|
||||
To read more about 'User Role Editor' visit [this page](http://www.shinephp.com/user-role-editor-wordpress-plugin/) at [shinephp.com](http://shinephp.com)
|
||||
|
||||
|
||||
Do you need more functionality with quality support in the real time? Do you wish to remove advertisements from User Role Editor pages?
|
||||
Do you need more functionality with quality support in a real time? Do you wish to remove advertisements from User Role Editor pages?
|
||||
[Buy Pro version](https://www.role-editor.com).
|
||||
[User Role Editor Pro](https://www.role-editor.com) includes extra modules:
|
||||
<ul>
|
||||
@@ -67,6 +67,7 @@ To read full FAQ section visit [this page](http://www.shinephp.com/user-role-edi
|
||||
3. screenshot-3.png User Capabilities link
|
||||
4. screenshot-4.png User Capabilities Editor
|
||||
5. screenshot-5.png Bulk change role for users without roles
|
||||
6. screenshot-6.png Assign multiple roles to the selected users
|
||||
|
||||
To read more about 'User Role Editor' visit [this page](http://www.shinephp.com/user-role-editor-wordpress-plugin/) at [shinephp.com](shinephp.com).
|
||||
|
||||
@@ -75,7 +76,24 @@ To read more about 'User Role Editor' visit [this page](http://www.shinephp.com/
|
||||
If you wish to check available translations or help with plugin translation to your language visit this link
|
||||
https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
|
||||
|
||||
|
||||
== Changelog ==
|
||||
= [4.32.3] 03.04.2017 =
|
||||
* Fix: Boolean false was sent to WordPress core wp_enqueue_script() function as the 2nd parameter instead of an empty string. We should respect the type of parameter which code author supposed to use initially.
|
||||
* Fix: Bulk grant to users multiple roles JavaScript code is loaded now for users.php page only, not globally.
|
||||
|
||||
= [4.32.2] 17.03.2017 =
|
||||
* Fix: "Users->Grant Roles" button did not work with switched off option "Count Users without role" at "Settings->User Role Editor->Additional Modules" tab. "JQuery UI" library was not loaded.
|
||||
* Update: minimal PHP version was raised to 5.3.
|
||||
|
||||
= [4.32.1] 09.03.2017 =
|
||||
* Fix: URL to users.php page was built incorrectly after bulk roles assignment to the users selected at the 1st page of a users list.
|
||||
|
||||
= [4.32] 09.03.2017 =
|
||||
* New: Button "Grant Roles" allows to "Assign multiple roles to the selected users" directly from the "Users" page.
|
||||
* Update: singleton template was applied to the main User_Role_Editor class. While GLOBALS['user-role-editor'] reference to the instance of User_Role_Editor class is still available for the compatibility purpose, call to User_Role_Editor::get_instance() is the best way now to get a reference to the instance of User_Role_Editor class.
|
||||
* Fix: Missed 'unfiltered_html' capability is shown now at the 'General' capabilities group too.
|
||||
|
||||
= [4.31.1] 06.01.2017 =
|
||||
* Fix: WP transients get/set were removed from URE_Own_Capabilities class. It leaded to the MySQL deadlock in some cases.
|
||||
* Update: Base_Lib::get_request_var() sanitizes user input by PHP's filter_var() in addition to WordPress core's esc_attr().
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -3,7 +3,7 @@
|
||||
Plugin Name: User Role Editor
|
||||
Plugin URI: https://www.role-editor.com
|
||||
Description: Change/add/delete WordPress user roles and capabilities.
|
||||
Version: 4.31.1
|
||||
Version: 4.32.3
|
||||
Author: Vladimir Garagulya
|
||||
Author URI: https://www.role-editor.com
|
||||
Text Domain: ure
|
||||
@@ -11,7 +11,7 @@ Domain Path: /lang/
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2010-2016 Vladimir Garagulya (email: support@role-editor.com)
|
||||
Copyright 2010-2017 Vladimir Garagulya (email: support@role-editor.com)
|
||||
*/
|
||||
|
||||
if (!function_exists('get_option')) {
|
||||
@@ -23,7 +23,7 @@ if (defined('URE_PLUGIN_URL')) {
|
||||
wp_die('It seems that other version of User Role Editor is active. Please deactivate it before use this version');
|
||||
}
|
||||
|
||||
define('URE_VERSION', '4.31.1');
|
||||
define('URE_VERSION', '4.32.3');
|
||||
define('URE_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
define('URE_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
define('URE_PLUGIN_BASE_NAME', plugin_basename(__FILE__));
|
||||
@@ -34,7 +34,7 @@ require_once(URE_PLUGIN_DIR.'includes/classes/base-lib.php');
|
||||
require_once(URE_PLUGIN_DIR.'includes/classes/ure-lib.php');
|
||||
|
||||
// check PHP version
|
||||
$ure_required_php_version = '5.2.4';
|
||||
$ure_required_php_version = '5.3';
|
||||
$exit_msg = sprintf( 'User Role Editor requires PHP %s or newer.', $ure_required_php_version ) .
|
||||
'<a href="http://wordpress.org/about/requirements/"> ' . 'Please update!' . '</a>';
|
||||
Ure_Lib::check_version( PHP_VERSION, $ure_required_php_version, $exit_msg, __FILE__ );
|
||||
@@ -47,4 +47,4 @@ Ure_Lib::check_version(get_bloginfo('version'), $ure_required_wp_version, $exit_
|
||||
|
||||
require_once(URE_PLUGIN_DIR .'includes/loader.php');
|
||||
|
||||
$GLOBALS['user_role_editor'] = new User_Role_Editor();
|
||||
$GLOBALS['user_role_editor'] = User_Role_Editor::get_instance();
|
||||
@@ -364,9 +364,9 @@ add_action( 'wp_ajax_get_focus_keyword_usage', 'ajax_get_keyword_usage' );
|
||||
function ajax_get_term_keyword_usage() {
|
||||
$post_id = filter_input( INPUT_POST, 'post_id' );
|
||||
$keyword = filter_input( INPUT_POST, 'keyword' );
|
||||
$taxonomyName = filter_input( INPUT_POST, 'taxonomy' );
|
||||
$taxonomy_name = filter_input( INPUT_POST, 'taxonomy' );
|
||||
|
||||
$taxonomy = get_taxonomy( $taxonomyName );
|
||||
$taxonomy = get_taxonomy( $taxonomy_name );
|
||||
|
||||
if ( ! $taxonomy ) {
|
||||
wp_die( 0 );
|
||||
@@ -376,7 +376,7 @@ function ajax_get_term_keyword_usage() {
|
||||
wp_die( -1 );
|
||||
}
|
||||
|
||||
$usage = WPSEO_Taxonomy_Meta::get_keyword_usage( $keyword, $post_id, $taxonomyName );
|
||||
$usage = WPSEO_Taxonomy_Meta::get_keyword_usage( $keyword, $post_id, $taxonomy_name );
|
||||
|
||||
// Normalize the result so it it the same as the post keyword usage AJAX request.
|
||||
$usage = $usage[ $keyword ];
|
||||
@@ -392,13 +392,13 @@ add_action( 'wp_ajax_get_term_keyword_usage', 'ajax_get_term_keyword_usage' );
|
||||
* Removes stopword from the sample permalink that is generated in an AJAX request
|
||||
*
|
||||
* @param array $permalink The permalink generated for this post by WordPress.
|
||||
* @param int $post_ID The ID of the post.
|
||||
* @param string $title The title for the post that the user used.
|
||||
* @param string $name The name for the post that the user used.
|
||||
* @param int $post_id The ID of the post.
|
||||
* @param string $title The title for the post that the user used.
|
||||
* @param string $name The name for the post that the user used.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function wpseo_remove_stopwords_sample_permalink( $permalink, $post_ID, $title, $name ) {
|
||||
function wpseo_remove_stopwords_sample_permalink( $permalink, $post_id, $title, $name ) {
|
||||
WPSEO_Options::get_instance();
|
||||
$options = WPSEO_Options::get_options( array( 'wpseo_permalinks' ) );
|
||||
if ( $options['cleanslugs'] !== true ) {
|
||||
|
||||
@@ -82,30 +82,51 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
* @return WPSEO_Admin_Banner_Spot
|
||||
*/
|
||||
protected function get_premium_spot() {
|
||||
$premium_spot = new WPSEO_Admin_Banner_Spot( __( 'Premium', 'wordpress-seo' ), $this->banner_renderer );
|
||||
$premium_spot = new WPSEO_Admin_Banner_Spot( '', $this->banner_renderer );
|
||||
|
||||
$premium_spot->set_description(
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast plugin page, %2$s is the link closing tag */
|
||||
__( 'Want to get the most out of your SEO-strategy? %1$sGo premium!%2$s.', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="https://yoa.st/ji">',
|
||||
'</a>'
|
||||
)
|
||||
$premium_uri = WPSEO_Shortlinker::get( 'https://yoa.st/jj' );
|
||||
|
||||
$premium_spot->set_extra(
|
||||
/* translators: %1$s expands to the plugin name */
|
||||
'<h2>' . sprintf( __( 'Get %1$s', 'wordpress-seo' ), 'Yoast SEO Premium' ) . '</h2>' .
|
||||
'<ul>' .
|
||||
'<li><strong>' . __( 'Multiple keywords', 'wordpress-seo' ) . '</strong><br/>' . __( 'Increase your SEO reach', 'wordpress-seo' ) . '</li>' .
|
||||
'<li><strong>' . __( 'No more dead links', 'wordpress-seo' ) . '</strong><br/>' . __( 'Easy redirect manager', 'wordpress-seo' ) . '</li>' .
|
||||
'<li><strong>' . __( 'Internal linking suggestions', 'wordpress-seo' ) . '</strong><br/>' . __( 'Find related posts superfast', 'wordpress-seo' ) . '</li>' .
|
||||
'<li><strong>' . __( 'Social media preview', 'wordpress-seo' ) . '</strong><br/>' . esc_html__( 'Facebook & Twitter', 'wordpress-seo' ) . '</li>' .
|
||||
'<li><strong>' . __( '24/7 support', 'wordpress-seo' ) . '</strong></li>' .
|
||||
'<li><strong>' . __( 'No ads!', 'wordpress-seo' ) . '</strong></li>' .
|
||||
'</ul>' .
|
||||
/* translators: %s expands to Yoast SEO Premium */
|
||||
'<a id="wpseo-premium-button" class="button button-primary" href="' . $premium_uri . '">' . sprintf( __( 'Get %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' ) . '</a><br/>' .
|
||||
'<small>' . __( 'Prices start as low as 69,- for one site', 'wordpress-seo' ) . '</small><br/><br/>'
|
||||
);
|
||||
|
||||
$premium_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jj',
|
||||
'premium-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO Premium. */
|
||||
/*
|
||||
$premium_spot->set_description(
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast plugin page, %2$s is the link closing tag * /
|
||||
__( 'Want to get the most out of your SEO-strategy? %1$sGo premium!%2$s.', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/ji' ) . '">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
/*
|
||||
|
||||
$premium_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jj' ),
|
||||
'premium-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO Premium. * /
|
||||
__( 'Buy the %1$s plugin now and get access to extra features and 24/7 support!', 'wordpress-seo' ),
|
||||
'Yoast SEO Premium'
|
||||
)
|
||||
)
|
||||
);
|
||||
*/
|
||||
|
||||
return $premium_spot;
|
||||
}
|
||||
@@ -122,7 +143,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast Services page, %2$s to Yoast, %3$s is the link closing tag. */
|
||||
__( 'Do you want to know how to improve your rankings? %1$sLet team %2$s help you!%3$s', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="https://yoa.st/jk">',
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/jk' ) . '">',
|
||||
'Yoast',
|
||||
'</a>'
|
||||
)
|
||||
@@ -130,7 +151,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$service_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jm',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jm' ),
|
||||
'configuration-service.png',
|
||||
261,
|
||||
152,
|
||||
@@ -142,19 +163,21 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
)
|
||||
);
|
||||
|
||||
/*
|
||||
$service_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/seo-care-banner',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/seo-care-banner' ),
|
||||
'seo-care.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO Care. */
|
||||
/* translators: %1$s expands to Yoast SEO Care. * /
|
||||
__( 'Let us help you take care of the SEO of your website. Order %1$s now!', 'wordpress-seo' ),
|
||||
'Yoast SEO Care'
|
||||
)
|
||||
)
|
||||
);
|
||||
*/
|
||||
|
||||
return $service_spot;
|
||||
}
|
||||
@@ -187,7 +210,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast plugin page, %2$s is the link closing tag. */
|
||||
__( 'Take your SEO to the next level and outrank your competition with our %1$sSEO plugins%2$s.', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="https://yoa.st/jn">',
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/jn' ) . '">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
@@ -195,7 +218,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
if ( empty( $active_extensions['video'] ) ) {
|
||||
$extension_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jo',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jo' ),
|
||||
'video-seo.png',
|
||||
261,
|
||||
152,
|
||||
@@ -208,10 +231,10 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
);
|
||||
}
|
||||
|
||||
if ( empty( $active_extensions['woocommerce'] ) ) {
|
||||
if ( empty( $active_extensions['woocommerce'] ) ) {
|
||||
$extension_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jp',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jp' ),
|
||||
'woocommerce-seo.png',
|
||||
261,
|
||||
152,
|
||||
@@ -227,7 +250,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
if ( empty( $active_extensions['local'] ) ) {
|
||||
$extension_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jq',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jq' ),
|
||||
'local-seo.png', 261,
|
||||
152,
|
||||
sprintf(
|
||||
@@ -242,7 +265,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
if ( empty( $active_extensions['news'] ) ) {
|
||||
$extension_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jr',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jr' ),
|
||||
'news-seo.png',
|
||||
261,
|
||||
152,
|
||||
@@ -270,14 +293,14 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast Services page, %2$s is the link closing tag. */
|
||||
__( 'Do you want to get a grip on your own SEO-strategy? Learn all about it in one of %1$sour courses%2$s.', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="https://yoa.st/jt">',
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/jt' ) . '">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/ju',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/ju' ),
|
||||
'basic-seo-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -287,7 +310,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jv',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jv' ),
|
||||
'yoast-seo-for-wordpress-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -302,7 +325,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jw',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jw' ),
|
||||
'seo-copywriting-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -312,7 +335,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jx',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jx' ),
|
||||
'keyword-research-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -322,7 +345,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/qy',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/qy' ),
|
||||
'site-structure-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -332,7 +355,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
|
||||
$courses_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoa.st/jaa',
|
||||
WPSEO_Shortlinker::get( 'https://yoa.st/jaa' ),
|
||||
'technical-seo-training.png',
|
||||
261,
|
||||
152,
|
||||
@@ -355,7 +378,7 @@ class WPSEO_Admin_Banner_Sidebar {
|
||||
);
|
||||
|
||||
$remove_banner_spot->set_description(
|
||||
'<a target="_blank" href="https://yoa.st/jy">' .
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/jy' ) . '">' .
|
||||
/* translators: %1$s expands to Yoast SEO Premium */
|
||||
sprintf( __( 'Upgrade to %1$s »', 'wordpress-seo' ), 'Yoast SEO Premium' ) .
|
||||
'</a>'
|
||||
|
||||
+8
-1
@@ -16,7 +16,14 @@ class WPSEO_Admin_Banner_Spot_Renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function render( WPSEO_Admin_Banner_Spot $banner_spot ) {
|
||||
$output = '<div class="yoast-sidebar__spot"><strong>' . $banner_spot->get_title() . '</strong>';
|
||||
$output = '<div class="yoast-sidebar__spot">';
|
||||
if ( $banner_spot->get_title() !== '' ) {
|
||||
$output .= '<strong>' . $banner_spot->get_title() . '</strong>';
|
||||
}
|
||||
|
||||
if ( $banner_spot->get_extra() !== '' ) {
|
||||
$output .= $banner_spot->get_extra();
|
||||
}
|
||||
|
||||
if ( $banner_spot->get_description() !== '' ) {
|
||||
$output .= '<p>' . $banner_spot->get_description() . '</p>';
|
||||
|
||||
@@ -14,6 +14,9 @@ class WPSEO_Admin_Banner_Spot {
|
||||
/** @var string */
|
||||
private $description = '';
|
||||
|
||||
/** @var string */
|
||||
private $extra = '';
|
||||
|
||||
/** @var WPSEO_Admin_Banner[] */
|
||||
private $banners = array();
|
||||
|
||||
@@ -46,6 +49,15 @@ class WPSEO_Admin_Banner_Spot {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extra content.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_extra() {
|
||||
return $this->extra;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the description
|
||||
*
|
||||
@@ -55,6 +67,15 @@ class WPSEO_Admin_Banner_Spot {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "extra"
|
||||
*
|
||||
* @param string $extra The "extra".
|
||||
*/
|
||||
public function set_extra( $extra ) {
|
||||
$this->extra = $extra;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an admin banner.
|
||||
*
|
||||
|
||||
@@ -250,7 +250,7 @@ class WPSEO_Admin_Asset_Manager {
|
||||
),
|
||||
array(
|
||||
'name' => 'select2',
|
||||
'src' => 'select2/select2',
|
||||
'src' => 'select2/select2.full',
|
||||
'suffix' => '.min',
|
||||
'deps' => array(
|
||||
'jquery',
|
||||
|
||||
@@ -92,6 +92,9 @@ class WPSEO_Admin {
|
||||
}
|
||||
|
||||
$this->set_upsell_notice();
|
||||
|
||||
$this->check_php_version();
|
||||
$this->initialize_cornerstone_content();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +157,8 @@ class WPSEO_Admin {
|
||||
|
||||
$admin_page_hooks[ self::PAGE_IDENTIFIER ] = 'seo'; // Wipe notification bits from hooks. R.
|
||||
|
||||
$license_page_title = defined( 'WPSEO_PREMIUM_PLUGIN_FILE' ) ? __( 'Premium', 'wordpress-seo' ) : __( 'Go Premium', 'wordpress-seo' ) . ' ' . $this->get_premium_indicator();
|
||||
|
||||
// Sub menu pages.
|
||||
$submenu_pages = array(
|
||||
array(
|
||||
@@ -221,7 +226,7 @@ class WPSEO_Admin {
|
||||
array(
|
||||
self::PAGE_IDENTIFIER,
|
||||
'',
|
||||
__( 'Go Premium', 'wordpress-seo' ) . ' ' . $this->get_premium_indicator(),
|
||||
$license_page_title,
|
||||
$manage_options_cap,
|
||||
'wpseo_licenses',
|
||||
array( $this, 'load_page' ),
|
||||
@@ -310,7 +315,7 @@ class WPSEO_Admin {
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
__( 'The title & metas settings for %1$s are made up of variables that are replaced by specific values from the page when the page is displayed. The tabs on the left explain the available variables.', 'wordpress-seo' ),
|
||||
'Yoast SEO' ) .
|
||||
'</p>' . '<p>' . __( 'Note that not all variables can be used in every template.', 'wordpress-seo' ) . '</p>',
|
||||
'</p><p>' . __( 'Note that not all variables can be used in every template.', 'wordpress-seo' ) . '</p>',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -604,7 +609,7 @@ class WPSEO_Admin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporarily disables a particular page if it is present in the list of passed pages.
|
||||
* Given a list of passed pages that will be disabled, removes the given page from the list so that it will no longer be disabled.
|
||||
*
|
||||
* @param array $pages The pages to search through.
|
||||
* @param string $page The page to temporarily enable.
|
||||
@@ -704,6 +709,47 @@ class WPSEO_Admin {
|
||||
$upsell->initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes Whip to show a notice for outdated PHP versions.
|
||||
*/
|
||||
protected function check_php_version() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $this->on_dashboard_page() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
whip_wp_check_versions( array(
|
||||
'php' => '>=5.3',
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we are on the admin dashboard page.
|
||||
*
|
||||
* @returns bool
|
||||
*/
|
||||
protected function on_dashboard_page() {
|
||||
return 'index.php' === $GLOBALS['pagenow'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the cornerstone filter
|
||||
*/
|
||||
protected function initialize_cornerstone_content() {
|
||||
if ( ! $this->options['enable_cornerstone_content'] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$cornerstone = new WPSEO_Cornerstone();
|
||||
$cornerstone->register_hooks();
|
||||
|
||||
$cornerstone_filter = new WPSEO_Cornerstone_Filter();
|
||||
$cornerstone_filter->register_hooks();
|
||||
}
|
||||
|
||||
/********************** DEPRECATED METHODS **********************/
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
@@ -804,34 +850,33 @@ class WPSEO_Admin {
|
||||
return $stop_words->list_stop_words();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether the stopword appears in the string
|
||||
*
|
||||
* @deprecated 3.1
|
||||
*
|
||||
* @param string $haystack The string to be checked for the stopword.
|
||||
* @param bool $checkingUrl Whether or not we're checking a URL.
|
||||
* @param string $haystack The string to be checked for the stopword.
|
||||
* @param bool $checking_url Whether or not we're checking a URL.
|
||||
*
|
||||
* @return bool|mixed
|
||||
*/
|
||||
function stopwords_check( $haystack, $checkingUrl = false ) {
|
||||
function stopwords_check( $haystack, $checking_url = false ) {
|
||||
_deprecated_function( __METHOD__, 'WPSEO 3.1' );
|
||||
|
||||
$stopWords = $this->stopwords();
|
||||
$stop_words = $this->stopwords();
|
||||
|
||||
if ( is_array( $stopWords ) && $stopWords !== array() ) {
|
||||
foreach ( $stopWords as $stopWord ) {
|
||||
if ( is_array( $stop_words ) && $stop_words !== array() ) {
|
||||
foreach ( $stop_words as $stop_word ) {
|
||||
// If checking a URL remove the single quotes.
|
||||
if ( $checkingUrl ) {
|
||||
$stopWord = str_replace( "'", '', $stopWord );
|
||||
if ( $checking_url ) {
|
||||
$stop_word = str_replace( "'", '', $stop_word );
|
||||
}
|
||||
|
||||
// Check whether the stopword appears as a whole word.
|
||||
// @todo [JRF => whomever] check whether the use of \b (=word boundary) would be more efficient ;-).
|
||||
$res = preg_match( "`(^|[ \n\r\t\.,'\(\)\"\+;!?:])" . preg_quote( $stopWord, '`' ) . "($|[ \n\r\t\.,'\(\)\"\+;!?:])`iu", $haystack );
|
||||
$res = preg_match( "`(^|[ \n\r\t\.,'\(\)\"\+;!?:])" . preg_quote( $stop_word, '`' ) . "($|[ \n\r\t\.,'\(\)\"\+;!?:])`iu", $haystack );
|
||||
if ( $res > 0 ) {
|
||||
return $stopWord;
|
||||
return $stop_word;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ class WPSEO_Bulk_List_Table extends WP_List_Table {
|
||||
* @return array
|
||||
*/
|
||||
function get_sortable_columns() {
|
||||
return $sortable = array(
|
||||
return array(
|
||||
'col_page_title' => array( 'post_title', true ),
|
||||
'col_post_type' => array( 'post_type', false ),
|
||||
'col_post_date' => array( 'post_date', false ),
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds a checkbox to the focus keyword section.
|
||||
*/
|
||||
class WPSEO_Cornerstone_Field {
|
||||
|
||||
/**
|
||||
* Returns a label with a checkbox in it. Make it possible to mark the page as cornerstone content.
|
||||
*
|
||||
* @param WP_POST $post The post object.
|
||||
*
|
||||
* @return string The HTML to show.
|
||||
*/
|
||||
public function get_html( $post ) {
|
||||
$return = '';
|
||||
$return .= sprintf(
|
||||
'<input id="%1$s" class="wpseo-cornerstone-checkbox" type="checkbox" value="1" name="%1$s" %2$s/>',
|
||||
WPSEO_Cornerstone::META_NAME,
|
||||
checked( $this->get_meta_value( $post->ID ), '1', false )
|
||||
);
|
||||
|
||||
$return .= sprintf( '<label for="%1$s">', WPSEO_Cornerstone::META_NAME );
|
||||
|
||||
/* translators: 1: link open tag; 2: link close tag. */
|
||||
$return .= sprintf(
|
||||
__( 'This article is %1$scornerstone content%2$s', 'wordpress-seo' ),
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/metabox-help-cornerstone' ) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
$return .= '</label>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the meta value from the database.
|
||||
*
|
||||
* @param int $post_id The post id to get the meta value for.
|
||||
*
|
||||
* @return null|string The meta value from the database.
|
||||
*/
|
||||
protected function get_meta_value( $post_id ) {
|
||||
return get_post_meta( $post_id, WPSEO_Cornerstone::META_NAME, true );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Registers the filter for filtering posts by cornerstone content.
|
||||
*/
|
||||
class WPSEO_Cornerstone_Filter {
|
||||
|
||||
const FILTER_QUERY_ARG = 'yoast_cornerstone';
|
||||
|
||||
/**
|
||||
* Registers the hook.
|
||||
*/
|
||||
public function register_hooks() {
|
||||
foreach ( $this->get_post_types() as $post_type ) {
|
||||
add_filter( 'views_edit-' . $post_type, array( $this, 'add_filter_link' ) );
|
||||
}
|
||||
|
||||
add_filter( 'posts_where', array( $this, 'filter_posts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a filter link to the views.
|
||||
*
|
||||
* @param array $views Array with the views.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function add_filter_link( array $views ) {
|
||||
|
||||
$cornerstone_url = $this->get_cornerstone_url();
|
||||
|
||||
$views['yoast_cornerstone'] = sprintf(
|
||||
'<a href="%1$s" class="%2$s">%3$s</a> (%4$s)',
|
||||
esc_url( $cornerstone_url ),
|
||||
( $this->is_cornerstone_filter_active() ) ? 'current' : '',
|
||||
__( 'Cornerstone articles', 'wordpress-seo' ),
|
||||
$this->get_cornerstone_total()
|
||||
);
|
||||
|
||||
return $views;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the query based on the seo_filter variable in $_GET
|
||||
*
|
||||
* @param array $where Query variables.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function filter_posts( $where ) {
|
||||
if ( $this->is_cornerstone_filter_active() ) {
|
||||
global $wpdb;
|
||||
|
||||
$where .= sprintf(
|
||||
' AND ID IN( SELECT post_id FROM ' . $wpdb->postmeta . ' WHERE meta_key = "%s" AND meta_value = "1" ) ',
|
||||
WPSEO_Cornerstone::META_NAME
|
||||
);
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the post_type from the REQUEST URL because of the cornerstone filter is in the same line.
|
||||
* After removing the post_type it will add a query arg for filtering the cornerstone content.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_cornerstone_url() {
|
||||
$cornerstone_url = remove_query_arg( array( 'post_status' ) );
|
||||
$cornerstone_url = add_query_arg( self::FILTER_QUERY_ARG, '1', $cornerstone_url );
|
||||
|
||||
return $cornerstone_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total amount of articles marked as cornerstone content.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
protected function get_cornerstone_total() {
|
||||
global $wpdb;
|
||||
|
||||
return (int) $wpdb->get_var(
|
||||
$wpdb->prepare( '
|
||||
SELECT COUNT( 1 )
|
||||
FROM ' . $wpdb->postmeta . '
|
||||
WHERE post_id IN( SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type = "%s" ) &&
|
||||
meta_value = "1" AND meta_key = "%s"
|
||||
',
|
||||
$this->get_current_post_type(),
|
||||
WPSEO_Cornerstone::META_NAME
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when the cornerstone filter is active.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function is_cornerstone_filter_active() {
|
||||
return ( filter_input( INPUT_GET, self::FILTER_QUERY_ARG ) === '1' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current post type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function get_current_post_type() {
|
||||
return filter_input(
|
||||
INPUT_GET, 'post_type', FILTER_DEFAULT, array(
|
||||
'options' => array( 'default' => 'post' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the post types which can be used to set as cornerstone content.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_post_types() {
|
||||
return array( 'post', 'page' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents the yoast cornerstone content.
|
||||
*/
|
||||
class WPSEO_Cornerstone {
|
||||
|
||||
const META_NAME = '_yst_is_cornerstone';
|
||||
|
||||
/**
|
||||
* Registers the hooks.
|
||||
*/
|
||||
public function register_hooks() {
|
||||
add_action( 'save_post', array( $this, 'save_meta_value' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the meta value to the database.
|
||||
*
|
||||
* @param int $post_id The post id to save the meta value for.
|
||||
*/
|
||||
public function save_meta_value( $post_id ) {
|
||||
$is_cornerstone = ( filter_input( INPUT_POST, self::META_NAME ) === '1' );
|
||||
|
||||
update_post_meta( $post_id, self::META_NAME, $is_cornerstone );
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,8 @@ class WPSEO_Export {
|
||||
|
||||
foreach ( $options as $key => $elem ) {
|
||||
if ( is_array( $elem ) ) {
|
||||
for ( $i = 0; $i < count( $elem ); $i ++ ) {
|
||||
$count = count( $elem );
|
||||
for ( $i = 0; $i < $count; $i ++ ) {
|
||||
$this->write_setting( $key . '[]', $elem[ $i ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,10 +59,25 @@ class WPSEO_Help_Center {
|
||||
private function add_contact_support_item() {
|
||||
/* translators: %s: expands to 'Yoast SEO Premium'. */
|
||||
$popup_title = sprintf( __( 'Email support is a %s feature', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
||||
/* translators: %1$s: expands to 'Yoast SEO Premium', %2$s: links to Yoast SEO Premium plugin page. */
|
||||
$popup_content = sprintf( __( 'To be able to contact our support team, you need %1$s. You can buy the plugin, including one year of support, updates and upgrades, on %2$s.', 'wordpress-seo' ),
|
||||
'<a href="https://yoa.st/multiple-keywords">Yoast SEO Premium</a>',
|
||||
'yoast.com' );
|
||||
|
||||
$popup_content = '<p>' . __( 'Go Premium and our experts will be there for you to answer any questions you might have about the set-up and use of the plug-in!', 'wordpress-seo' ) . '</p>';
|
||||
/* translators: %1$s: expands to 'Yoast SEO Premium'. */
|
||||
$popup_content .= '<p>' . sprintf( __( 'Other benefits of %1$s for you:', 'wordpress-seo' ), 'Yoast SEO Premium' ) . '</p>';
|
||||
$popup_content .= '<ul>';
|
||||
$popup_content .= '<li>' . sprintf(
|
||||
// We don't use strong text here, but we do use it in the "Add keyword" popup, this is just to have the same translatable strings.
|
||||
/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
|
||||
__( '%1$sNo more dead links%2$s: easy redirect manager', 'wordpress-seo' ), '', ''
|
||||
) . '</li>';
|
||||
$popup_content .= '<li>' . __( 'Superfast internal links suggestions', 'wordpress-seo' ) . '</li>';
|
||||
$popup_content .= '<li>' . sprintf(
|
||||
// We don't use strong text here, but we do use it in the "Add keyword" popup, this is just to have the same translatable strings.
|
||||
/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
|
||||
__( '%1$sSocial media preview%2$s: Facebook & Twitter', 'wordpress-seo' ), '', ''
|
||||
) . '</li>';
|
||||
$popup_content .= '<li>' . __( '24/7 support', 'wordpress-seo' ) . '</li>';
|
||||
$popup_content .= '<li>' . __( 'No ads!', 'wordpress-seo' ) . '</li>';
|
||||
$popup_content .= '</ul>';
|
||||
|
||||
$premium_popup = new WPSEO_Premium_Popup( 'contact-support', 'h2', $popup_title, $popup_content );
|
||||
$contact_support_help_center_item = new WPSEO_Help_Center_Item(
|
||||
|
||||
@@ -208,9 +208,9 @@ class WPSEO_Plugin_Availability {
|
||||
public function get_installed_plugins() {
|
||||
$installed = array();
|
||||
|
||||
foreach ( $this->plugins as $pluginKey => $plugin ) {
|
||||
foreach ( $this->plugins as $plugin_key => $plugin ) {
|
||||
if ( $this->is_installed( $plugin ) ) {
|
||||
$installed[ $pluginKey ] = $plugin;
|
||||
$installed[ $plugin_key ] = $plugin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,12 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
||||
'rps-sitemap-generator/rps-sitemap-generator.php',
|
||||
// RPS Sitemap Generator (redpixelstudios).
|
||||
),
|
||||
'cloaking' => array(
|
||||
'rs-head-cleaner/rs-head-cleaner.php',
|
||||
// RS Head Cleaner Plus https://wordpress.org/plugins/rs-head-cleaner/.
|
||||
'rs-head-cleaner-lite/rs-head-cleaner-lite.php',
|
||||
// RS Head Cleaner Lite https://wordpress.org/plugins/rs-head-cleaner-lite/.
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -129,11 +135,11 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
||||
// Only check for open graph problems when they are enabled.
|
||||
$social_options = WPSEO_Options::get_option( 'wpseo_social' );
|
||||
if ( $social_options['opengraph'] ) {
|
||||
/* translators: %1$s expands to Yoast SEO, %2%s: 'Facebook' plugin name of possibly conflicting plugin with regard to creating OpenGraph output*/
|
||||
/* translators: %1$s expands to Yoast SEO, %2%s: 'Facebook' plugin name of possibly conflicting plugin with regard to creating OpenGraph output. */
|
||||
$plugin_sections['open_graph'] = __( 'Both %1$s and %2$s create OpenGraph output, which might make Facebook, Twitter, LinkedIn and other social networks use the wrong texts and images when your pages are being shared.', 'wordpress-seo' )
|
||||
. '<br/><br/>'
|
||||
. '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_social#top#facebook' ) . '">'
|
||||
/* translators: %1$s expands to Yoast SEO */
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
. sprintf( __( 'Configure %1$s\'s OpenGraph settings', 'wordpress-seo' ), 'Yoast SEO' )
|
||||
. '</a>';
|
||||
}
|
||||
@@ -141,15 +147,18 @@ class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
|
||||
// Only check for XML conflicts if sitemaps are enabled.
|
||||
$xml_sitemap_options = WPSEO_Options::get_option( 'wpseo_xml' );
|
||||
if ( $xml_sitemap_options['enablexmlsitemap'] ) {
|
||||
/* translators: %1$s expands to Yoast SEO, %2$s: 'Google XML Sitemaps' plugin name of possibly conflicting plugin with regard to the creation of sitemaps*/
|
||||
/* translators: %1$s expands to Yoast SEO, %2$s: 'Google XML Sitemaps' plugin name of possibly conflicting plugin with regard to the creation of sitemaps. */
|
||||
$plugin_sections['xml_sitemaps'] = __( 'Both %1$s and %2$s can create XML sitemaps. Having two XML sitemaps is not beneficial for search engines, yet might slow down your site.', 'wordpress-seo' )
|
||||
. '<br/><br/>'
|
||||
. '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_xml' ) . '">'
|
||||
/* translators: %1$s expands to Yoast SEO */
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
. sprintf( __( 'Configure %1$s\'s XML Sitemap settings', 'wordpress-seo' ), 'Yoast SEO' )
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
/* translators: %2$s expands to 'RS Head Cleaner' plugin name of possibly conflicting plugin with regard to differentiating output between search engines and normal users. */
|
||||
$plugin_sections['cloaking'] = __( 'The plugin %2$s changes your site\'s output and in doing that differentiates between search engines and normal users, a process that\'s called cloaking. We highly recommend that you disable it.', 'wordpress-seo' );
|
||||
|
||||
$instance->check_plugin_conflicts( $plugin_sections );
|
||||
}
|
||||
}
|
||||
@@ -64,21 +64,23 @@ class WPSEO_Premium_Popup {
|
||||
}
|
||||
|
||||
$assets_uri = trailingslashit( plugin_dir_url( WPSEO_FILE ) );
|
||||
$premium_uri = 'https://yoa.st/contact-support';
|
||||
$premium_uri = WPSEO_Shortlinker::get( 'https://yoa.st/contact-support' );
|
||||
|
||||
/* translators: %s expands to Yoast SEO Premium */
|
||||
$cta_text = sprintf( __( 'Buy %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
||||
$cta_text = sprintf( __( 'Get %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
||||
$classes = '';
|
||||
if ( $popup ) {
|
||||
$classes = ' hidden';
|
||||
}
|
||||
$micro_copy = __( '1 year free updates and upgrades included!', 'wordpress-seo' );
|
||||
|
||||
$popup = <<<EO_POPUP
|
||||
<div id="wpseo-{$this->identifier}-popup" class="wpseo-premium-popup wp-clearfix$classes">
|
||||
<img class="alignright wpseo-premium-popup-icon" src="{$assets_uri}images/Yoast_SEO_Icon.svg" width="150" height="150" alt="Yoast SEO"/>
|
||||
<{$this->heading_level} id="wpseo-contact-support-popup-title" class="wpseo-premium-popup-title">{$this->title}</{$this->heading_level}>
|
||||
<p>{$this->content}</p>
|
||||
<a id="wpseo-{$this->identifier}-popup-button" class="button button-primary" href="{$premium_uri}">{$cta_text}</a>
|
||||
{$this->content}
|
||||
<a id="wpseo-{$this->identifier}-popup-button" class="button button-primary" href="{$premium_uri}">{$cta_text}</a><br/>
|
||||
<small>{$micro_copy}</small>
|
||||
</div>
|
||||
EO_POPUP;
|
||||
|
||||
|
||||
@@ -76,18 +76,18 @@ class WPSEO_Primary_Term_Admin {
|
||||
/**
|
||||
* Saves all selected primary terms
|
||||
*
|
||||
* @param int $post_ID Post ID to save primary terms for.
|
||||
* @param int $post_id Post ID to save primary terms for.
|
||||
*/
|
||||
public function save_primary_terms( $post_ID ) {
|
||||
public function save_primary_terms( $post_id ) {
|
||||
// Bail if this is a multisite installation and the site has been switched.
|
||||
if ( is_multisite() && ms_is_switched() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$taxonomies = $this->get_primary_term_taxonomies( $post_ID );
|
||||
$taxonomies = $this->get_primary_term_taxonomies( $post_id );
|
||||
|
||||
foreach ( $taxonomies as $taxonomy ) {
|
||||
$this->save_primary_term( $post_ID, $taxonomy );
|
||||
$this->save_primary_term( $post_id, $taxonomy );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,22 +108,22 @@ class WPSEO_Primary_Term_Admin {
|
||||
/**
|
||||
* Returns all the taxonomies for which the primary term selection is enabled
|
||||
*
|
||||
* @param int $post_ID Default current post ID.
|
||||
* @param int $post_id Default current post ID.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_primary_term_taxonomies( $post_ID = null ) {
|
||||
protected function get_primary_term_taxonomies( $post_id = null ) {
|
||||
|
||||
if ( null === $post_ID ) {
|
||||
$post_ID = $this->get_current_id();
|
||||
if ( null === $post_id ) {
|
||||
$post_id = $this->get_current_id();
|
||||
}
|
||||
|
||||
if ( false !== ( $taxonomies = wp_cache_get( 'primary_term_taxonomies_' . $post_ID, 'wpseo' ) ) ) {
|
||||
if ( false !== ( $taxonomies = wp_cache_get( 'primary_term_taxonomies_' . $post_id, 'wpseo' ) ) ) {
|
||||
return $taxonomies;
|
||||
}
|
||||
|
||||
$taxonomies = $this->generate_primary_term_taxonomies( $post_ID );
|
||||
$taxonomies = $this->generate_primary_term_taxonomies( $post_id );
|
||||
|
||||
wp_cache_set( 'primary_term_taxonomies_' . $post_ID, $taxonomies, 'wpseo' );
|
||||
wp_cache_set( 'primary_term_taxonomies_' . $post_id, $taxonomies, 'wpseo' );
|
||||
|
||||
return $taxonomies;
|
||||
}
|
||||
@@ -138,15 +138,15 @@ class WPSEO_Primary_Term_Admin {
|
||||
/**
|
||||
* Save the primary term for a specific taxonomy
|
||||
*
|
||||
* @param int $post_ID Post ID to save primary term for.
|
||||
* @param int $post_id Post ID to save primary term for.
|
||||
* @param WP_Term $taxonomy Taxonomy to save primary term for.
|
||||
*/
|
||||
protected function save_primary_term( $post_ID, $taxonomy ) {
|
||||
protected function save_primary_term( $post_id, $taxonomy ) {
|
||||
$primary_term = filter_input( INPUT_POST, WPSEO_Meta::$form_prefix . 'primary_' . $taxonomy->name . '_term', FILTER_SANITIZE_NUMBER_INT );
|
||||
|
||||
// We accept an empty string here because we need to save that if no terms are selected.
|
||||
if ( null !== $primary_term && check_admin_referer( 'save-primary-term', WPSEO_Meta::$form_prefix . 'primary_' . $taxonomy->name . '_nonce' ) ) {
|
||||
$primary_term_object = new WPSEO_Primary_Term( $taxonomy->name, $post_ID );
|
||||
$primary_term_object = new WPSEO_Primary_Term( $taxonomy->name, $post_id );
|
||||
$primary_term_object->set_primary_term( $primary_term );
|
||||
}
|
||||
}
|
||||
@@ -154,12 +154,12 @@ class WPSEO_Primary_Term_Admin {
|
||||
/**
|
||||
* Generate the primary term taxonomies.
|
||||
*
|
||||
* @param int $post_ID ID of the post.
|
||||
* @param int $post_id ID of the post.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function generate_primary_term_taxonomies( $post_ID ) {
|
||||
$post_type = get_post_type( $post_ID );
|
||||
protected function generate_primary_term_taxonomies( $post_id ) {
|
||||
$post_type = get_post_type( $post_id );
|
||||
$all_taxonomies = get_object_taxonomies( $post_type, 'objects' );
|
||||
$all_taxonomies = array_filter( $all_taxonomies, array( $this, 'filter_hierarchical_taxonomies' ) );
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class WPSEO_Product_Upsell_Notice {
|
||||
return sprintf(
|
||||
/* translators: %1$s expands anchor to premium plugin page, %2$s expands to </a> */
|
||||
__( 'By the way, did you know we also have a %1$sPremium plugin%2$s? It offers advanced features, like a redirect manager and support for multiple keywords. It also comes with 24/7 personal support.' , 'wordpress-seo' ),
|
||||
"<a href='https://yoa.st/premium-notification'>",
|
||||
"<a href='" . WPSEO_Shortlinker::get( 'https://yoa.st/premium-notification' ) . "'>",
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
@@ -134,14 +134,14 @@ class WPSEO_Product_Upsell_Notice {
|
||||
/* translators: %1$s expands to Yoast SEO, %2$s is a link start tag to the plugin page on WordPress.org, %3$s is the link closing tag. */
|
||||
__( 'We\'ve noticed you\'ve been using %1$s for some time now; we hope you love it! We\'d be thrilled if you could %2$sgive us a 5 stars rating on WordPress.org%3$s!', 'wordpress-seo' ),
|
||||
'Yoast SEO',
|
||||
'<a href="https://yoa.st/rate-yoast-seo">',
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/rate-yoast-seo' ) . '">',
|
||||
'</a>'
|
||||
) . "\n\n";
|
||||
|
||||
$message .= sprintf(
|
||||
/* translators: %1$s is a link start tag to the bugreport guidelines on the Yoast knowledge base, %2$s is the link closing tag. */
|
||||
__( 'If you are experiencing issues, %1$splease file a bug report%2$s and we\'ll do our best to help you out.', 'wordpress-seo' ),
|
||||
'<a href="https://yoa.st/bugreport">',
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/bugreport' ) . '">',
|
||||
'</a>'
|
||||
) . "\n\n";
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ class Yoast_Social_Facebook_Form {
|
||||
);
|
||||
echo ' ';
|
||||
/* translators: %1$s and %2$s expand to a link to the Yoast Knowledge Base */
|
||||
printf( __( 'More info can be found %1$son our knowledge base%2$s.', 'wordpress-seo' ), '<a target="_blank" href="https://yoa.st/facebook-insights">', '</a>' );
|
||||
printf( __( 'More info can be found %1$son our knowledge base%2$s.', 'wordpress-seo' ), '<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/facebook-insights' ) . '">', '</a>' );
|
||||
echo '</p>';
|
||||
|
||||
return $this;
|
||||
@@ -316,7 +316,7 @@ class Yoast_Social_Facebook_Form {
|
||||
echo '</p>';
|
||||
echo '<p>';
|
||||
/* translators: %1$s and %2$s expand to a link to the Yoast Knowledge Base */
|
||||
printf( __( 'If you don\'t know where to find the needed ID, see %1$sthis knowledge base article%2$s.', 'wordpress-seo' ), '<a target="_blank" href="https://yoa.st/facebook-insights">', '</a>' );
|
||||
printf( __( 'If you don\'t know where to find the needed ID, see %1$sthis knowledge base article%2$s.', 'wordpress-seo' ), '<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/facebook-insights' ) . '">', '</a>' );
|
||||
echo '</p>';
|
||||
echo '<div class="form-field form-required">';
|
||||
echo '<label for="fb_admin_name">' . __( 'Admin\'s name:', 'wordpress-seo' ) . '</label>';
|
||||
@@ -434,7 +434,7 @@ class Yoast_Social_Facebook_Form {
|
||||
)
|
||||
);
|
||||
|
||||
$this->buttons[] = '<a title="' . esc_attr( $args['title'] ) . '" id="' . esc_attr( $args['id'] ) . '" class="button' . ' ' . esc_attr( $args['class'] ) . '" href="' . esc_url( $args['url'] ) . '">' . esc_html( $args['value'] ) . '</a>';
|
||||
$this->buttons[] = '<a title="' . esc_attr( $args['title'] ) . '" id="' . esc_attr( $args['id'] ) . '" class="button ' . esc_attr( $args['class'] ) . '" href="' . esc_url( $args['url'] ) . '">' . esc_html( $args['value'] ) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,7 +118,7 @@ class Yoast_Form {
|
||||
*/
|
||||
public function admin_footer( $submit = true, $show_sidebar = true ) {
|
||||
if ( $submit ) {
|
||||
submit_button();
|
||||
submit_button( __( 'Save changes', 'wordpress-seo' ) );
|
||||
|
||||
echo '
|
||||
</form>';
|
||||
@@ -186,7 +186,7 @@ class Yoast_Form {
|
||||
$banner_renderer = new WPSEO_Admin_Banner_Renderer;
|
||||
$banner_renderer->set_base_path( plugins_url( 'images/banner/', WPSEO_FILE ) );
|
||||
|
||||
$sidebar = new WPSEO_Admin_Banner_Sidebar( sprintf( '%1s recommendations', 'Yoast' ), $banner_renderer );
|
||||
$sidebar = new WPSEO_Admin_Banner_Sidebar( sprintf( '%1s recommendations for you', 'Yoast' ), $banner_renderer );
|
||||
$sidebar->initialize( new WPSEO_Features() );
|
||||
|
||||
echo $sidebar_renderer->render( $sidebar );
|
||||
@@ -364,7 +364,7 @@ class Yoast_Form {
|
||||
$val = ( isset( $this->options[ $var ] ) ) ? $this->options[ $var ] : '';
|
||||
|
||||
$this->label( $label . ':', array( 'for' => $var, 'class' => 'textinput' ) );
|
||||
echo '<textarea cols="' . esc_attr( $attr['cols'] ) . '" rows="' . esc_attr( $attr['rows'] ) . '" class="textinput ' . esc_attr( $attr['class'] ) . '" id="' . esc_attr( $var ) . '" name="' . esc_attr( $this->option_name ) . '[' . esc_attr( $var ) . ']">' . esc_textarea( $val ) . '</textarea>' . '<br class="clear" />';
|
||||
echo '<textarea cols="' . esc_attr( $attr['cols'] ) . '" rows="' . esc_attr( $attr['rows'] ) . '" class="textinput ' . esc_attr( $attr['class'] ) . '" id="' . esc_attr( $var ) . '" name="' . esc_attr( $this->option_name ) . '[' . esc_attr( $var ) . ']">' . esc_textarea( $val ) . '</textarea><br class="clear" />';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -543,188 +543,4 @@ class Yoast_Form {
|
||||
|
||||
echo '<a></a></div></fieldset><div class="clear"></div></div>' . "\n\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns two random selected service banners.
|
||||
*
|
||||
* @since 3.9
|
||||
*
|
||||
* @return WPSEO_Admin_Banner_Spot
|
||||
*/
|
||||
private function get_service_banners() {
|
||||
|
||||
$service_banner_spot = new WPSEO_Admin_Banner_Spot(
|
||||
__( 'Services', 'wordpress-seo' ),
|
||||
sprintf(
|
||||
/* translators: %1$s expands to a link start tag to the Yoast Services page, %2$s to Yoast, %3$s is the link closing tag. */
|
||||
__( 'Don\'t want to dive into SEO yourself? %1$sLet team %2$s help you!%3$s', 'wordpress-seo' ),
|
||||
'<a href="https://yoa.st/">',
|
||||
'Yoast',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
|
||||
$service_banner_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/hire-us/website-review/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=website-review-banner',
|
||||
'banner-website-review.png',
|
||||
261,
|
||||
190,
|
||||
__( 'Order a Website Review and we will tell you what to improve to attract more visitors!', 'wordpress-seo' )
|
||||
)
|
||||
);
|
||||
|
||||
$service_banner_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/hire-us/yoast-seo-configuration/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=configuration-service-banner',
|
||||
'banner-configuration-service.png',
|
||||
261,
|
||||
190,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO Premium. */
|
||||
__( 'Let our experts set up your %1$s plugin!', 'wordpress-seo' ),
|
||||
'Yoast SEO Premium'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$service_banner_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/academy/course/seo-copywriting-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=seo-copywriting-training-banner',
|
||||
'banner-seo-copywriting-training.png',
|
||||
261,
|
||||
190,
|
||||
__( 'Take the online SEO Copywriting Training course and learn how to write awesome copy that ranks!', 'wordpress-seo' )
|
||||
)
|
||||
);
|
||||
|
||||
$service_banner_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/academy/course/basic-seo-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=basic-seo-training-banner',
|
||||
'banner-basic-seo-training.png',
|
||||
261,
|
||||
190,
|
||||
__( 'Take the online Basic SEO Training course and learn the fundamentals of SEO!', 'wordpress-seo' )
|
||||
)
|
||||
);
|
||||
|
||||
$service_banner_spot->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/academy/course/yoast-seo-wordpress-training/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=yoast-seo-plugin-training-banner',
|
||||
'banner-yoast-seo-for-wordpress-training.png',
|
||||
261,
|
||||
190,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO for WordPress Training, %2$s to Yoast SEO for WordPress. */
|
||||
__( 'Take the %1$s course and become a certified %2$s expert!', 'wordpress-seo' ),
|
||||
'Yoast SEO for WordPress Training',
|
||||
'Yoast SEO for WordPress'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return $service_banner_spot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns two random selected plugin banners.
|
||||
*
|
||||
* @since 3.9
|
||||
*
|
||||
* @return WPSEO_Admin_Banner_Spot
|
||||
*/
|
||||
private function get_plugin_banners() {
|
||||
|
||||
$plugin_banners = new WPSEO_Admin_Banner_Spot(
|
||||
__( 'Extensions', 'wordpress-seo' ),
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO, %2$s to a link start tag to the Yoast plugin page, %3$s is the link closing tag. */
|
||||
__( 'Extend your %1$s plugin with our %2$sSEO plugins%3$s.', 'wordpress-seo' ),
|
||||
'Yoast SEO',
|
||||
'<a href="https://yoa.st/">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$plugin_banners->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=premium-seo-banner',
|
||||
'banner-premium-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO Premium. */
|
||||
__( 'Buy the %1$s plugin now and get access to extra features and 24/7 support!', 'wordpress-seo' ),
|
||||
'Yoast SEO Premium'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if ( ! class_exists( 'wpseo_Video_Sitemap' ) ) {
|
||||
$plugin_banners->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/wordpress/plugins/video-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=video-seo-banner',
|
||||
'banner-video-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast Video SEO. */
|
||||
__( 'Buy the %1$s plugin now and optimize your videos for video search results and social media!', 'wordpress-seo' ),
|
||||
'Yoast Video SEO'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( class_exists( 'Woocommerce' ) && ! class_exists( 'Yoast_WooCommerce_SEO' ) ) {
|
||||
$plugin_banners->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=woocommerce-seo-banner',
|
||||
'banner-woocommerce-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast WooCommerce SEO. */
|
||||
__( 'Buy the %1$s plugin now and optimize your shop today to improve your product promotion!', 'wordpress-seo' ),
|
||||
'Yoast WooCommerce SEO'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! defined( 'WPSEO_LOCAL_VERSION' ) ) {
|
||||
$plugin_banners->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/wordpress/plugins/local-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=local-seo-banner',
|
||||
'banner-local-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast Local SEO. */
|
||||
__( 'Buy the %1$s plugin now to improve your site’s Local SEO and ranking in Google Maps!', 'wordpress-seo' ),
|
||||
'Yoast Local SEO'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WPSEO_News' ) ) {
|
||||
$plugin_banners->add_banner(
|
||||
new WPSEO_Admin_Banner(
|
||||
'https://yoast.com/wordpress/plugins/news-seo/#utm_source=wordpress-seo-config&utm_medium=banner&utm_campaign=news-seo-banner',
|
||||
'banner-news-seo.png',
|
||||
261,
|
||||
152,
|
||||
sprintf(
|
||||
/* translators: %1$s expands to Yoast News SEO. */
|
||||
__( 'Buy the %1$s plugin now and start optimizing to get your site featured in Google News!', 'wordpress-seo' ),
|
||||
'Yoast News SEO'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $plugin_banners;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ class WPSEO_Configuration_Components {
|
||||
public function initialize() {
|
||||
$this->add_component( new WPSEO_Config_Component_Connect_Google_Search_Console() );
|
||||
$this->add_component( new WPSEO_Config_Component_Mailchimp_Signup() );
|
||||
$this->add_component( new WPSEO_Config_Component_Configuration_Choices() );
|
||||
$this->add_component( new WPSEO_Config_Component_Suggestions() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ class WPSEO_Configuration_Page {
|
||||
*/
|
||||
public function catch_configuration_request() {
|
||||
$configuration_page = filter_input( INPUT_GET, 'configuration' );
|
||||
$page = filter_input( INPUT_GET, 'page' );
|
||||
$page = filter_input( INPUT_GET, 'page' );
|
||||
|
||||
if ( ! ( $configuration_page === 'finished' && ( $page === WPSEO_Admin::PAGE_IDENTIFIER ) ) ) {
|
||||
return;
|
||||
@@ -74,10 +74,10 @@ class WPSEO_Configuration_Page {
|
||||
* it's easier to override selectors with the same specificity later.
|
||||
*/
|
||||
wp_enqueue_style( 'forms' );
|
||||
$assetManager = new WPSEO_Admin_Asset_Manager();
|
||||
$assetManager->register_assets();
|
||||
$assetManager->enqueue_script( 'configuration-wizard' );
|
||||
$assetManager->enqueue_style( 'yoast-components' );
|
||||
$asset_manager = new WPSEO_Admin_Asset_Manager();
|
||||
$asset_manager->register_assets();
|
||||
$asset_manager->enqueue_script( 'configuration-wizard' );
|
||||
$asset_manager->enqueue_style( 'yoast-components' );
|
||||
|
||||
$config = $this->get_config();
|
||||
|
||||
@@ -161,8 +161,8 @@ class WPSEO_Configuration_Page {
|
||||
*/
|
||||
public function get_config() {
|
||||
$translations = $this->get_translations();
|
||||
$service = new WPSEO_GSC_Service();
|
||||
$config = array(
|
||||
$service = new WPSEO_GSC_Service();
|
||||
$config = array(
|
||||
'namespace' => WPSEO_Configuration_Endpoint::REST_NAMESPACE,
|
||||
'endpoint_retrieve' => WPSEO_Configuration_Endpoint::ENDPOINT_RETRIEVE,
|
||||
'endpoint_store' => WPSEO_Configuration_Endpoint::ENDPOINT_STORE,
|
||||
@@ -215,8 +215,11 @@ class WPSEO_Configuration_Page {
|
||||
* @return Yoast_Notification
|
||||
*/
|
||||
private static function get_notification() {
|
||||
$message = sprintf(
|
||||
__( 'Since you are new to %1$s you can configure the %2$splugin%3$s', 'wordpress-seo' ),
|
||||
$message = __( 'The configuration wizard helps you to easily configure your site to have the optimal SEO settings.', 'wordpress-seo' );
|
||||
$message .= '<br/>';
|
||||
$message .= sprintf(
|
||||
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to the starting tag of the link to the wizard, %3$s resolves to the closing link tag */
|
||||
__( 'We have detected that you have not finished this wizard yet, so we recommend you to %2$sstart the configuration wizard to configure %1$s%3$s.', 'wordpress-seo' ),
|
||||
'Yoast SEO',
|
||||
'<a href="' . admin_url( '?page=' . self::PAGE_IDENTIFIER ) . '">',
|
||||
'</a>'
|
||||
|
||||
+14
-8
@@ -17,9 +17,9 @@ class WPSEO_Configuration_Structure {
|
||||
public function __construct() {
|
||||
|
||||
$this->add_step( 'intro', __( 'Welcome!', 'wordpress-seo' ), array(
|
||||
'upsellConfigurationService',
|
||||
'mailchimpSignup',
|
||||
) );
|
||||
'configurationChoices',
|
||||
), false );
|
||||
|
||||
$this->add_step( 'environment_type', __( 'Environment', 'wordpress-seo' ), array( 'environment_type' ) );
|
||||
$this->add_step( 'siteType', __( 'Site type', 'wordpress-seo' ), array( 'siteType' ) );
|
||||
$this->add_step( 'publishingEntity', __( 'Company or person', 'wordpress-seo' ), array(
|
||||
@@ -55,10 +55,14 @@ class WPSEO_Configuration_Structure {
|
||||
'siteName',
|
||||
'separator',
|
||||
) );
|
||||
$this->add_step( 'newsletter', __( 'Newsletter' ), array(
|
||||
'mailchimpSignup',
|
||||
) );
|
||||
$this->add_step( 'suggestions', __( 'You might like', 'wordpress-seo' ), array(
|
||||
'suggestions'
|
||||
) );
|
||||
$this->add_step( 'success', __( 'Success!', 'wordpress-seo' ), array(
|
||||
'successMessage',
|
||||
'upsellSiteReview',
|
||||
'mailchimpSignup',
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -68,11 +72,13 @@ class WPSEO_Configuration_Structure {
|
||||
* @param string $identifier Identifier for this step.
|
||||
* @param string $title Title to display for this step.
|
||||
* @param array $fields Fields to use on the step.
|
||||
* @param bool $navigation Show navigation buttons.
|
||||
*/
|
||||
protected function add_step( $identifier, $title, $fields ) {
|
||||
protected function add_step( $identifier, $title, $fields, $navigation = true ) {
|
||||
$this->steps[ $identifier ] = array(
|
||||
'title' => $title,
|
||||
'fields' => $fields,
|
||||
'title' => $title,
|
||||
'fields' => $fields,
|
||||
'hideNavigation' => ! (bool) $navigation,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin\ConfigurationUI
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents the configuration choices component.
|
||||
*/
|
||||
class WPSEO_Config_Component_Configuration_Choices implements WPSEO_Config_Component {
|
||||
|
||||
/**
|
||||
* Gets the component identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_identifier() {
|
||||
return 'ConfigurationChoices';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the field.
|
||||
*
|
||||
* @return WPSEO_Config_Field
|
||||
*/
|
||||
public function get_field() {
|
||||
$field = new WPSEO_Config_Field_Configuration_Choices();
|
||||
|
||||
$field->set_property( 'label', sprintf(
|
||||
/* translators: %s expands to 'Yoast SEO'. */
|
||||
__( 'Please choose the %s configuration of your liking:', 'wordpress-seo' ), 'Yoast SEO' )
|
||||
);
|
||||
|
||||
$field->add_choice(
|
||||
sprintf(
|
||||
/* translators: %s expands to 'Yoast SEO'. */
|
||||
__( 'Configure %s in a few steps', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
),
|
||||
sprintf(
|
||||
/* translators: %1$s expands to 'Yoast SEO'. */
|
||||
__( 'Welcome to the %1$s configuration wizard. In a few simple steps we\'ll help you configure your SEO settings to match your website\'s needs! %1$s will take care of all the technical optimizations your site needs.', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
),
|
||||
array(
|
||||
'type' => 'primary',
|
||||
'label' => sprintf(
|
||||
/* translators: %s expands to 'Yoast SEO'. */
|
||||
__( 'Configure %s', 'wordpress-seo' ), 'Yoast SEO'
|
||||
),
|
||||
'action' => 'nextStep',
|
||||
),
|
||||
plugin_dir_url( WPSEO_FILE ) . '/images/Yoast_SEO_Icon.svg'
|
||||
);
|
||||
$field->add_choice(
|
||||
sprintf(
|
||||
/* translators: %s expands to 'Yoast SEO'. */
|
||||
__( 'Let us set up %s for you', 'wordpress-seo' ), 'Yoast SEO'
|
||||
),
|
||||
sprintf(
|
||||
/* translators: %1$s expands to 'Yoast SEO', %2$s expands to 'Yoast SEO Premium'. */
|
||||
__( 'While we strive to make setting up %1$s as easy as possible, we understand it can still be daunting. If you would rather have us set up %1$s for you (and get a copy of %2$s in the process), order a %1$s configuration service and sit back while we configure your site.', 'wordpress-seo' ),
|
||||
'Yoast SEO',
|
||||
'Yoast SEO Premium'
|
||||
),
|
||||
array(
|
||||
'type' => 'secondary',
|
||||
'label' => __( 'Configuration service', 'wordpress-seo' ),
|
||||
'action' => 'followURL',
|
||||
'url' => 'https://yoa.st/wizard-configuration-upsell',
|
||||
),
|
||||
plugin_dir_url( WPSEO_FILE ) . 'images/yoast-configuration-icon.svg'
|
||||
);
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data for the field.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save data
|
||||
*
|
||||
* @param array $data Data containing changes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set_data( $data ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -131,8 +131,8 @@ class WPSEO_Config_Component_Connect_Google_Search_Console implements WPSEO_Conf
|
||||
protected function get_profilelist() {
|
||||
$profiles = array();
|
||||
$sites = $this->gsc_service->get_sites();
|
||||
foreach ( $sites as $siteKey => $siteValue ) {
|
||||
$profiles[ untrailingslashit( $siteKey ) ] = untrailingslashit( $siteValue );
|
||||
foreach ( $sites as $site_key => $site_value ) {
|
||||
$profiles[ untrailingslashit( $site_key ) ] = untrailingslashit( $site_value );
|
||||
}
|
||||
|
||||
return $profiles;
|
||||
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin\ConfigurationUI
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents the configuration suggestions component.
|
||||
*/
|
||||
class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
|
||||
|
||||
/**
|
||||
* Gets the component identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_identifier() {
|
||||
return 'Suggestions';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the field.
|
||||
*
|
||||
* @return WPSEO_Config_Field
|
||||
*/
|
||||
public function get_field() {
|
||||
$field = new WPSEO_Config_Field_Suggestions();
|
||||
|
||||
// Only show Premium upsell when we are not inside a Premium install.
|
||||
if ( ! defined( 'WPSEO_PREMIUM_PLUGIN_FILE' ) ) {
|
||||
$field->add_suggestion(
|
||||
/* translators: %s resolves to Yoast SEO Premium */
|
||||
sprintf( __( 'Outrank the competition with %s', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
||||
/* translators: %1$s resolves to Yoast SEO Premium */
|
||||
sprintf( __( 'Do you want to outrank your competition? %1$s gives you awesome additional features that\'ll help you to set up your SEO strategy like a professional. Use the multiple focus keywords functionality, the redirect manager and our internal linking tool. %1$s will also give you access to premium support.', 'wordpress-seo' ), 'Yoast SEO Premium' ),
|
||||
array(
|
||||
'label' => __( 'Upgrade to Premium', 'wordpress-seo' ),
|
||||
'type' => 'primary',
|
||||
'url' => 'https://yoa.st/wizard-suggestion-premium',
|
||||
),
|
||||
'https://yoa.st/video-yoast-seo-premium'
|
||||
);
|
||||
}
|
||||
|
||||
$field->add_suggestion(
|
||||
__( 'Learn how to write copy that ranks', 'wordpress-seo' ),
|
||||
/* translators: %1$s resolves to SEO copywriting training */
|
||||
sprintf( __( 'Do you want to learn how to write content that generates traffic? Check out our %1$s. We will help you to write awesome copy that will rank in the search engines. The %1$s covers all the main steps in SEO copywriting: from keyword research to publishing.', 'wordpress-seo' ), 'SEO copywriting training' ),
|
||||
array(
|
||||
'label' => 'SEO copywriting training',
|
||||
'type' => 'link',
|
||||
'url' => 'https://yoa.st/configuration-wizard-copywrite-course-link',
|
||||
),
|
||||
'https://yoa.st/video-course-copywriting'
|
||||
);
|
||||
|
||||
$field->add_suggestion(
|
||||
/* translators: %1$s resolves to Yoast SEO, %2$s resolves to Yoast SEO plugin training */
|
||||
sprintf( __( 'Get the most out of %1$s with the %2$s', 'wordpress-seo' ), 'Yoast SEO', 'Yoast SEO plugin training' ),
|
||||
/* translators: %1$s resolves to Yoast SEO */
|
||||
sprintf( __( 'Do you want to know all the ins and outs of the %1$s plugin? Do you want to learn all about our advanced settings? Want to be able to really get the most out of the %1$s plugin? Check out our %1$s plugin training and start outranking the competition!', 'wordpress-seo' ), 'Yoast SEO' ),
|
||||
array(
|
||||
'label' => 'Yoast SEO plugin training',
|
||||
'type' => 'link',
|
||||
'url' => 'https://yoa.st/wizard-suggestion-plugin-course',
|
||||
),
|
||||
'https://yoa.st/video-plugin-course'
|
||||
);
|
||||
|
||||
// When we are running in Yoast SEO Premium and don't have Local SEO installed, show Local SEO as suggestion.
|
||||
if ( defined( 'WPSEO_PREMIUM_PLUGIN_FILE' ) && ! defined( 'WPSEO_LOCAL_FILE' ) ) {
|
||||
$field->add_suggestion(
|
||||
sprintf( __( 'Attract more customers near you', 'wordpress-seo' ), 'Yoast SEO', 'Yoast SEO plugin training' ),
|
||||
/* translators: %1$s resolves to Local SEO */
|
||||
sprintf( __( 'If you want to outrank the competition in a specific town or region, check out our %1$s plugin! You’ll be able to easily insert Google maps, opening hours, contact information and a store locator. Besides that %1$s helps you to improve the usability of your contact page.', 'wordpress-seo' ), 'Local SEO' ),
|
||||
array(
|
||||
'label' => 'Local SEO',
|
||||
'type' => 'link',
|
||||
'url' => 'https://yoa.st/wizard-suggestion-localseo',
|
||||
),
|
||||
'https://yoa.st/video-localseo'
|
||||
);
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data for the field.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save data
|
||||
*
|
||||
* @param array $data Data containing changes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set_data( $data ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -59,9 +59,9 @@ class WPSEO_Config_Field_Choice_Post_Type extends WPSEO_Config_Field_Choice {
|
||||
|
||||
$key = 'post_types-' . $this->get_post_type() . '-not_in_sitemap';
|
||||
|
||||
$storedData = ! isset( $option[ $key ] ) || false === $option[ $key ];
|
||||
$stored_data = ! isset( $option[ $key ] ) || false === $option[ $key ];
|
||||
|
||||
if ( $storedData ) {
|
||||
if ( $stored_data ) {
|
||||
return 'true';
|
||||
}
|
||||
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin\ConfigurationUI
|
||||
*/
|
||||
|
||||
/**
|
||||
* Holds the choices for the Configuration method to be chosen in the first step of the wizard
|
||||
*/
|
||||
class WPSEO_Config_Field_Configuration_Choices extends WPSEO_Config_Field {
|
||||
|
||||
/**
|
||||
* WPSEO_Config_Field_Choice constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct( 'configurationChoices', 'ConfigurationChoices' );
|
||||
|
||||
$this->properties['choices'] = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a choice to the properties
|
||||
*
|
||||
* @param string $title The title of the choice.
|
||||
* @param string $copy The text explaining the choice.
|
||||
* @param array $button The button details.
|
||||
* @param null|string $image The image accompanying the choice.
|
||||
*/
|
||||
public function add_choice( $title, $copy, $button, $image = null ) {
|
||||
$choice = array(
|
||||
'title' => $title,
|
||||
'copy' => $copy,
|
||||
'button' => $button,
|
||||
);
|
||||
|
||||
if ( ! empty( $image ) ) {
|
||||
$choice['image'] = $image;
|
||||
}
|
||||
|
||||
$this->properties['choices'][] = $choice;
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -17,16 +17,18 @@ class WPSEO_Config_Field_Mailchimp_Signup extends WPSEO_Config_Field {
|
||||
$current_user = wp_get_current_user();
|
||||
$user_email = ( $current_user->ID > 0 ) ? $current_user->user_email : '';
|
||||
|
||||
$this->set_property( 'title' , __( 'Newsletter signup', 'wordpress-seo' ) );
|
||||
$this->set_property( 'title' , __( 'Stay up-to-date', 'wordpress-seo' ) );
|
||||
$this->set_property(
|
||||
'label',
|
||||
sprintf(
|
||||
/* translators: %s expands to Yoast SEO. */
|
||||
__( 'If you would like us to keep you up-to-date regarding %s, other plugins by Yoast and major news in the world of SEO, subscribe to our newsletter:', 'wordpress-seo' ),
|
||||
__( 'Your %1$s plugin is now set up. SEO, however, is subject to constant change. Sign up for our newsletter if you would like to keep up-to-date regarding %1$s, other plugins by Yoast and important news in the world of SEO.', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
)
|
||||
);
|
||||
|
||||
$this->set_property( 'decoration', plugin_dir_url( WPSEO_FILE ) . 'images/newsletter-collage.png' );
|
||||
|
||||
$this->set_property( 'mailchimpActionUrl', 'https://yoast.us1.list-manage.com/subscribe/post-json?u=ffa93edfe21752c921f860358&id=972f1c9122' );
|
||||
$this->set_property( 'currentUserEmail', $user_email );
|
||||
$this->set_property( 'userName', trim( $current_user->user_firstname . ' ' . $current_user->user_lastname ) );
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ class WPSEO_Config_Field_Post_Type_Visibility extends WPSEO_Config_Field {
|
||||
|
||||
$copy = __( 'Please specify which of the following public post types you would like Google to see.', 'wordpress-seo' );
|
||||
|
||||
$html = '<p>' . $copy . '</p><br/>';
|
||||
$html = '<p>' . esc_html( $copy ) . '</p><br/>';
|
||||
|
||||
$this->set_property( 'html', $html );
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ class WPSEO_Config_Field_Social_Profiles_Intro extends WPSEO_Config_Field {
|
||||
|
||||
$intro_text = __( 'Please add all your relevant social profiles. We use these to let search engines know about them, and to enhance your social metadata:', 'wordpress-seo' );
|
||||
|
||||
$html = '<p>' . $intro_text . '</p>';
|
||||
$html = '<p>' . esc_html( $intro_text ) . '</p>';
|
||||
|
||||
$this->set_property( 'html', $html );
|
||||
}
|
||||
|
||||
+12
-19
@@ -12,31 +12,24 @@ class WPSEO_Config_Field_Success_Message extends WPSEO_Config_Field {
|
||||
* WPSEO_Config_Field_Success_Message constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct( 'successMessage', 'HTML' );
|
||||
parent::__construct( 'successMessage', 'FinalStep' );
|
||||
|
||||
$success_message = sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
__( 'You've done it! You've set up %1$s, and %1$s will now take care of all the needed technical optimization of your site. To really improve your site's performance in the search results, it's important to start creating content that ranks well for keywords you care about.', 'wordpress-seo' ),
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
__( '%1$s will now take care of all the needed technical optimization of your site. To really improve your site\'s performance in the search results, it\'s important to start creating content that ranks well for keywords you care about. Check out this video in which we explain how to use the %1$s metabox when you edit posts or pages.', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
);
|
||||
$onpage_seo = sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
__( 'Check out the video below in which we explain how to use the %1$s metabox when you edit posts or pages', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
);
|
||||
$content_analysis_video = sprintf(
|
||||
'<iframe width="560" height="315" src="https://yoa.st/metabox-screencast" title="%s" frameborder="0" allowfullscreen></iframe>',
|
||||
sprintf(
|
||||
|
||||
$this->set_property( 'title', 'You\'ve done it!' );
|
||||
$this->set_property( 'message', $success_message );
|
||||
$this->set_property( 'video', array(
|
||||
'url' => 'https://yoa.st/metabox-screencast',
|
||||
'title' => sprintf(
|
||||
/* translators: %1$s expands to Yoast SEO. */
|
||||
__( '%1$s video tutorial', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
__( '%1$s video tutorial', 'wordpress-seo' ),
|
||||
'Yoast SEO'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$html = '<p>' . $success_message . '</p>';
|
||||
$html .= '<p>' . $onpage_seo . '</p>';
|
||||
$html .= '<div class="yoast-video-container-max-width"><div class="yoast-video-container">' . $content_analysis_video . '</div></div>';
|
||||
|
||||
$this->set_property( 'html', $html );
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WPSEO\Admin\ConfigurationUI
|
||||
*/
|
||||
|
||||
/**
|
||||
* Holds the suggestions for the 'You might also like' page in the wizard
|
||||
*/
|
||||
class WPSEO_Config_Field_Suggestions extends WPSEO_Config_Field {
|
||||
|
||||
/**
|
||||
* WPSEO_Config_Field_Suggestions constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct( 'suggestions', 'Suggestions' );
|
||||
|
||||
$this->properties['suggestions'] = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a suggestion to the properties
|
||||
*
|
||||
* @param string $title The title of the choice.
|
||||
* @param string $copy The text explaining the choice.
|
||||
* @param array $button The button details.
|
||||
* @param null|string $video The video accompanying the choice.
|
||||
*/
|
||||
public function add_suggestion( $title, $copy, $button, $video = null ) {
|
||||
$suggestion = array(
|
||||
'title' => $title,
|
||||
'copy' => $copy,
|
||||
'button' => $button,
|
||||
);
|
||||
|
||||
if ( ! empty( $video ) ) {
|
||||
$suggestion['video'] = $video;
|
||||
}
|
||||
|
||||
$this->properties['suggestions'][] = $suggestion;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-3
@@ -25,12 +25,17 @@ class WPSEO_Config_Field_Upsell_Configuration_Service extends WPSEO_Config_Field
|
||||
__( 'While we strive to make setting up %1$s as easy as possible, we understand it can be daunting. If you’d rather have us set up %1$s for you (and get a copy of %2$s in the process), order our %3$s%1$s configuration service%4$s here!', 'wordpress-seo' ),
|
||||
'Yoast SEO',
|
||||
'Yoast SEO Premium',
|
||||
'<a target="_blank" href="https://yoa.st/configuration-package">',
|
||||
'<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/configuration-package' ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
$html = '<p>' . $intro_text . '</p>';
|
||||
$html .= '<p><em>' . $upsell_text . '</em></p>';
|
||||
$html = '<p>' . esc_html( $intro_text ) . '</p>';
|
||||
$html .= '<p><em>' . wp_kses( $upsell_text, array(
|
||||
'a' => array(
|
||||
'target' => array( '_blank' ),
|
||||
'href' => array(),
|
||||
),
|
||||
) ) . '</em></p>';
|
||||
|
||||
|
||||
$this->set_property( 'html', $html );
|
||||
|
||||
+12
-6
@@ -15,15 +15,21 @@ class WPSEO_Config_Field_Upsell_Site_Review extends WPSEO_Config_Field {
|
||||
parent::__construct( 'upsellSiteReview', 'HTML' );
|
||||
|
||||
$upsell_text = sprintf(
|
||||
/* translators: Text between %1$s and %2$s will be a link to a review explanation page. Text between %3$s and %4$s will be a link to an SEO copywriting course page. */
|
||||
__( 'If you want more help creating awesome content, check out our %3$sSEO copywriting course%4$s. Do you want to know all about the features of the plugin, consider doing our %1$Yoast SEO for WordPress training%2$s!', 'wordpress-seo' ),
|
||||
'<a href="https://yoa.st/yoastseotraining" target="_blank">',
|
||||
'</a>',
|
||||
'<a href="https://yoa.st/configuration-wizard-copywrite-course-link" target="_blank">',
|
||||
/* translators: %1$s will be a link to a review explanation page. Text between %2$s and %3$s will be a link to an SEO copywriting course page. */
|
||||
__( 'If you want more help creating awesome content, check out our %2$sSEO copywriting course%3$s. Do you want to know all about the features of the plugin, consider doing our %1$s!', 'wordpress-seo' ),
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/yoastseotraining' ) . '" target="_blank">Yoast SEO for WordPress training</a>',
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/configuration-wizard-copywrite-course-link' ) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
$html = '<p>' . $upsell_text . '</p>';
|
||||
$html = '<p>' .
|
||||
wp_kses( $upsell_text, array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'target' => array( '_blank' ),
|
||||
),
|
||||
) ) .
|
||||
'</p>';
|
||||
|
||||
$this->set_property( 'html', $html );
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class WPSEO_Config_Field {
|
||||
protected $requires = array();
|
||||
|
||||
/** @var array|mixed Value of this field */
|
||||
protected $data;
|
||||
protected $data = array();
|
||||
|
||||
/**
|
||||
* WPSEO_Config_Field constructor.
|
||||
|
||||
@@ -78,6 +78,7 @@ class WPSEO_Metabox_Formatter {
|
||||
'good' => __( 'Good', 'wordpress-seo' ),
|
||||
),
|
||||
),
|
||||
'markdownEnabled' => $this->is_markdown_enabled(),
|
||||
);
|
||||
|
||||
}
|
||||
@@ -97,4 +98,20 @@ class WPSEO_Metabox_Formatter {
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if Jetpack's markdown module is enabled.
|
||||
* Can be extended to work with other plugins that parse markdown in the content.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function is_markdown_enabled() {
|
||||
if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'get_active_modules' ) ) {
|
||||
$active_modules = Jetpack::get_active_modules();
|
||||
|
||||
return in_array( 'markdown', $active_modules );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -29,8 +29,8 @@ else {
|
||||
}
|
||||
|
||||
$tab = new WPSEO_Option_Tab( 'GSC', __( 'Google Search Console', 'wordpress-seo' ), array( 'video_url' => $video_url ) );
|
||||
$GSCHelpCenter = new WPSEO_Help_Center( 'google-search-console', $tab );
|
||||
$GSCHelpCenter->output_help_center();
|
||||
$gsc_help_center = new WPSEO_Help_Center( 'google-search-console', $tab );
|
||||
$gsc_help_center->output_help_center();
|
||||
|
||||
switch ( $platform_tabs->current_tab() ) {
|
||||
case 'settings' :
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ echo sprintf(
|
||||
/* Translators: %1$s: expands to 'Yoast SEO Premium', %2$s: links to Yoast SEO Premium plugin page. */
|
||||
__( 'To be able to create a redirect and fix this issue, you need %1$s. You can buy the plugin, including one year of support and updates, on %2$s.', 'wordpress-seo' ),
|
||||
'Yoast SEO Premium',
|
||||
'<a href="https://yoa.st/redirects" target="_blank">yoast.com</a>'
|
||||
'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/redirects' ) . '" target="_blank">yoast.com</a>'
|
||||
);
|
||||
echo '</p>';
|
||||
echo '<button type="button" class="button wpseo-redirect-close">' . __( 'Close', 'wordpress-seo' ) . '</button>';
|
||||
+23
-9
@@ -21,18 +21,32 @@ class Metabox_Add_Keyword_Tab implements WPSEO_Metabox_Tab {
|
||||
ob_start();
|
||||
?>
|
||||
<li class="wpseo-tab-add-keyword">
|
||||
<button type="button" class="wpseo-add-keyword button">
|
||||
<span aria-hidden="true">+</span>
|
||||
<span class="screen-reader-text"><?php _e( 'Add keyword', 'wordpress-seo' ); ?></span>
|
||||
</button>
|
||||
<button type="button" class="wpseo-add-keyword button">+ <?php _e( 'Add keyword', 'wordpress-seo' ); ?></button>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$popup_title = sprintf( __( 'Multiple focus keywords is a %s feature', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
||||
/* translators: %1$s: expands to 'Yoast SEO Premium', %2$s: links to Yoast SEO Premium plugin page. */
|
||||
$popup_content = sprintf( __( 'To be able to add and analyze multiple keywords for a post or page you need %1$s. You can buy the plugin, including one year of support, updates and upgrades, on %2$s.', 'wordpress-seo' ),
|
||||
'<a href="https://yoast.com/wordpress/plugins/seo-premium/#utm_source=wordpress-seo-metabox&utm_medium=popup&utm_campaign=multiple-keywords">Yoast SEO Premium</a>',
|
||||
'yoast.com' );
|
||||
$popup_title = __( 'Want to add more than one keyword?', 'wordpress-seo' );
|
||||
/* translators: %1$s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
|
||||
$popup_content = '<p>' . sprintf( __( 'Great news: you can, with %1$s!', 'wordpress-seo' ),
|
||||
'<a href="https://yoa.st/pe-premium-page">Yoast SEO Premium</a>'
|
||||
) . '</p>';
|
||||
$popup_content .= '<p>' . sprintf(
|
||||
/* translators: %s expands to 'Yoast SEO Premium'. */
|
||||
__( 'Other benefits of %s for you:', 'wordpress-seo' ), 'Yoast SEO Premium'
|
||||
) . '</p>';
|
||||
$popup_content .= '<ul>';
|
||||
$popup_content .= '<li>' . sprintf(
|
||||
/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
|
||||
__( '%1$sNo more dead links%2$s: easy redirect manager', 'wordpress-seo' ), '<strong>', '</strong>'
|
||||
) . '</li>';
|
||||
$popup_content .= '<li><strong>' . __( 'Superfast internal links suggestions', 'wordpress-seo' ) . '</strong></li>';
|
||||
$popup_content .= '<li>' . sprintf(
|
||||
/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
|
||||
__( '%1$sSocial media preview%2$s: Facebook & Twitter', 'wordpress-seo' ), '<strong>', '</strong>'
|
||||
) . '</li>';
|
||||
$popup_content .= '<li><strong>' . __( '24/7 support', 'wordpress-seo' ) . '</strong></li>';
|
||||
$popup_content .= '<li><strong>' . __( 'No ads!', 'wordpress-seo' ) . '</strong></li>';
|
||||
$popup_content .= '</ul>';
|
||||
$premium_popup = new WPSEO_Premium_Popup( 'add-keyword', 'h1', $popup_title, $popup_content );
|
||||
echo $premium_popup->get_premium_message();
|
||||
|
||||
|
||||
Loaded 100 of 385 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user