@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Defines constants and global variables that can be overridden, generally in wp-config.php. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Multisite |
|
7 | - * @since 3.0.0 |
|
8 | - */ |
|
3 | + * Defines constants and global variables that can be overridden, generally in wp-config.php. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Multisite |
|
7 | + * @since 3.0.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Defines Multisite upload constants. |
@@ -21,23 +21,23 @@ discard block |
||
21 | 21 | global $wpdb; |
22 | 22 | |
23 | 23 | // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT. |
24 | - add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
|
24 | + add_filter('default_site_option_ms_files_rewriting', '__return_true'); |
|
25 | 25 | |
26 | - if ( ! get_site_option( 'ms_files_rewriting' ) ) |
|
26 | + if ( ! get_site_option('ms_files_rewriting')) |
|
27 | 27 | return; |
28 | 28 | |
29 | 29 | // Base uploads dir relative to ABSPATH |
30 | - if ( !defined( 'UPLOADBLOGSDIR' ) ) |
|
31 | - define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); |
|
30 | + if ( ! defined('UPLOADBLOGSDIR')) |
|
31 | + define('UPLOADBLOGSDIR', 'wp-content/blogs.dir'); |
|
32 | 32 | |
33 | 33 | // Note, the main site in a post-MU network uses wp-content/uploads. |
34 | 34 | // This is handled in wp_upload_dir() by ignoring UPLOADS for this case. |
35 | - if ( ! defined( 'UPLOADS' ) ) { |
|
36 | - define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); |
|
35 | + if ( ! defined('UPLOADS')) { |
|
36 | + define('UPLOADS', UPLOADBLOGSDIR."/{$wpdb->blogid}/files/"); |
|
37 | 37 | |
38 | 38 | // Uploads dir relative to ABSPATH |
39 | - if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) |
|
40 | - define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); |
|
39 | + if ('wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined('BLOGUPLOADDIR')) |
|
40 | + define('BLOGUPLOADDIR', WP_CONTENT_DIR."/blogs.dir/{$wpdb->blogid}/files/"); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -52,34 +52,34 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @since 1.2.0 |
54 | 54 | */ |
55 | - if ( !defined( 'COOKIEPATH' ) ) |
|
56 | - define( 'COOKIEPATH', $current_site->path ); |
|
55 | + if ( ! defined('COOKIEPATH')) |
|
56 | + define('COOKIEPATH', $current_site->path); |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @since 1.5.0 |
60 | 60 | */ |
61 | - if ( !defined( 'SITECOOKIEPATH' ) ) |
|
62 | - define( 'SITECOOKIEPATH', $current_site->path ); |
|
61 | + if ( ! defined('SITECOOKIEPATH')) |
|
62 | + define('SITECOOKIEPATH', $current_site->path); |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @since 2.6.0 |
66 | 66 | */ |
67 | - if ( !defined( 'ADMIN_COOKIE_PATH' ) ) { |
|
68 | - if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) { |
|
69 | - define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH ); |
|
67 | + if ( ! defined('ADMIN_COOKIE_PATH')) { |
|
68 | + if ( ! is_subdomain_install() || trim(parse_url(get_option('siteurl'), PHP_URL_PATH), '/')) { |
|
69 | + define('ADMIN_COOKIE_PATH', SITECOOKIEPATH); |
|
70 | 70 | } else { |
71 | - define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
|
71 | + define('ADMIN_COOKIE_PATH', SITECOOKIEPATH.'wp-admin'); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | 76 | * @since 2.0.0 |
77 | 77 | */ |
78 | - if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) { |
|
79 | - if ( !empty( $current_site->cookie_domain ) ) |
|
80 | - define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); |
|
78 | + if ( ! defined('COOKIE_DOMAIN') && is_subdomain_install()) { |
|
79 | + if ( ! empty($current_site->cookie_domain)) |
|
80 | + define('COOKIE_DOMAIN', '.'.$current_site->cookie_domain); |
|
81 | 81 | else |
82 | - define('COOKIE_DOMAIN', '.' . $current_site->domain); |
|
82 | + define('COOKIE_DOMAIN', '.'.$current_site->domain); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | * Optional support for X-Sendfile header |
97 | 97 | * @since 3.0.0 |
98 | 98 | */ |
99 | - if ( !defined( 'WPMU_SENDFILE' ) ) |
|
100 | - define( 'WPMU_SENDFILE', false ); |
|
99 | + if ( ! defined('WPMU_SENDFILE')) |
|
100 | + define('WPMU_SENDFILE', false); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Optional support for X-Accel-Redirect header |
104 | 104 | * @since 3.0.0 |
105 | 105 | */ |
106 | - if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) |
|
107 | - define( 'WPMU_ACCEL_REDIRECT', false ); |
|
106 | + if ( ! defined('WPMU_ACCEL_REDIRECT')) |
|
107 | + define('WPMU_ACCEL_REDIRECT', false); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -124,34 +124,34 @@ discard block |
||
124 | 124 | static $subdomain_error = null; |
125 | 125 | static $subdomain_error_warn = null; |
126 | 126 | |
127 | - if ( false === $subdomain_error ) { |
|
127 | + if (false === $subdomain_error) { |
|
128 | 128 | return; |
129 | 129 | } |
130 | 130 | |
131 | - if ( $subdomain_error ) { |
|
132 | - $vhost_deprecated = __( 'The constant <code>VHOST</code> <strong>is deprecated</strong>. Use the boolean constant <code>SUBDOMAIN_INSTALL</code> in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled.' ); |
|
133 | - if ( $subdomain_error_warn ) { |
|
134 | - trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING ); |
|
131 | + if ($subdomain_error) { |
|
132 | + $vhost_deprecated = __('The constant <code>VHOST</code> <strong>is deprecated</strong>. Use the boolean constant <code>SUBDOMAIN_INSTALL</code> in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled.'); |
|
133 | + if ($subdomain_error_warn) { |
|
134 | + trigger_error(__('<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.').' '.$vhost_deprecated, E_USER_WARNING); |
|
135 | 135 | } else { |
136 | - _deprecated_argument( 'define()', '3.0', $vhost_deprecated ); |
|
136 | + _deprecated_argument('define()', '3.0', $vhost_deprecated); |
|
137 | 137 | } |
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
141 | - if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) { |
|
141 | + if (defined('SUBDOMAIN_INSTALL') && defined('VHOST')) { |
|
142 | 142 | $subdomain_error = true; |
143 | - if ( SUBDOMAIN_INSTALL !== ( 'yes' == VHOST ) ) { |
|
143 | + if (SUBDOMAIN_INSTALL !== ('yes' == VHOST)) { |
|
144 | 144 | $subdomain_error_warn = true; |
145 | 145 | } |
146 | - } elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) { |
|
146 | + } elseif (defined('SUBDOMAIN_INSTALL')) { |
|
147 | 147 | $subdomain_error = false; |
148 | - define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' ); |
|
149 | - } elseif ( defined( 'VHOST' ) ) { |
|
148 | + define('VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no'); |
|
149 | + } elseif (defined('VHOST')) { |
|
150 | 150 | $subdomain_error = true; |
151 | - define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST ); |
|
151 | + define('SUBDOMAIN_INSTALL', 'yes' == VHOST); |
|
152 | 152 | } else { |
153 | 153 | $subdomain_error = false; |
154 | - define( 'SUBDOMAIN_INSTALL', false ); |
|
155 | - define( 'VHOST', 'no' ); |
|
154 | + define('SUBDOMAIN_INSTALL', false); |
|
155 | + define('VHOST', 'no'); |
|
156 | 156 | } |
157 | 157 | } |
@@ -23,12 +23,14 @@ discard block |
||
23 | 23 | // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT. |
24 | 24 | add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
25 | 25 | |
26 | - if ( ! get_site_option( 'ms_files_rewriting' ) ) |
|
27 | - return; |
|
26 | + if ( ! get_site_option( 'ms_files_rewriting' ) ) { |
|
27 | + return; |
|
28 | + } |
|
28 | 29 | |
29 | 30 | // Base uploads dir relative to ABSPATH |
30 | - if ( !defined( 'UPLOADBLOGSDIR' ) ) |
|
31 | - define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); |
|
31 | + if ( !defined( 'UPLOADBLOGSDIR' ) ) { |
|
32 | + define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); |
|
33 | + } |
|
32 | 34 | |
33 | 35 | // Note, the main site in a post-MU network uses wp-content/uploads. |
34 | 36 | // This is handled in wp_upload_dir() by ignoring UPLOADS for this case. |
@@ -36,8 +38,9 @@ discard block |
||
36 | 38 | define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); |
37 | 39 | |
38 | 40 | // Uploads dir relative to ABSPATH |
39 | - if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) |
|
40 | - define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); |
|
41 | + if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) { |
|
42 | + define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); |
|
43 | + } |
|
41 | 44 | } |
42 | 45 | } |
43 | 46 | |
@@ -52,14 +55,16 @@ discard block |
||
52 | 55 | /** |
53 | 56 | * @since 1.2.0 |
54 | 57 | */ |
55 | - if ( !defined( 'COOKIEPATH' ) ) |
|
56 | - define( 'COOKIEPATH', $current_site->path ); |
|
58 | + if ( !defined( 'COOKIEPATH' ) ) { |
|
59 | + define( 'COOKIEPATH', $current_site->path ); |
|
60 | + } |
|
57 | 61 | |
58 | 62 | /** |
59 | 63 | * @since 1.5.0 |
60 | 64 | */ |
61 | - if ( !defined( 'SITECOOKIEPATH' ) ) |
|
62 | - define( 'SITECOOKIEPATH', $current_site->path ); |
|
65 | + if ( !defined( 'SITECOOKIEPATH' ) ) { |
|
66 | + define( 'SITECOOKIEPATH', $current_site->path ); |
|
67 | + } |
|
63 | 68 | |
64 | 69 | /** |
65 | 70 | * @since 2.6.0 |
@@ -76,10 +81,11 @@ discard block |
||
76 | 81 | * @since 2.0.0 |
77 | 82 | */ |
78 | 83 | if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) { |
79 | - if ( !empty( $current_site->cookie_domain ) ) |
|
80 | - define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); |
|
81 | - else |
|
82 | - define('COOKIE_DOMAIN', '.' . $current_site->domain); |
|
84 | + if ( !empty( $current_site->cookie_domain ) ) { |
|
85 | + define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain); |
|
86 | + } else { |
|
87 | + define('COOKIE_DOMAIN', '.' . $current_site->domain); |
|
88 | + } |
|
83 | 89 | } |
84 | 90 | } |
85 | 91 | |
@@ -96,16 +102,18 @@ discard block |
||
96 | 102 | * Optional support for X-Sendfile header |
97 | 103 | * @since 3.0.0 |
98 | 104 | */ |
99 | - if ( !defined( 'WPMU_SENDFILE' ) ) |
|
100 | - define( 'WPMU_SENDFILE', false ); |
|
105 | + if ( !defined( 'WPMU_SENDFILE' ) ) { |
|
106 | + define( 'WPMU_SENDFILE', false ); |
|
107 | + } |
|
101 | 108 | |
102 | 109 | /** |
103 | 110 | * Optional support for X-Accel-Redirect header |
104 | 111 | * @since 3.0.0 |
105 | 112 | */ |
106 | - if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) |
|
107 | - define( 'WPMU_ACCEL_REDIRECT', false ); |
|
108 | -} |
|
113 | + if ( !defined( 'WPMU_ACCEL_REDIRECT' ) ) { |
|
114 | + define( 'WPMU_ACCEL_REDIRECT', false ); |
|
115 | + } |
|
116 | + } |
|
109 | 117 | |
110 | 118 | /** |
111 | 119 | * Defines Multisite subdomain constants and handles warnings and notices. |
@@ -22,19 +22,19 @@ discard block |
||
22 | 22 | */ |
23 | 23 | |
24 | 24 | /** BackPress: WordPress Dependencies Class */ |
25 | -require( ABSPATH . WPINC . '/class.wp-dependencies.php' ); |
|
25 | +require(ABSPATH.WPINC.'/class.wp-dependencies.php'); |
|
26 | 26 | |
27 | 27 | /** BackPress: WordPress Scripts Class */ |
28 | -require( ABSPATH . WPINC . '/class.wp-scripts.php' ); |
|
28 | +require(ABSPATH.WPINC.'/class.wp-scripts.php'); |
|
29 | 29 | |
30 | 30 | /** BackPress: WordPress Scripts Functions */ |
31 | -require( ABSPATH . WPINC . '/functions.wp-scripts.php' ); |
|
31 | +require(ABSPATH.WPINC.'/functions.wp-scripts.php'); |
|
32 | 32 | |
33 | 33 | /** BackPress: WordPress Styles Class */ |
34 | -require( ABSPATH . WPINC . '/class.wp-styles.php' ); |
|
34 | +require(ABSPATH.WPINC.'/class.wp-styles.php'); |
|
35 | 35 | |
36 | 36 | /** BackPress: WordPress Styles Functions */ |
37 | -require( ABSPATH . WPINC . '/functions.wp-styles.php' ); |
|
37 | +require(ABSPATH.WPINC.'/functions.wp-styles.php'); |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Register all WordPress scripts. |
@@ -47,101 +47,101 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @param WP_Scripts $scripts WP_Scripts object. |
49 | 49 | */ |
50 | -function wp_default_scripts( &$scripts ) { |
|
51 | - include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version |
|
50 | +function wp_default_scripts(&$scripts) { |
|
51 | + include(ABSPATH.WPINC.'/version.php'); // include an unmodified $wp_version |
|
52 | 52 | |
53 | - $develop_src = false !== strpos( $wp_version, '-src' ); |
|
53 | + $develop_src = false !== strpos($wp_version, '-src'); |
|
54 | 54 | |
55 | - if ( ! defined( 'SCRIPT_DEBUG' ) ) { |
|
56 | - define( 'SCRIPT_DEBUG', $develop_src ); |
|
55 | + if ( ! defined('SCRIPT_DEBUG')) { |
|
56 | + define('SCRIPT_DEBUG', $develop_src); |
|
57 | 57 | } |
58 | 58 | |
59 | - if ( ! $guessurl = site_url() ) { |
|
59 | + if ( ! $guessurl = site_url()) { |
|
60 | 60 | $guessed_url = true; |
61 | 61 | $guessurl = wp_guess_url(); |
62 | 62 | } |
63 | 63 | |
64 | 64 | $scripts->base_url = $guessurl; |
65 | - $scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : ''; |
|
66 | - $scripts->default_version = get_bloginfo( 'version' ); |
|
65 | + $scripts->content_url = defined('WP_CONTENT_URL') ? WP_CONTENT_URL : ''; |
|
66 | + $scripts->default_version = get_bloginfo('version'); |
|
67 | 67 | $scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/'); |
68 | 68 | |
69 | 69 | $suffix = SCRIPT_DEBUG ? '' : '.min'; |
70 | 70 | $dev_suffix = $develop_src ? '' : '.min'; |
71 | 71 | |
72 | - $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" ); |
|
73 | - did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array( |
|
72 | + $scripts->add('utils', "/wp-includes/js/utils$suffix.js"); |
|
73 | + did_action('init') && $scripts->localize('utils', 'userSettings', array( |
|
74 | 74 | 'url' => (string) SITECOOKIEPATH, |
75 | 75 | 'uid' => (string) get_current_user_id(), |
76 | 76 | 'time' => (string) time(), |
77 | - 'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ), |
|
78 | - ) ); |
|
79 | - |
|
80 | - $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 ); |
|
81 | - did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array( |
|
82 | - 'warnDelete' => __( "You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete." ), |
|
83 | - 'dismiss' => __( 'Dismiss this notice.' ), |
|
84 | - ) ); |
|
85 | - |
|
86 | - $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 ); |
|
87 | - |
|
88 | - $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1 ); |
|
89 | - |
|
90 | - $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 ); |
|
91 | - did_action( 'init' ) && $scripts->localize( 'quicktags', 'quicktagsL10n', array( |
|
92 | - 'closeAllOpenTags' => __( 'Close all open tags' ), |
|
93 | - 'closeTags' => __( 'close tags' ), |
|
94 | - 'enterURL' => __( 'Enter the URL' ), |
|
95 | - 'enterImageURL' => __( 'Enter the URL of the image' ), |
|
96 | - 'enterImageDescription' => __( 'Enter a description of the image' ), |
|
97 | - 'textdirection' => __( 'text direction' ), |
|
98 | - 'toggleTextdirection' => __( 'Toggle Editor Text Direction' ), |
|
99 | - 'dfw' => __( 'Distraction-free writing mode' ), |
|
100 | - 'strong' => __( 'Bold' ), |
|
101 | - 'strongClose' => __( 'Close bold tag' ), |
|
102 | - 'em' => __( 'Italic' ), |
|
103 | - 'emClose' => __( 'Close italic tag' ), |
|
104 | - 'link' => __( 'Insert link' ), |
|
105 | - 'blockquote' => __( 'Blockquote' ), |
|
106 | - 'blockquoteClose' => __( 'Close blockquote tag' ), |
|
107 | - 'del' => __( 'Deleted text (strikethrough)' ), |
|
108 | - 'delClose' => __( 'Close deleted text tag' ), |
|
109 | - 'ins' => __( 'Inserted text' ), |
|
110 | - 'insClose' => __( 'Close inserted text tag' ), |
|
111 | - 'image' => __( 'Insert image' ), |
|
112 | - 'ul' => __( 'Bulleted list' ), |
|
113 | - 'ulClose' => __( 'Close bulleted list tag' ), |
|
114 | - 'ol' => __( 'Numbered list' ), |
|
115 | - 'olClose' => __( 'Close numbered list tag' ), |
|
116 | - 'li' => __( 'List item' ), |
|
117 | - 'liClose' => __( 'Close list item tag' ), |
|
118 | - 'code' => __( 'Code' ), |
|
119 | - 'codeClose' => __( 'Close code tag' ), |
|
120 | - 'more' => __( 'Insert Read More tag' ), |
|
121 | - ) ); |
|
122 | - |
|
123 | - $scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' ); |
|
124 | - |
|
125 | - $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), false, 1 ); |
|
77 | + 'secure' => (string) ('https' === parse_url(site_url(), PHP_URL_SCHEME)), |
|
78 | + )); |
|
79 | + |
|
80 | + $scripts->add('common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1); |
|
81 | + did_action('init') && $scripts->localize('common', 'commonL10n', array( |
|
82 | + 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), |
|
83 | + 'dismiss' => __('Dismiss this notice.'), |
|
84 | + )); |
|
85 | + |
|
86 | + $scripts->add('wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array('jquery'), false, 1); |
|
87 | + |
|
88 | + $scripts->add('sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1); |
|
89 | + |
|
90 | + $scripts->add('quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1); |
|
91 | + did_action('init') && $scripts->localize('quicktags', 'quicktagsL10n', array( |
|
92 | + 'closeAllOpenTags' => __('Close all open tags'), |
|
93 | + 'closeTags' => __('close tags'), |
|
94 | + 'enterURL' => __('Enter the URL'), |
|
95 | + 'enterImageURL' => __('Enter the URL of the image'), |
|
96 | + 'enterImageDescription' => __('Enter a description of the image'), |
|
97 | + 'textdirection' => __('text direction'), |
|
98 | + 'toggleTextdirection' => __('Toggle Editor Text Direction'), |
|
99 | + 'dfw' => __('Distraction-free writing mode'), |
|
100 | + 'strong' => __('Bold'), |
|
101 | + 'strongClose' => __('Close bold tag'), |
|
102 | + 'em' => __('Italic'), |
|
103 | + 'emClose' => __('Close italic tag'), |
|
104 | + 'link' => __('Insert link'), |
|
105 | + 'blockquote' => __('Blockquote'), |
|
106 | + 'blockquoteClose' => __('Close blockquote tag'), |
|
107 | + 'del' => __('Deleted text (strikethrough)'), |
|
108 | + 'delClose' => __('Close deleted text tag'), |
|
109 | + 'ins' => __('Inserted text'), |
|
110 | + 'insClose' => __('Close inserted text tag'), |
|
111 | + 'image' => __('Insert image'), |
|
112 | + 'ul' => __('Bulleted list'), |
|
113 | + 'ulClose' => __('Close bulleted list tag'), |
|
114 | + 'ol' => __('Numbered list'), |
|
115 | + 'olClose' => __('Close numbered list tag'), |
|
116 | + 'li' => __('List item'), |
|
117 | + 'liClose' => __('Close list item tag'), |
|
118 | + 'code' => __('Code'), |
|
119 | + 'codeClose' => __('Close code tag'), |
|
120 | + 'more' => __('Insert Read More tag'), |
|
121 | + )); |
|
122 | + |
|
123 | + $scripts->add('colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m'); |
|
124 | + |
|
125 | + $scripts->add('editor', "/wp-admin/js/editor$suffix.js", array('utils', 'jquery'), false, 1); |
|
126 | 126 | |
127 | 127 | // Back-compat for old DFW. To-do: remove at the end of 2016. |
128 | - $scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 ); |
|
128 | + $scripts->add('wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1); |
|
129 | 129 | |
130 | - $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 ); |
|
131 | - did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array( |
|
130 | + $scripts->add('wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1); |
|
131 | + did_action('init') && $scripts->localize('wp-ajax-response', 'wpAjax', array( |
|
132 | 132 | 'noPerm' => __('You do not have permission to do that.'), |
133 | 133 | 'broken' => __('An unidentified error has occurred.') |
134 | - ) ); |
|
134 | + )); |
|
135 | 135 | |
136 | - $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 ); |
|
137 | - did_action( 'init' ) && $scripts->localize( 'wp-pointer', 'wpPointerL10n', array( |
|
136 | + $scripts->add('wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array('jquery-ui-widget', 'jquery-ui-position'), '20111129a', 1); |
|
137 | + did_action('init') && $scripts->localize('wp-pointer', 'wpPointerL10n', array( |
|
138 | 138 | 'dismiss' => __('Dismiss'), |
139 | - ) ); |
|
139 | + )); |
|
140 | 140 | |
141 | - $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('heartbeat'), false, 1 ); |
|
141 | + $scripts->add('autosave', "/wp-includes/js/autosave$suffix.js", array('heartbeat'), false, 1); |
|
142 | 142 | |
143 | - $scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1 ); |
|
144 | - did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings', |
|
143 | + $scripts->add('heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1); |
|
144 | + did_action('init') && $scripts->localize('heartbeat', 'heartbeatSettings', |
|
145 | 145 | /** |
146 | 146 | * Filter the Heartbeat settings. |
147 | 147 | * |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @param array $settings Heartbeat settings array. |
151 | 151 | */ |
152 | - apply_filters( 'heartbeat_settings', array() ) |
|
152 | + apply_filters('heartbeat_settings', array()) |
|
153 | 153 | ); |
154 | 154 | |
155 | - $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 ); |
|
156 | - did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array( |
|
155 | + $scripts->add('wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1); |
|
156 | + did_action('init') && $scripts->localize('wp-auth-check', 'authcheckL10n', array( |
|
157 | 157 | 'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'), |
158 | 158 | |
159 | 159 | /** |
@@ -164,91 +164,91 @@ discard block |
||
164 | 164 | * @param int $interval The interval in which to check a user's authentication. |
165 | 165 | * Default 3 minutes in seconds, or 180. |
166 | 166 | */ |
167 | - 'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ), |
|
168 | - ) ); |
|
167 | + 'interval' => apply_filters('wp_auth_check_interval', 3 * MINUTE_IN_SECONDS), |
|
168 | + )); |
|
169 | 169 | |
170 | - $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 ); |
|
170 | + $scripts->add('wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response', 'jquery-color'), false, 1); |
|
171 | 171 | |
172 | 172 | // WordPress no longer uses or bundles Prototype or script.aculo.us. These are now pulled from an external source. |
173 | - $scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1'); |
|
174 | - $scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0'); |
|
175 | - $scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0'); |
|
176 | - $scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0'); |
|
177 | - $scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0'); |
|
178 | - $scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0'); |
|
179 | - $scripts->add( 'scriptaculous-sound', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' ); |
|
180 | - $scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0'); |
|
181 | - $scripts->add( 'scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls') ); |
|
173 | + $scripts->add('prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1'); |
|
174 | + $scripts->add('scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0'); |
|
175 | + $scripts->add('scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0'); |
|
176 | + $scripts->add('scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0'); |
|
177 | + $scripts->add('scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0'); |
|
178 | + $scripts->add('scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0'); |
|
179 | + $scripts->add('scriptaculous-sound', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array('scriptaculous-root'), '1.9.0'); |
|
180 | + $scripts->add('scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0'); |
|
181 | + $scripts->add('scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls')); |
|
182 | 182 | |
183 | 183 | // not used in core, replaced by Jcrop.js |
184 | - $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') ); |
|
184 | + $scripts->add('cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop')); |
|
185 | 185 | |
186 | 186 | // jQuery |
187 | - $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.3' ); |
|
188 | - $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.11.3' ); |
|
189 | - $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1' ); |
|
187 | + $scripts->add('jquery', false, array('jquery-core', 'jquery-migrate'), '1.11.3'); |
|
188 | + $scripts->add('jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.11.3'); |
|
189 | + $scripts->add('jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1'); |
|
190 | 190 | |
191 | 191 | // full jQuery UI |
192 | - $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1 ); |
|
193 | - $scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.4', 1 ); |
|
194 | - |
|
195 | - $scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
196 | - $scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
197 | - $scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
198 | - $scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
199 | - $scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
200 | - $scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
201 | - $scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
202 | - $scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
203 | - $scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-scale'), '1.11.4', 1 ); |
|
204 | - $scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
205 | - $scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-size'), '1.11.4', 1 ); |
|
206 | - $scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
207 | - $scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
208 | - $scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
209 | - $scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 ); |
|
210 | - |
|
211 | - $scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 ); |
|
212 | - $scripts->add( 'jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1 ); |
|
213 | - $scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 ); |
|
214 | - $scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.4', 1 ); |
|
215 | - $scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.4', 1 ); |
|
216 | - $scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 ); |
|
217 | - $scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.4', 1 ); |
|
218 | - $scripts->add( 'jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 ); |
|
219 | - $scripts->add( 'jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 ); |
|
220 | - $scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.4', 1 ); |
|
221 | - $scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 ); |
|
222 | - $scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 ); |
|
223 | - $scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 ); |
|
224 | - $scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1 ); |
|
225 | - $scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 ); |
|
226 | - $scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 ); |
|
227 | - $scripts->add( 'jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array( 'jquery-ui-button' ), '1.11.4', 1 ); |
|
228 | - $scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 ); |
|
229 | - $scripts->add( 'jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 ); |
|
230 | - $scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.4', 1 ); |
|
192 | + $scripts->add('jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1); |
|
193 | + $scripts->add('jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.4', 1); |
|
194 | + |
|
195 | + $scripts->add('jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
196 | + $scripts->add('jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
197 | + $scripts->add('jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
198 | + $scripts->add('jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
199 | + $scripts->add('jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
200 | + $scripts->add('jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
201 | + $scripts->add('jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
202 | + $scripts->add('jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
203 | + $scripts->add('jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-scale'), '1.11.4', 1); |
|
204 | + $scripts->add('jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
205 | + $scripts->add('jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-size'), '1.11.4', 1); |
|
206 | + $scripts->add('jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
207 | + $scripts->add('jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
208 | + $scripts->add('jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
209 | + $scripts->add('jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1); |
|
210 | + |
|
211 | + $scripts->add('jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1); |
|
212 | + $scripts->add('jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1); |
|
213 | + $scripts->add('jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1); |
|
214 | + $scripts->add('jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.4', 1); |
|
215 | + $scripts->add('jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.4', 1); |
|
216 | + $scripts->add('jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1); |
|
217 | + $scripts->add('jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.4', 1); |
|
218 | + $scripts->add('jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.11.4', 1); |
|
219 | + $scripts->add('jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1); |
|
220 | + $scripts->add('jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.4', 1); |
|
221 | + $scripts->add('jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1); |
|
222 | + $scripts->add('jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1); |
|
223 | + $scripts->add('jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1); |
|
224 | + $scripts->add('jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1); |
|
225 | + $scripts->add('jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1); |
|
226 | + $scripts->add('jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1); |
|
227 | + $scripts->add('jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array('jquery-ui-button'), '1.11.4', 1); |
|
228 | + $scripts->add('jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1); |
|
229 | + $scripts->add('jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.11.4', 1); |
|
230 | + $scripts->add('jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.4', 1); |
|
231 | 231 | |
232 | 232 | // deprecated, not used in core, most functionality is included in jQuery 1.3 |
233 | - $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '3.37.0', 1 ); |
|
233 | + $scripts->add('jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '3.37.0', 1); |
|
234 | 234 | |
235 | 235 | // jQuery plugins |
236 | - $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1 ); |
|
237 | - $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 ); |
|
238 | - $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1 ); |
|
239 | - $scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1 ); |
|
240 | - $scripts->add( 'jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2', 1 ); |
|
241 | - $scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m', 1 ); |
|
242 | - $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), false, 1 ); |
|
243 | - $scripts->add( 'jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 ); |
|
236 | + $scripts->add('jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1); |
|
237 | + $scripts->add('suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1); |
|
238 | + $scripts->add('schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1); |
|
239 | + $scripts->add('jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1); |
|
240 | + $scripts->add('jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2', 1); |
|
241 | + $scripts->add('jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m', 1); |
|
242 | + $scripts->add('jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), false, 1); |
|
243 | + $scripts->add('jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1); |
|
244 | 244 | |
245 | 245 | // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. |
246 | 246 | // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. |
247 | - $scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array(), '3.1.2', 1 ); |
|
248 | - $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2', 1 ); |
|
247 | + $scripts->add('masonry', "/wp-includes/js/masonry.min.js", array(), '3.1.2', 1); |
|
248 | + $scripts->add('jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array('jquery', 'masonry'), '3.1.2', 1); |
|
249 | 249 | |
250 | - $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 ); |
|
251 | - did_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array( |
|
250 | + $scripts->add('thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1); |
|
251 | + did_action('init') && $scripts->localize('thickbox', 'thickboxL10n', array( |
|
252 | 252 | 'next' => __('Next >'), |
253 | 253 | 'prev' => __('< Prev'), |
254 | 254 | 'image' => __('Image'), |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | 'close' => __('Close'), |
257 | 257 | 'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'), |
258 | 258 | 'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'), |
259 | - ) ); |
|
259 | + )); |
|
260 | 260 | |
261 | - $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.js", array('jquery'), '0.9.12'); |
|
261 | + $scripts->add('jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.js", array('jquery'), '0.9.12'); |
|
262 | 262 | |
263 | - $scripts->add( 'swfobject', "/wp-includes/js/swfobject.js", array(), '2.2-20120417'); |
|
263 | + $scripts->add('swfobject', "/wp-includes/js/swfobject.js", array(), '2.2-20120417'); |
|
264 | 264 | |
265 | 265 | // error message for both plupload and swfupload |
266 | 266 | $uploader_l10n = array( |
@@ -288,205 +288,205 @@ discard block |
||
288 | 288 | 'error_uploading' => __('“%s” has failed to upload.') |
289 | 289 | ); |
290 | 290 | |
291 | - $scripts->add( 'plupload', '/wp-includes/js/plupload/plupload.full.min.js', array(), '2.1.1' ); |
|
291 | + $scripts->add('plupload', '/wp-includes/js/plupload/plupload.full.min.js', array(), '2.1.1'); |
|
292 | 292 | // Back compat handles: |
293 | - foreach ( array( 'all', 'html5', 'flash', 'silverlight', 'html4' ) as $handle ) { |
|
294 | - $scripts->add( "plupload-$handle", false, array( 'plupload' ), '2.1.1' ); |
|
293 | + foreach (array('all', 'html5', 'flash', 'silverlight', 'html4') as $handle) { |
|
294 | + $scripts->add("plupload-$handle", false, array('plupload'), '2.1.1'); |
|
295 | 295 | } |
296 | 296 | |
297 | - $scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array( 'plupload', 'jquery' ) ); |
|
298 | - did_action( 'init' ) && $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n ); |
|
297 | + $scripts->add('plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload', 'jquery')); |
|
298 | + did_action('init') && $scripts->localize('plupload-handlers', 'pluploadL10n', $uploader_l10n); |
|
299 | 299 | |
300 | - $scripts->add( 'wp-plupload', "/wp-includes/js/plupload/wp-plupload$suffix.js", array( 'plupload', 'jquery', 'json2', 'media-models' ), false, 1 ); |
|
301 | - did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n ); |
|
300 | + $scripts->add('wp-plupload', "/wp-includes/js/plupload/wp-plupload$suffix.js", array('plupload', 'jquery', 'json2', 'media-models'), false, 1); |
|
301 | + did_action('init') && $scripts->localize('wp-plupload', 'pluploadL10n', $uploader_l10n); |
|
302 | 302 | |
303 | 303 | // keep 'swfupload' for back-compat. |
304 | - $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113'); |
|
305 | - $scripts->add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload', 'swfobject'), '2201a'); |
|
306 | - $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201'); |
|
307 | - $scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201'); |
|
308 | - $scripts->add( 'swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201'); |
|
309 | - $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524'); |
|
310 | - did_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n ); |
|
304 | + $scripts->add('swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113'); |
|
305 | + $scripts->add('swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload', 'swfobject'), '2201a'); |
|
306 | + $scripts->add('swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201'); |
|
307 | + $scripts->add('swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201'); |
|
308 | + $scripts->add('swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201'); |
|
309 | + $scripts->add('swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524'); |
|
310 | + did_action('init') && $scripts->localize('swfupload-handlers', 'swfuploadL10n', $uploader_l10n); |
|
311 | 311 | |
312 | - $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1 ); |
|
312 | + $scripts->add('comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1); |
|
313 | 313 | |
314 | - $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23' ); |
|
315 | - did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' ); |
|
314 | + $scripts->add('json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23'); |
|
315 | + did_action('init') && $scripts->add_data('json2', 'conditional', 'lt IE 8'); |
|
316 | 316 | |
317 | - $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.6.0', 1 ); |
|
318 | - $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore','jquery' ), '1.1.2', 1 ); |
|
317 | + $scripts->add('underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.6.0', 1); |
|
318 | + $scripts->add('backbone', "/wp-includes/js/backbone$dev_suffix.js", array('underscore', 'jquery'), '1.1.2', 1); |
|
319 | 319 | |
320 | - $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 ); |
|
321 | - did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array( |
|
320 | + $scripts->add('wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1); |
|
321 | + did_action('init') && $scripts->localize('wp-util', '_wpUtilSettings', array( |
|
322 | 322 | 'ajax' => array( |
323 | - 'url' => admin_url( 'admin-ajax.php', 'relative' ), |
|
323 | + 'url' => admin_url('admin-ajax.php', 'relative'), |
|
324 | 324 | ), |
325 | - ) ); |
|
325 | + )); |
|
326 | 326 | |
327 | - $scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1 ); |
|
327 | + $scripts->add('wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1); |
|
328 | 328 | |
329 | - $scripts->add( 'revisions', "/wp-admin/js/revisions$suffix.js", array( 'wp-backbone', 'jquery-ui-slider', 'hoverIntent' ), false, 1 ); |
|
329 | + $scripts->add('revisions', "/wp-admin/js/revisions$suffix.js", array('wp-backbone', 'jquery-ui-slider', 'hoverIntent'), false, 1); |
|
330 | 330 | |
331 | - $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1 ); |
|
331 | + $scripts->add('imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1); |
|
332 | 332 | |
333 | - $scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.17.0', 1 ); |
|
334 | - did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejsL10n', array( |
|
335 | - 'language' => get_bloginfo( 'language' ), |
|
333 | + $scripts->add('mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.17.0', 1); |
|
334 | + did_action('init') && $scripts->localize('mediaelement', 'mejsL10n', array( |
|
335 | + 'language' => get_bloginfo('language'), |
|
336 | 336 | 'strings' => array( |
337 | - 'Close' => __( 'Close' ), |
|
338 | - 'Fullscreen' => __( 'Fullscreen' ), |
|
339 | - 'Download File' => __( 'Download File' ), |
|
340 | - 'Download Video' => __( 'Download Video' ), |
|
341 | - 'Play/Pause' => __( 'Play/Pause' ), |
|
342 | - 'Mute Toggle' => __( 'Mute Toggle' ), |
|
343 | - 'None' => __( 'None' ), |
|
344 | - 'Turn off Fullscreen' => __( 'Turn off Fullscreen' ), |
|
345 | - 'Go Fullscreen' => __( 'Go Fullscreen' ), |
|
346 | - 'Unmute' => __( 'Unmute' ), |
|
347 | - 'Mute' => __( 'Mute' ), |
|
348 | - 'Captions/Subtitles' => __( 'Captions/Subtitles' ) |
|
337 | + 'Close' => __('Close'), |
|
338 | + 'Fullscreen' => __('Fullscreen'), |
|
339 | + 'Download File' => __('Download File'), |
|
340 | + 'Download Video' => __('Download Video'), |
|
341 | + 'Play/Pause' => __('Play/Pause'), |
|
342 | + 'Mute Toggle' => __('Mute Toggle'), |
|
343 | + 'None' => __('None'), |
|
344 | + 'Turn off Fullscreen' => __('Turn off Fullscreen'), |
|
345 | + 'Go Fullscreen' => __('Go Fullscreen'), |
|
346 | + 'Unmute' => __('Unmute'), |
|
347 | + 'Mute' => __('Mute'), |
|
348 | + 'Captions/Subtitles' => __('Captions/Subtitles') |
|
349 | 349 | ), |
350 | - ) ); |
|
350 | + )); |
|
351 | 351 | |
352 | 352 | |
353 | - $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 ); |
|
354 | - did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings', array( |
|
355 | - 'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ), |
|
356 | - ) ); |
|
353 | + $scripts->add('wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1); |
|
354 | + did_action('init') && $scripts->localize('mediaelement', '_wpmejsSettings', array( |
|
355 | + 'pluginPath' => includes_url('js/mediaelement/', 'relative'), |
|
356 | + )); |
|
357 | 357 | |
358 | - $scripts->add( 'froogaloop', "/wp-includes/js/mediaelement/froogaloop.min.js", array(), '2.0' ); |
|
359 | - $scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 ); |
|
358 | + $scripts->add('froogaloop', "/wp-includes/js/mediaelement/froogaloop.min.js", array(), '2.0'); |
|
359 | + $scripts->add('wp-playlist', "/wp-includes/js/mediaelement/wp-playlist.js", array('wp-util', 'backbone', 'mediaelement'), false, 1); |
|
360 | 360 | |
361 | - $scripts->add( 'zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0' ); |
|
362 | - did_action( 'init' ) && $scripts->localize( 'zxcvbn-async', '_zxcvbnSettings', array( |
|
363 | - 'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js', |
|
364 | - ) ); |
|
361 | + $scripts->add('zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0'); |
|
362 | + did_action('init') && $scripts->localize('zxcvbn-async', '_zxcvbnSettings', array( |
|
363 | + 'src' => empty($guessed_url) ? includes_url('/js/zxcvbn.min.js') : $scripts->base_url.'/wp-includes/js/zxcvbn.min.js', |
|
364 | + )); |
|
365 | 365 | |
366 | - $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 ); |
|
367 | - did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array( |
|
368 | - 'short' => _x( 'Very weak', 'password strength' ), |
|
369 | - 'bad' => _x( 'Weak', 'password strength' ), |
|
370 | - 'good' => _x( 'Medium', 'password strength' ), |
|
371 | - 'strong' => _x( 'Strong', 'password strength' ), |
|
372 | - 'mismatch' => _x( 'Mismatch', 'password mismatch' ), |
|
373 | - ) ); |
|
366 | + $scripts->add('password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery', 'zxcvbn-async'), false, 1); |
|
367 | + did_action('init') && $scripts->localize('password-strength-meter', 'pwsL10n', array( |
|
368 | + 'short' => _x('Very weak', 'password strength'), |
|
369 | + 'bad' => _x('Weak', 'password strength'), |
|
370 | + 'good' => _x('Medium', 'password strength'), |
|
371 | + 'strong' => _x('Strong', 'password strength'), |
|
372 | + 'mismatch' => _x('Mismatch', 'password mismatch'), |
|
373 | + )); |
|
374 | 374 | |
375 | - $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 ); |
|
376 | - did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array( |
|
377 | - 'warn' => __( 'Your new password has not been saved.' ), |
|
378 | - 'show' => __( 'Show' ), |
|
379 | - 'hide' => __( 'Hide' ), |
|
380 | - 'cancel' => __( 'Cancel' ), |
|
381 | - 'ariaShow' => esc_attr__( 'Show password' ), |
|
382 | - 'ariaHide' => esc_attr__( 'Hide password' ), |
|
383 | - ) ); |
|
375 | + $scripts->add('user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery', 'password-strength-meter', 'wp-util'), false, 1); |
|
376 | + did_action('init') && $scripts->localize('user-profile', 'userProfileL10n', array( |
|
377 | + 'warn' => __('Your new password has not been saved.'), |
|
378 | + 'show' => __('Show'), |
|
379 | + 'hide' => __('Hide'), |
|
380 | + 'cancel' => __('Cancel'), |
|
381 | + 'ariaShow' => esc_attr__('Show password'), |
|
382 | + 'ariaHide' => esc_attr__('Hide password'), |
|
383 | + )); |
|
384 | 384 | |
385 | - $scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 ); |
|
385 | + $scripts->add('language-chooser', "/wp-admin/js/language-chooser$suffix.js", array('jquery'), false, 1); |
|
386 | 386 | |
387 | - $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); |
|
387 | + $scripts->add('user-suggest', "/wp-admin/js/user-suggest$suffix.js", array('jquery-ui-autocomplete'), false, 1); |
|
388 | 388 | |
389 | - $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 ); |
|
389 | + $scripts->add('admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1); |
|
390 | 390 | |
391 | - $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery' ), false, 1 ); |
|
392 | - did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array( |
|
391 | + $scripts->add('wplink', "/wp-includes/js/wplink$suffix.js", array('jquery'), false, 1); |
|
392 | + did_action('init') && $scripts->localize('wplink', 'wpLinkL10n', array( |
|
393 | 393 | 'title' => __('Insert/edit link'), |
394 | 394 | 'update' => __('Update'), |
395 | 395 | 'save' => __('Add Link'), |
396 | 396 | 'noTitle' => __('(no title)'), |
397 | 397 | 'noMatchesFound' => __('No results found.') |
398 | - ) ); |
|
398 | + )); |
|
399 | 399 | |
400 | - $scripts->add( 'wpdialogs', "/wp-includes/js/wpdialog$suffix.js", array( 'jquery-ui-dialog' ), false, 1 ); |
|
400 | + $scripts->add('wpdialogs', "/wp-includes/js/wpdialog$suffix.js", array('jquery-ui-dialog'), false, 1); |
|
401 | 401 | |
402 | - $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array(), false, 1 ); |
|
403 | - did_action( 'init' ) && $scripts->localize( 'word-count', 'wordCountL10n', array( |
|
402 | + $scripts->add('word-count', "/wp-admin/js/word-count$suffix.js", array(), false, 1); |
|
403 | + did_action('init') && $scripts->localize('word-count', 'wordCountL10n', array( |
|
404 | 404 | /* |
405 | 405 | * translators: If your word count is based on single characters (e.g. East Asian characters), |
406 | 406 | * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. |
407 | 407 | * Do not translate into your own language. |
408 | 408 | */ |
409 | - 'type' => _x( 'words', 'Word count type. Do not translate!' ), |
|
410 | - 'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array() |
|
411 | - ) ); |
|
412 | - |
|
413 | - $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 ); |
|
414 | - |
|
415 | - $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '1.8.1', 1 ); |
|
416 | - |
|
417 | - $scripts->add( 'customize-base', "/wp-includes/js/customize-base$suffix.js", array( 'jquery', 'json2', 'underscore' ), false, 1 ); |
|
418 | - $scripts->add( 'customize-loader', "/wp-includes/js/customize-loader$suffix.js", array( 'customize-base' ), false, 1 ); |
|
419 | - $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'customize-base' ), false, 1 ); |
|
420 | - $scripts->add( 'customize-models', "/wp-includes/js/customize-models.js", array( 'underscore', 'backbone' ), false, 1 ); |
|
421 | - $scripts->add( 'customize-views', "/wp-includes/js/customize-views.js", array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 ); |
|
422 | - $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y' ), false, 1 ); |
|
423 | - did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array( |
|
424 | - 'activate' => __( 'Save & Activate' ), |
|
425 | - 'save' => __( 'Save & Publish' ), |
|
426 | - 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), |
|
427 | - 'saved' => __( 'Saved' ), |
|
428 | - 'cancel' => __( 'Cancel' ), |
|
429 | - 'close' => __( 'Close' ), |
|
430 | - 'cheatin' => __( 'Cheatin’ uh?' ), |
|
431 | - 'previewIframeTitle' => __( 'Site Preview' ), |
|
432 | - 'loginIframeTitle' => __( 'Session expired' ), |
|
433 | - 'collapseSidebar' => __( 'Collapse Sidebar' ), |
|
434 | - 'expandSidebar' => __( 'Expand Sidebar' ), |
|
409 | + 'type' => _x('words', 'Word count type. Do not translate!'), |
|
410 | + 'shortcodes' => ! empty($GLOBALS['shortcode_tags']) ? array_keys($GLOBALS['shortcode_tags']) : array() |
|
411 | + )); |
|
412 | + |
|
413 | + $scripts->add('media-upload', "/wp-admin/js/media-upload$suffix.js", array('thickbox', 'shortcode'), false, 1); |
|
414 | + |
|
415 | + $scripts->add('hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '1.8.1', 1); |
|
416 | + |
|
417 | + $scripts->add('customize-base', "/wp-includes/js/customize-base$suffix.js", array('jquery', 'json2', 'underscore'), false, 1); |
|
418 | + $scripts->add('customize-loader', "/wp-includes/js/customize-loader$suffix.js", array('customize-base'), false, 1); |
|
419 | + $scripts->add('customize-preview', "/wp-includes/js/customize-preview$suffix.js", array('customize-base'), false, 1); |
|
420 | + $scripts->add('customize-models', "/wp-includes/js/customize-models.js", array('underscore', 'backbone'), false, 1); |
|
421 | + $scripts->add('customize-views', "/wp-includes/js/customize-views.js", array('jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views'), false, 1); |
|
422 | + $scripts->add('customize-controls', "/wp-admin/js/customize-controls$suffix.js", array('customize-base', 'wp-a11y'), false, 1); |
|
423 | + did_action('init') && $scripts->localize('customize-controls', '_wpCustomizeControlsL10n', array( |
|
424 | + 'activate' => __('Save & Activate'), |
|
425 | + 'save' => __('Save & Publish'), |
|
426 | + 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), |
|
427 | + 'saved' => __('Saved'), |
|
428 | + 'cancel' => __('Cancel'), |
|
429 | + 'close' => __('Close'), |
|
430 | + 'cheatin' => __('Cheatin’ uh?'), |
|
431 | + 'previewIframeTitle' => __('Site Preview'), |
|
432 | + 'loginIframeTitle' => __('Session expired'), |
|
433 | + 'collapseSidebar' => __('Collapse Sidebar'), |
|
434 | + 'expandSidebar' => __('Expand Sidebar'), |
|
435 | 435 | // Used for overriding the file types allowed in plupload. |
436 | - 'allowedFiles' => __( 'Allowed Files' ), |
|
437 | - ) ); |
|
436 | + 'allowedFiles' => __('Allowed Files'), |
|
437 | + )); |
|
438 | 438 | |
439 | - $scripts->add( 'customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 ); |
|
440 | - $scripts->add( 'customize-preview-widgets', "/wp-includes/js/customize-preview-widgets$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 ); |
|
439 | + $scripts->add('customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array('jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls'), false, 1); |
|
440 | + $scripts->add('customize-preview-widgets', "/wp-includes/js/customize-preview-widgets$suffix.js", array('jquery', 'wp-util', 'customize-preview'), false, 1); |
|
441 | 441 | |
442 | - $scripts->add( 'customize-nav-menus', "/wp-admin/js/customize-nav-menus$suffix.js", array( 'jquery', 'wp-backbone', 'customize-controls', 'accordion', 'nav-menu' ), false, 1 ); |
|
443 | - $scripts->add( 'customize-preview-nav-menus', "/wp-includes/js/customize-preview-nav-menus$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 ); |
|
442 | + $scripts->add('customize-nav-menus', "/wp-admin/js/customize-nav-menus$suffix.js", array('jquery', 'wp-backbone', 'customize-controls', 'accordion', 'nav-menu'), false, 1); |
|
443 | + $scripts->add('customize-preview-nav-menus', "/wp-includes/js/customize-preview-nav-menus$suffix.js", array('jquery', 'wp-util', 'customize-preview'), false, 1); |
|
444 | 444 | |
445 | - $scripts->add( 'accordion', "/wp-admin/js/accordion$suffix.js", array( 'jquery' ), false, 1 ); |
|
445 | + $scripts->add('accordion', "/wp-admin/js/accordion$suffix.js", array('jquery'), false, 1); |
|
446 | 446 | |
447 | - $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 ); |
|
448 | - $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'wp-backbone' ), false, 1 ); |
|
449 | - did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array( |
|
447 | + $scripts->add('shortcode', "/wp-includes/js/shortcode$suffix.js", array('underscore'), false, 1); |
|
448 | + $scripts->add('media-models', "/wp-includes/js/media-models$suffix.js", array('wp-backbone'), false, 1); |
|
449 | + did_action('init') && $scripts->localize('media-models', '_wpMediaModelsL10n', array( |
|
450 | 450 | 'settings' => array( |
451 | - 'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ), |
|
452 | - 'post' => array( 'id' => 0 ), |
|
451 | + 'ajaxurl' => admin_url('admin-ajax.php', 'relative'), |
|
452 | + 'post' => array('id' => 0), |
|
453 | 453 | ), |
454 | - ) ); |
|
454 | + )); |
|
455 | 455 | |
456 | 456 | // To enqueue media-views or media-editor, call wp_enqueue_media(). |
457 | 457 | // Both rely on numerous settings, styles, and templates to operate correctly. |
458 | - $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement' ), false, 1 ); |
|
459 | - $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); |
|
460 | - $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 ); |
|
461 | - $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 ); |
|
462 | - |
|
463 | - if ( is_admin() ) { |
|
464 | - $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 ); |
|
465 | - did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array( |
|
458 | + $scripts->add('media-views', "/wp-includes/js/media-views$suffix.js", array('utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement'), false, 1); |
|
459 | + $scripts->add('media-editor', "/wp-includes/js/media-editor$suffix.js", array('shortcode', 'media-views'), false, 1); |
|
460 | + $scripts->add('media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array('media-editor'), false, 1); |
|
461 | + $scripts->add('mce-view', "/wp-includes/js/mce-view$suffix.js", array('shortcode', 'jquery', 'media-views', 'media-audiovideo'), false, 1); |
|
462 | + |
|
463 | + if (is_admin()) { |
|
464 | + $scripts->add('admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1); |
|
465 | + did_action('init') && $scripts->localize('admin-tags', 'tagsl10n', array( |
|
466 | 466 | 'noPerm' => __('You do not have permission to do that.'), |
467 | 467 | 'broken' => __('An unidentified error has occurred.') |
468 | 468 | )); |
469 | 469 | |
470 | - $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 ); |
|
471 | - did_action( 'init' ) && $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( |
|
470 | + $scripts->add('admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1); |
|
471 | + did_action('init') && $scripts->localize('admin-comments', 'adminCommentsL10n', array( |
|
472 | 472 | 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']), |
473 | 473 | 'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']), |
474 | - 'replyApprove' => __( 'Approve and Reply' ), |
|
475 | - 'reply' => __( 'Reply' ), |
|
476 | - 'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ), |
|
477 | - ) ); |
|
474 | + 'replyApprove' => __('Approve and Reply'), |
|
475 | + 'reply' => __('Reply'), |
|
476 | + 'warnQuickEdit' => __("Are you sure you want to edit this comment?\nThe changes you made will be lost."), |
|
477 | + )); |
|
478 | 478 | |
479 | - $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1 ); |
|
479 | + $scripts->add('xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1); |
|
480 | 480 | |
481 | - $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 ); |
|
481 | + $scripts->add('postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1); |
|
482 | 482 | |
483 | - $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'suggest' ), false, 1 ); |
|
484 | - did_action( 'init' ) && $scripts->localize( 'tags-box', 'tagsBoxL10n', array( |
|
485 | - 'tagDelimiter' => _x( ',', 'tag delimiter' ), |
|
486 | - ) ); |
|
483 | + $scripts->add('tags-box', "/wp-admin/js/tags-box$suffix.js", array('jquery', 'suggest'), false, 1); |
|
484 | + did_action('init') && $scripts->localize('tags-box', 'tagsBoxL10n', array( |
|
485 | + 'tagDelimiter' => _x(',', 'tag delimiter'), |
|
486 | + )); |
|
487 | 487 | |
488 | - $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count' ), false, 1 ); |
|
489 | - did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array( |
|
488 | + $scripts->add('post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count'), false, 1); |
|
489 | + did_action('init') && $scripts->localize('post', 'postL10n', array( |
|
490 | 490 | 'ok' => __('OK'), |
491 | 491 | 'cancel' => __('Cancel'), |
492 | 492 | 'publishOn' => __('Publish on:'), |
@@ -509,128 +509,128 @@ discard block |
||
509 | 509 | 'published' => __('Published'), |
510 | 510 | 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), |
511 | 511 | 'savingText' => __('Saving Draft…'), |
512 | - ) ); |
|
512 | + )); |
|
513 | 513 | |
514 | - $scripts->add( 'press-this', "/wp-admin/js/press-this$suffix.js", array( 'jquery', 'tags-box' ), false, 1 ); |
|
515 | - did_action( 'init' ) && $scripts->localize( 'press-this', 'pressThisL10n', array( |
|
516 | - 'newPost' => __( 'Title' ), |
|
517 | - 'serverError' => __( 'Connection lost or the server is busy. Please try again later.' ), |
|
518 | - 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), |
|
514 | + $scripts->add('press-this', "/wp-admin/js/press-this$suffix.js", array('jquery', 'tags-box'), false, 1); |
|
515 | + did_action('init') && $scripts->localize('press-this', 'pressThisL10n', array( |
|
516 | + 'newPost' => __('Title'), |
|
517 | + 'serverError' => __('Connection lost or the server is busy. Please try again later.'), |
|
518 | + 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), |
|
519 | 519 | /* translators: %d: nth embed found in a post */ |
520 | - 'suggestedEmbedAlt' => __( 'Suggested embed #%d' ), |
|
520 | + 'suggestedEmbedAlt' => __('Suggested embed #%d'), |
|
521 | 521 | /* translators: %d: nth image found in a post */ |
522 | - 'suggestedImgAlt' => __( 'Suggested image #%d' ), |
|
523 | - ) ); |
|
522 | + 'suggestedImgAlt' => __('Suggested image #%d'), |
|
523 | + )); |
|
524 | 524 | |
525 | - $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 ); |
|
525 | + $scripts->add('editor-expand', "/wp-admin/js/editor-expand$suffix.js", array('jquery'), false, 1); |
|
526 | 526 | |
527 | - $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 ); |
|
527 | + $scripts->add('link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), false, 1); |
|
528 | 528 | |
529 | - $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array( 'jquery', 'postbox' ) ); |
|
530 | - $scripts->add_data( 'comment', 'group', 1 ); |
|
531 | - did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array( |
|
532 | - 'submittedOn' => __( 'Submitted on:' ), |
|
529 | + $scripts->add('comment', "/wp-admin/js/comment$suffix.js", array('jquery', 'postbox')); |
|
530 | + $scripts->add_data('comment', 'group', 1); |
|
531 | + did_action('init') && $scripts->localize('comment', 'commentL10n', array( |
|
532 | + 'submittedOn' => __('Submitted on:'), |
|
533 | 533 | /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ |
534 | - 'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ) |
|
535 | - ) ); |
|
534 | + 'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s') |
|
535 | + )); |
|
536 | 536 | |
537 | - $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) ); |
|
537 | + $scripts->add('admin-gallery', "/wp-admin/js/gallery$suffix.js", array('jquery-ui-sortable')); |
|
538 | 538 | |
539 | - $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 ); |
|
539 | + $scripts->add('admin-widgets', "/wp-admin/js/widgets$suffix.js", array('jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable'), false, 1); |
|
540 | 540 | |
541 | - $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y' ), false, 1 ); |
|
541 | + $scripts->add('theme', "/wp-admin/js/theme$suffix.js", array('wp-backbone', 'wp-a11y'), false, 1); |
|
542 | 542 | |
543 | - $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 ); |
|
544 | - did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( |
|
543 | + $scripts->add('inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array('jquery', 'suggest'), false, 1); |
|
544 | + did_action('init') && $scripts->localize('inline-edit-post', 'inlineEditL10n', array( |
|
545 | 545 | 'error' => __('Error while saving the changes.'), |
546 | 546 | 'ntdeltitle' => __('Remove From Bulk Edit'), |
547 | 547 | 'notitle' => __('(no title)'), |
548 | - 'comma' => trim( _x( ',', 'tag delimiter' ) ), |
|
549 | - ) ); |
|
548 | + 'comma' => trim(_x(',', 'tag delimiter')), |
|
549 | + )); |
|
550 | 550 | |
551 | - $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 ); |
|
552 | - did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array( |
|
551 | + $scripts->add('inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array('jquery'), false, 1); |
|
552 | + did_action('init') && $scripts->localize('inline-edit-tax', 'inlineEditL10n', array( |
|
553 | 553 | 'error' => __('Error while saving the changes.') |
554 | - ) ); |
|
554 | + )); |
|
555 | 555 | |
556 | - $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 ); |
|
557 | - did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array( |
|
556 | + $scripts->add('plugin-install', "/wp-admin/js/plugin-install$suffix.js", array('jquery', 'thickbox'), false, 1); |
|
557 | + did_action('init') && $scripts->localize('plugin-install', 'plugininstallL10n', array( |
|
558 | 558 | 'plugin_information' => __('Plugin Information:'), |
559 | 559 | 'ays' => __('Are you sure you want to install this plugin?') |
560 | - ) ); |
|
560 | + )); |
|
561 | 561 | |
562 | - $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ) ); |
|
563 | - did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array( |
|
564 | - 'ajax_nonce' => wp_create_nonce( 'updates' ), |
|
562 | + $scripts->add('updates', "/wp-admin/js/updates$suffix.js", array('jquery', 'wp-util', 'wp-a11y')); |
|
563 | + did_action('init') && $scripts->localize('updates', '_wpUpdatesSettings', array( |
|
564 | + 'ajax_nonce' => wp_create_nonce('updates'), |
|
565 | 565 | 'l10n' => array( |
566 | - 'updating' => __( 'Updating...' ), |
|
567 | - 'updated' => __( 'Updated!' ), |
|
566 | + 'updating' => __('Updating...'), |
|
567 | + 'updated' => __('Updated!'), |
|
568 | 568 | /* translators: Error string for a failed update */ |
569 | - 'updateFailed' => __( 'Update Failed: %s' ), |
|
569 | + 'updateFailed' => __('Update Failed: %s'), |
|
570 | 570 | /* translators: Plugin name and version */ |
571 | - 'updatingLabel' => __( 'Updating %s...' ), |
|
571 | + 'updatingLabel' => __('Updating %s...'), |
|
572 | 572 | /* translators: Plugin name and version */ |
573 | - 'updatedLabel' => __( '%s updated!' ), |
|
573 | + 'updatedLabel' => __('%s updated!'), |
|
574 | 574 | /* translators: Plugin name and version */ |
575 | - 'updateFailedLabel' => __( '%s update failed' ), |
|
575 | + 'updateFailedLabel' => __('%s update failed'), |
|
576 | 576 | /* translators: JavaScript accessible string */ |
577 | - 'updatingMsg' => __( 'Updating... please wait.' ), |
|
577 | + 'updatingMsg' => __('Updating... please wait.'), |
|
578 | 578 | /* translators: JavaScript accessible string */ |
579 | - 'updatedMsg' => __( 'Update completed successfully.' ), |
|
579 | + 'updatedMsg' => __('Update completed successfully.'), |
|
580 | 580 | /* translators: JavaScript accessible string */ |
581 | - 'updateCancel' => __( 'Update canceled.' ), |
|
582 | - 'beforeunload' => __( 'Plugin updates may not complete if you navigate away from this page.' ), |
|
581 | + 'updateCancel' => __('Update canceled.'), |
|
582 | + 'beforeunload' => __('Plugin updates may not complete if you navigate away from this page.'), |
|
583 | 583 | ) |
584 | - ) ); |
|
584 | + )); |
|
585 | 585 | |
586 | - $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); |
|
586 | + $scripts->add('farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2'); |
|
587 | 587 | |
588 | - $scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 ); |
|
589 | - $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 ); |
|
590 | - did_action( 'init' ) && $scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array( |
|
591 | - 'clear' => __( 'Clear' ), |
|
592 | - 'defaultString' => __( 'Default' ), |
|
593 | - 'pick' => __( 'Select Color' ), |
|
594 | - 'current' => __( 'Current Color' ), |
|
595 | - ) ); |
|
588 | + $scripts->add('iris', '/wp-admin/js/iris.min.js', array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), '1.0.7', 1); |
|
589 | + $scripts->add('wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array('iris'), false, 1); |
|
590 | + did_action('init') && $scripts->localize('wp-color-picker', 'wpColorPickerL10n', array( |
|
591 | + 'clear' => __('Clear'), |
|
592 | + 'defaultString' => __('Default'), |
|
593 | + 'pick' => __('Select Color'), |
|
594 | + 'current' => __('Current Color'), |
|
595 | + )); |
|
596 | 596 | |
597 | - $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), false, 1 ); |
|
597 | + $scripts->add('dashboard', "/wp-admin/js/dashboard$suffix.js", array('jquery', 'admin-comments', 'postbox'), false, 1); |
|
598 | 598 | |
599 | - $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" ); |
|
599 | + $scripts->add('list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js"); |
|
600 | 600 | |
601 | - $scripts->add( 'media-grid', "/wp-includes/js/media-grid$suffix.js", array( 'media-editor' ), false, 1 ); |
|
602 | - $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery' ), false, 1 ); |
|
603 | - did_action( 'init' ) && $scripts->localize( 'media', 'attachMediaBoxL10n', array( |
|
604 | - 'error' => __( 'An error has occurred. Please reload the page and try again.' ), |
|
601 | + $scripts->add('media-grid', "/wp-includes/js/media-grid$suffix.js", array('media-editor'), false, 1); |
|
602 | + $scripts->add('media', "/wp-admin/js/media$suffix.js", array('jquery'), false, 1); |
|
603 | + did_action('init') && $scripts->localize('media', 'attachMediaBoxL10n', array( |
|
604 | + 'error' => __('An error has occurred. Please reload the page and try again.'), |
|
605 | 605 | )); |
606 | 606 | |
607 | - $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 ); |
|
608 | - did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array( |
|
609 | - 'error' => __( 'Could not load the preview image. Please reload the page and try again.' ) |
|
607 | + $scripts->add('image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1); |
|
608 | + did_action('init') && $scripts->localize('image-edit', 'imageEditL10n', array( |
|
609 | + 'error' => __('Could not load the preview image. Please reload the page and try again.') |
|
610 | 610 | )); |
611 | 611 | |
612 | - $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); |
|
613 | - did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( |
|
614 | - 'setThumbnail' => __( 'Use as featured image' ), |
|
615 | - 'saving' => __( 'Saving...' ), |
|
616 | - 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), |
|
617 | - 'done' => __( 'Done' ) |
|
618 | - ) ); |
|
612 | + $scripts->add('set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array('jquery'), false, 1); |
|
613 | + did_action('init') && $scripts->localize('set-post-thumbnail', 'setPostThumbnailL10n', array( |
|
614 | + 'setThumbnail' => __('Use as featured image'), |
|
615 | + 'saving' => __('Saving...'), |
|
616 | + 'error' => __('Could not set that as the thumbnail image. Try a different attachment.'), |
|
617 | + 'done' => __('Done') |
|
618 | + )); |
|
619 | 619 | |
620 | 620 | // Navigation Menus |
621 | - $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox' ) ); |
|
622 | - did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array( |
|
623 | - 'noResultsFound' => __( 'No results found.' ), |
|
624 | - 'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ), |
|
625 | - 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), |
|
626 | - 'untitled' => _x( '(no label)', 'missing menu item navigation label' ) |
|
627 | - ) ); |
|
628 | - |
|
629 | - $scripts->add( 'custom-header', "/wp-admin/js/custom-header.js", array( 'jquery-masonry' ), false, 1 ); |
|
630 | - $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'wp-color-picker', 'media-views' ), false, 1 ); |
|
631 | - $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 ); |
|
632 | - |
|
633 | - $scripts->add( 'svg-painter', '/wp-admin/js/svg-painter.js', array( 'jquery' ), false, 1 ); |
|
621 | + $scripts->add('nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox')); |
|
622 | + did_action('init') && $scripts->localize('nav-menu', 'navMenuL10n', array( |
|
623 | + 'noResultsFound' => __('No results found.'), |
|
624 | + 'warnDeleteMenu' => __("You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete."), |
|
625 | + 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), |
|
626 | + 'untitled' => _x('(no label)', 'missing menu item navigation label') |
|
627 | + )); |
|
628 | + |
|
629 | + $scripts->add('custom-header', "/wp-admin/js/custom-header.js", array('jquery-masonry'), false, 1); |
|
630 | + $scripts->add('custom-background', "/wp-admin/js/custom-background$suffix.js", array('wp-color-picker', 'media-views'), false, 1); |
|
631 | + $scripts->add('media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1); |
|
632 | + |
|
633 | + $scripts->add('svg-painter', '/wp-admin/js/svg-painter.js', array('jquery'), false, 1); |
|
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
@@ -649,19 +649,19 @@ discard block |
||
649 | 649 | * |
650 | 650 | * @param WP_Styles $styles |
651 | 651 | */ |
652 | -function wp_default_styles( &$styles ) { |
|
653 | - include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version |
|
652 | +function wp_default_styles(&$styles) { |
|
653 | + include(ABSPATH.WPINC.'/version.php'); // include an unmodified $wp_version |
|
654 | 654 | |
655 | - if ( ! defined( 'SCRIPT_DEBUG' ) ) |
|
656 | - define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) ); |
|
655 | + if ( ! defined('SCRIPT_DEBUG')) |
|
656 | + define('SCRIPT_DEBUG', false !== strpos($wp_version, '-src')); |
|
657 | 657 | |
658 | - if ( ! $guessurl = site_url() ) |
|
658 | + if ( ! $guessurl = site_url()) |
|
659 | 659 | $guessurl = wp_guess_url(); |
660 | 660 | |
661 | 661 | $styles->base_url = $guessurl; |
662 | - $styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : ''; |
|
663 | - $styles->default_version = get_bloginfo( 'version' ); |
|
664 | - $styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr'; |
|
662 | + $styles->content_url = defined('WP_CONTENT_URL') ? WP_CONTENT_URL : ''; |
|
663 | + $styles->default_version = get_bloginfo('version'); |
|
664 | + $styles->text_direction = function_exists('is_rtl') && is_rtl() ? 'rtl' : 'ltr'; |
|
665 | 665 | $styles->default_dirs = array('/wp-admin/', '/wp-includes/css/'); |
666 | 666 | |
667 | 667 | $open_sans_font_url = ''; |
@@ -669,19 +669,19 @@ discard block |
||
669 | 669 | /* translators: If there are characters in your language that are not supported |
670 | 670 | * by Open Sans, translate this to 'off'. Do not translate into your own language. |
671 | 671 | */ |
672 | - if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) { |
|
672 | + if ('off' !== _x('on', 'Open Sans font: on or off')) { |
|
673 | 673 | $subsets = 'latin,latin-ext'; |
674 | 674 | |
675 | 675 | /* translators: To add an additional Open Sans character subset specific to your language, |
676 | 676 | * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. |
677 | 677 | */ |
678 | - $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' ); |
|
678 | + $subset = _x('no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)'); |
|
679 | 679 | |
680 | - if ( 'cyrillic' == $subset ) { |
|
680 | + if ('cyrillic' == $subset) { |
|
681 | 681 | $subsets .= ',cyrillic,cyrillic-ext'; |
682 | - } elseif ( 'greek' == $subset ) { |
|
682 | + } elseif ('greek' == $subset) { |
|
683 | 683 | $subsets .= ',greek,greek-ext'; |
684 | - } elseif ( 'vietnamese' == $subset ) { |
|
684 | + } elseif ('vietnamese' == $subset) { |
|
685 | 685 | $subsets .= ',vietnamese'; |
686 | 686 | } |
687 | 687 | |
@@ -690,48 +690,48 @@ discard block |
||
690 | 690 | } |
691 | 691 | |
692 | 692 | // Register a stylesheet for the selected admin color scheme. |
693 | - $styles->add( 'colors', true, array( 'wp-admin', 'buttons', 'open-sans', 'dashicons' ) ); |
|
693 | + $styles->add('colors', true, array('wp-admin', 'buttons', 'open-sans', 'dashicons')); |
|
694 | 694 | |
695 | 695 | $suffix = SCRIPT_DEBUG ? '' : '.min'; |
696 | 696 | |
697 | 697 | // Admin CSS |
698 | - $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) ); |
|
699 | - $styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'buttons', 'open-sans', 'dashicons' ) ); |
|
700 | - $styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'buttons', 'open-sans' ) ); |
|
701 | - $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" ); |
|
702 | - $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) ); |
|
703 | - $styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) ); |
|
704 | - $styles->add( 'customize-nav-menus', "/wp-admin/css/customize-nav-menus$suffix.css", array( 'wp-admin', 'colors' ) ); |
|
705 | - $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array( 'open-sans', 'buttons' ) ); |
|
706 | - |
|
707 | - $styles->add( 'ie', "/wp-admin/css/ie$suffix.css" ); |
|
708 | - $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); |
|
698 | + $styles->add('wp-admin', "/wp-admin/css/wp-admin$suffix.css", array('open-sans', 'dashicons')); |
|
699 | + $styles->add('login', "/wp-admin/css/login$suffix.css", array('buttons', 'open-sans', 'dashicons')); |
|
700 | + $styles->add('install', "/wp-admin/css/install$suffix.css", array('buttons', 'open-sans')); |
|
701 | + $styles->add('wp-color-picker', "/wp-admin/css/color-picker$suffix.css"); |
|
702 | + $styles->add('customize-controls', "/wp-admin/css/customize-controls$suffix.css", array('wp-admin', 'colors', 'ie', 'imgareaselect')); |
|
703 | + $styles->add('customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array('wp-admin', 'colors')); |
|
704 | + $styles->add('customize-nav-menus', "/wp-admin/css/customize-nav-menus$suffix.css", array('wp-admin', 'colors')); |
|
705 | + $styles->add('press-this', "/wp-admin/css/press-this$suffix.css", array('open-sans', 'buttons')); |
|
706 | + |
|
707 | + $styles->add('ie', "/wp-admin/css/ie$suffix.css"); |
|
708 | + $styles->add_data('ie', 'conditional', 'lte IE 7'); |
|
709 | 709 | |
710 | 710 | // Common dependencies |
711 | - $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); |
|
712 | - $styles->add( 'dashicons', "/wp-includes/css/dashicons$suffix.css" ); |
|
713 | - $styles->add( 'open-sans', $open_sans_font_url ); |
|
711 | + $styles->add('buttons', "/wp-includes/css/buttons$suffix.css"); |
|
712 | + $styles->add('dashicons', "/wp-includes/css/dashicons$suffix.css"); |
|
713 | + $styles->add('open-sans', $open_sans_font_url); |
|
714 | 714 | |
715 | 715 | // Includes CSS |
716 | - $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) ); |
|
717 | - $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) ); |
|
718 | - $styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) ); |
|
719 | - $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) ); |
|
720 | - $styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) ); |
|
721 | - $styles->add( 'customize-preview', "/wp-includes/css/customize-preview$suffix.css" ); |
|
716 | + $styles->add('admin-bar', "/wp-includes/css/admin-bar$suffix.css", array('open-sans', 'dashicons')); |
|
717 | + $styles->add('wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array('dashicons')); |
|
718 | + $styles->add('editor-buttons', "/wp-includes/css/editor$suffix.css", array('dashicons')); |
|
719 | + $styles->add('media-views', "/wp-includes/css/media-views$suffix.css", array('buttons', 'dashicons', 'wp-mediaelement')); |
|
720 | + $styles->add('wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array('dashicons')); |
|
721 | + $styles->add('customize-preview', "/wp-includes/css/customize-preview$suffix.css"); |
|
722 | 722 | |
723 | 723 | // External libraries and friends |
724 | - $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' ); |
|
725 | - $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) ); |
|
726 | - $styles->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.17.0' ); |
|
727 | - $styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) ); |
|
728 | - $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) ); |
|
724 | + $styles->add('imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8'); |
|
725 | + $styles->add('wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array('dashicons')); |
|
726 | + $styles->add('mediaelement', "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.17.0'); |
|
727 | + $styles->add('wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array('mediaelement')); |
|
728 | + $styles->add('thickbox', '/wp-includes/js/thickbox/thickbox.css', array('dashicons')); |
|
729 | 729 | |
730 | 730 | // Deprecated CSS |
731 | - $styles->add( 'media', "/wp-admin/css/deprecated-media$suffix.css" ); |
|
732 | - $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' ); |
|
733 | - $styles->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.12' ); |
|
734 | - $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle. |
|
731 | + $styles->add('media', "/wp-admin/css/deprecated-media$suffix.css"); |
|
732 | + $styles->add('farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1'); |
|
733 | + $styles->add('jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.12'); |
|
734 | + $styles->add('colors-fresh', false, array('wp-admin', 'buttons')); // Old handle. |
|
735 | 735 | |
736 | 736 | // RTL CSS |
737 | 737 | $rtl_styles = array( |
@@ -744,10 +744,10 @@ discard block |
||
744 | 744 | 'media', 'farbtastic', |
745 | 745 | ); |
746 | 746 | |
747 | - foreach ( $rtl_styles as $rtl_style ) { |
|
748 | - $styles->add_data( $rtl_style, 'rtl', 'replace' ); |
|
749 | - if ( $suffix ) { |
|
750 | - $styles->add_data( $rtl_style, 'suffix', $suffix ); |
|
747 | + foreach ($rtl_styles as $rtl_style) { |
|
748 | + $styles->add_data($rtl_style, 'rtl', 'replace'); |
|
749 | + if ($suffix) { |
|
750 | + $styles->add_data($rtl_style, 'suffix', $suffix); |
|
751 | 751 | } |
752 | 752 | } |
753 | 753 | } |
@@ -760,19 +760,19 @@ discard block |
||
760 | 760 | * @param array $js_array JavaScript scripts array |
761 | 761 | * @return array Reordered array, if needed. |
762 | 762 | */ |
763 | -function wp_prototype_before_jquery( $js_array ) { |
|
764 | - if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) |
|
763 | +function wp_prototype_before_jquery($js_array) { |
|
764 | + if (false === $prototype = array_search('prototype', $js_array, true)) |
|
765 | 765 | return $js_array; |
766 | 766 | |
767 | - if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) |
|
767 | + if (false === $jquery = array_search('jquery', $js_array, true)) |
|
768 | 768 | return $js_array; |
769 | 769 | |
770 | - if ( $prototype < $jquery ) |
|
770 | + if ($prototype < $jquery) |
|
771 | 771 | return $js_array; |
772 | 772 | |
773 | 773 | unset($js_array[$prototype]); |
774 | 774 | |
775 | - array_splice( $js_array, $jquery, 0, 'prototype' ); |
|
775 | + array_splice($js_array, $jquery, 0, 'prototype'); |
|
776 | 776 | |
777 | 777 | return $js_array; |
778 | 778 | } |
@@ -786,10 +786,10 @@ discard block |
||
786 | 786 | */ |
787 | 787 | function wp_just_in_time_script_localization() { |
788 | 788 | |
789 | - wp_localize_script( 'autosave', 'autosaveL10n', array( |
|
789 | + wp_localize_script('autosave', 'autosaveL10n', array( |
|
790 | 790 | 'autosaveInterval' => AUTOSAVE_INTERVAL, |
791 | 791 | 'blog_id' => get_current_blog_id(), |
792 | - ) ); |
|
792 | + )); |
|
793 | 793 | |
794 | 794 | } |
795 | 795 | |
@@ -813,29 +813,29 @@ discard block |
||
813 | 813 | * @param string $handle Either 'colors' or 'colors-rtl'. |
814 | 814 | * @return string|false URL path to CSS stylesheet for Administration Screens. |
815 | 815 | */ |
816 | -function wp_style_loader_src( $src, $handle ) { |
|
816 | +function wp_style_loader_src($src, $handle) { |
|
817 | 817 | global $_wp_admin_css_colors; |
818 | 818 | |
819 | - if ( defined('WP_INSTALLING') ) |
|
820 | - return preg_replace( '#^wp-admin/#', './', $src ); |
|
819 | + if (defined('WP_INSTALLING')) |
|
820 | + return preg_replace('#^wp-admin/#', './', $src); |
|
821 | 821 | |
822 | - if ( 'colors' == $handle ) { |
|
822 | + if ('colors' == $handle) { |
|
823 | 823 | $color = get_user_option('admin_color'); |
824 | 824 | |
825 | - if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) |
|
825 | + if (empty($color) || ! isset($_wp_admin_css_colors[$color])) |
|
826 | 826 | $color = 'fresh'; |
827 | 827 | |
828 | 828 | $color = $_wp_admin_css_colors[$color]; |
829 | - $parsed = parse_url( $src ); |
|
829 | + $parsed = parse_url($src); |
|
830 | 830 | $url = $color->url; |
831 | 831 | |
832 | - if ( ! $url ) { |
|
832 | + if ( ! $url) { |
|
833 | 833 | return false; |
834 | 834 | } |
835 | 835 | |
836 | - if ( isset($parsed['query']) && $parsed['query'] ) { |
|
837 | - wp_parse_str( $parsed['query'], $qv ); |
|
838 | - $url = add_query_arg( $qv, $url ); |
|
836 | + if (isset($parsed['query']) && $parsed['query']) { |
|
837 | + wp_parse_str($parsed['query'], $qv); |
|
838 | + $url = add_query_arg($qv, $url); |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | return $url; |
@@ -861,9 +861,9 @@ discard block |
||
861 | 861 | function print_head_scripts() { |
862 | 862 | global $concatenate_scripts; |
863 | 863 | |
864 | - if ( ! did_action('wp_print_scripts') ) { |
|
864 | + if ( ! did_action('wp_print_scripts')) { |
|
865 | 865 | /** This action is documented in wp-includes/functions.wp-scripts.php */ |
866 | - do_action( 'wp_print_scripts' ); |
|
866 | + do_action('wp_print_scripts'); |
|
867 | 867 | } |
868 | 868 | |
869 | 869 | $wp_scripts = wp_scripts(); |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | * |
880 | 880 | * @param bool $print Whether to print the head scripts. Default true. |
881 | 881 | */ |
882 | - if ( apply_filters( 'print_head_scripts', true ) ) { |
|
882 | + if (apply_filters('print_head_scripts', true)) { |
|
883 | 883 | _print_scripts(); |
884 | 884 | } |
885 | 885 | |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | function print_footer_scripts() { |
901 | 901 | global $wp_scripts, $concatenate_scripts; |
902 | 902 | |
903 | - if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { |
|
903 | + if ( ! ($wp_scripts instanceof WP_Scripts)) { |
|
904 | 904 | return array(); // No need to run if not instantiated. |
905 | 905 | } |
906 | 906 | script_concat_settings(); |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | * |
915 | 915 | * @param bool $print Whether to print the footer scripts. Default true. |
916 | 916 | */ |
917 | - if ( apply_filters( 'print_footer_scripts', true ) ) { |
|
917 | + if (apply_filters('print_footer_scripts', true)) { |
|
918 | 918 | _print_scripts(); |
919 | 919 | } |
920 | 920 | |
@@ -934,12 +934,12 @@ discard block |
||
934 | 934 | global $wp_scripts, $compress_scripts; |
935 | 935 | |
936 | 936 | $zip = $compress_scripts ? 1 : 0; |
937 | - if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) |
|
937 | + if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) |
|
938 | 938 | $zip = 'gzip'; |
939 | 939 | |
940 | - if ( $concat = trim( $wp_scripts->concat, ', ' ) ) { |
|
940 | + if ($concat = trim($wp_scripts->concat, ', ')) { |
|
941 | 941 | |
942 | - if ( !empty($wp_scripts->print_code) ) { |
|
942 | + if ( ! empty($wp_scripts->print_code)) { |
|
943 | 943 | echo "\n<script type='text/javascript'>\n"; |
944 | 944 | echo "/* <![CDATA[ */\n"; // not needed in HTML 5 |
945 | 945 | echo $wp_scripts->print_code; |
@@ -947,14 +947,14 @@ discard block |
||
947 | 947 | echo "</script>\n"; |
948 | 948 | } |
949 | 949 | |
950 | - $concat = str_split( $concat, 128 ); |
|
951 | - $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat ); |
|
950 | + $concat = str_split($concat, 128); |
|
951 | + $concat = 'load%5B%5D='.implode('&load%5B%5D=', $concat); |
|
952 | 952 | |
953 | - $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version; |
|
954 | - echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n"; |
|
953 | + $src = $wp_scripts->base_url."/wp-admin/load-scripts.php?c={$zip}&".$concat.'&ver='.$wp_scripts->default_version; |
|
954 | + echo "<script type='text/javascript' src='".esc_attr($src)."'></script>\n"; |
|
955 | 955 | } |
956 | 956 | |
957 | - if ( !empty($wp_scripts->print_html) ) |
|
957 | + if ( ! empty($wp_scripts->print_html)) |
|
958 | 958 | echo $wp_scripts->print_html; |
959 | 959 | } |
960 | 960 | |
@@ -971,14 +971,14 @@ discard block |
||
971 | 971 | * @return array |
972 | 972 | */ |
973 | 973 | function wp_print_head_scripts() { |
974 | - if ( ! did_action('wp_print_scripts') ) { |
|
974 | + if ( ! did_action('wp_print_scripts')) { |
|
975 | 975 | /** This action is documented in wp-includes/functions.wp-scripts.php */ |
976 | - do_action( 'wp_print_scripts' ); |
|
976 | + do_action('wp_print_scripts'); |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | global $wp_scripts; |
980 | 980 | |
981 | - if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { |
|
981 | + if ( ! ($wp_scripts instanceof WP_Scripts)) { |
|
982 | 982 | return array(); // no need to run if nothing is queued |
983 | 983 | } |
984 | 984 | return print_head_scripts(); |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | * |
1006 | 1006 | * @since 2.8.0 |
1007 | 1007 | */ |
1008 | - do_action( 'wp_print_footer_scripts' ); |
|
1008 | + do_action('wp_print_footer_scripts'); |
|
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | /** |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | * |
1023 | 1023 | * @since 2.8.0 |
1024 | 1024 | */ |
1025 | - do_action( 'wp_enqueue_scripts' ); |
|
1025 | + do_action('wp_enqueue_scripts'); |
|
1026 | 1026 | } |
1027 | 1027 | |
1028 | 1028 | /** |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | * |
1051 | 1051 | * @param bool $print Whether to print the admin styles. Default true. |
1052 | 1052 | */ |
1053 | - if ( apply_filters( 'print_admin_styles', true ) ) { |
|
1053 | + if (apply_filters('print_admin_styles', true)) { |
|
1054 | 1054 | _print_styles(); |
1055 | 1055 | } |
1056 | 1056 | |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | function print_late_styles() { |
1072 | 1072 | global $wp_styles, $concatenate_scripts; |
1073 | 1073 | |
1074 | - if ( ! ( $wp_styles instanceof WP_Styles ) ) { |
|
1074 | + if ( ! ($wp_styles instanceof WP_Styles)) { |
|
1075 | 1075 | return; |
1076 | 1076 | } |
1077 | 1077 | |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | * |
1086 | 1086 | * @param bool $print Whether to print the 'late' styles. Default true. |
1087 | 1087 | */ |
1088 | - if ( apply_filters( 'print_late_styles', true ) ) { |
|
1088 | + if (apply_filters('print_late_styles', true)) { |
|
1089 | 1089 | _print_styles(); |
1090 | 1090 | } |
1091 | 1091 | |
@@ -1106,23 +1106,23 @@ discard block |
||
1106 | 1106 | $wp_styles = wp_styles(); |
1107 | 1107 | |
1108 | 1108 | $zip = $compress_css ? 1 : 0; |
1109 | - if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) |
|
1109 | + if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) |
|
1110 | 1110 | $zip = 'gzip'; |
1111 | 1111 | |
1112 | - if ( !empty($wp_styles->concat) ) { |
|
1112 | + if ( ! empty($wp_styles->concat)) { |
|
1113 | 1113 | $dir = $wp_styles->text_direction; |
1114 | 1114 | $ver = $wp_styles->default_version; |
1115 | - $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . '&ver=' . $ver; |
|
1116 | - echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n"; |
|
1115 | + $href = $wp_styles->base_url."/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=".trim($wp_styles->concat, ', ').'&ver='.$ver; |
|
1116 | + echo "<link rel='stylesheet' href='".esc_attr($href)."' type='text/css' media='all' />\n"; |
|
1117 | 1117 | |
1118 | - if ( !empty($wp_styles->print_code) ) { |
|
1118 | + if ( ! empty($wp_styles->print_code)) { |
|
1119 | 1119 | echo "<style type='text/css'>\n"; |
1120 | 1120 | echo $wp_styles->print_code; |
1121 | 1121 | echo "\n</style>\n"; |
1122 | 1122 | } |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - if ( !empty($wp_styles->print_html) ) |
|
1125 | + if ( ! empty($wp_styles->print_html)) |
|
1126 | 1126 | echo $wp_styles->print_html; |
1127 | 1127 | } |
1128 | 1128 | |
@@ -1138,23 +1138,23 @@ discard block |
||
1138 | 1138 | function script_concat_settings() { |
1139 | 1139 | global $concatenate_scripts, $compress_scripts, $compress_css; |
1140 | 1140 | |
1141 | - $compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ); |
|
1141 | + $compressed_output = (ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler')); |
|
1142 | 1142 | |
1143 | - if ( ! isset($concatenate_scripts) ) { |
|
1143 | + if ( ! isset($concatenate_scripts)) { |
|
1144 | 1144 | $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true; |
1145 | - if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ) |
|
1145 | + if ( ! is_admin() || (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)) |
|
1146 | 1146 | $concatenate_scripts = false; |
1147 | 1147 | } |
1148 | 1148 | |
1149 | - if ( ! isset($compress_scripts) ) { |
|
1149 | + if ( ! isset($compress_scripts)) { |
|
1150 | 1150 | $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true; |
1151 | - if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
|
1151 | + if ($compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output)) |
|
1152 | 1152 | $compress_scripts = false; |
1153 | 1153 | } |
1154 | 1154 | |
1155 | - if ( ! isset($compress_css) ) { |
|
1155 | + if ( ! isset($compress_css)) { |
|
1156 | 1156 | $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true; |
1157 | - if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
|
1157 | + if ($compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output)) |
|
1158 | 1158 | $compress_css = false; |
1159 | 1159 | } |
1160 | 1160 | } |
@@ -652,11 +652,13 @@ discard block |
||
652 | 652 | function wp_default_styles( &$styles ) { |
653 | 653 | include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version |
654 | 654 | |
655 | - if ( ! defined( 'SCRIPT_DEBUG' ) ) |
|
656 | - define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) ); |
|
655 | + if ( ! defined( 'SCRIPT_DEBUG' ) ) { |
|
656 | + define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) ); |
|
657 | + } |
|
657 | 658 | |
658 | - if ( ! $guessurl = site_url() ) |
|
659 | - $guessurl = wp_guess_url(); |
|
659 | + if ( ! $guessurl = site_url() ) { |
|
660 | + $guessurl = wp_guess_url(); |
|
661 | + } |
|
660 | 662 | |
661 | 663 | $styles->base_url = $guessurl; |
662 | 664 | $styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : ''; |
@@ -761,14 +763,17 @@ discard block |
||
761 | 763 | * @return array Reordered array, if needed. |
762 | 764 | */ |
763 | 765 | function wp_prototype_before_jquery( $js_array ) { |
764 | - if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) |
|
765 | - return $js_array; |
|
766 | + if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) { |
|
767 | + return $js_array; |
|
768 | + } |
|
766 | 769 | |
767 | - if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) |
|
768 | - return $js_array; |
|
770 | + if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) { |
|
771 | + return $js_array; |
|
772 | + } |
|
769 | 773 | |
770 | - if ( $prototype < $jquery ) |
|
771 | - return $js_array; |
|
774 | + if ( $prototype < $jquery ) { |
|
775 | + return $js_array; |
|
776 | + } |
|
772 | 777 | |
773 | 778 | unset($js_array[$prototype]); |
774 | 779 | |
@@ -816,14 +821,16 @@ discard block |
||
816 | 821 | function wp_style_loader_src( $src, $handle ) { |
817 | 822 | global $_wp_admin_css_colors; |
818 | 823 | |
819 | - if ( defined('WP_INSTALLING') ) |
|
820 | - return preg_replace( '#^wp-admin/#', './', $src ); |
|
824 | + if ( defined('WP_INSTALLING') ) { |
|
825 | + return preg_replace( '#^wp-admin/#', './', $src ); |
|
826 | + } |
|
821 | 827 | |
822 | 828 | if ( 'colors' == $handle ) { |
823 | 829 | $color = get_user_option('admin_color'); |
824 | 830 | |
825 | - if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) |
|
826 | - $color = 'fresh'; |
|
831 | + if ( empty($color) || !isset($_wp_admin_css_colors[$color]) ) { |
|
832 | + $color = 'fresh'; |
|
833 | + } |
|
827 | 834 | |
828 | 835 | $color = $_wp_admin_css_colors[$color]; |
829 | 836 | $parsed = parse_url( $src ); |
@@ -934,8 +941,9 @@ discard block |
||
934 | 941 | global $wp_scripts, $compress_scripts; |
935 | 942 | |
936 | 943 | $zip = $compress_scripts ? 1 : 0; |
937 | - if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) |
|
938 | - $zip = 'gzip'; |
|
944 | + if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) { |
|
945 | + $zip = 'gzip'; |
|
946 | + } |
|
939 | 947 | |
940 | 948 | if ( $concat = trim( $wp_scripts->concat, ', ' ) ) { |
941 | 949 | |
@@ -954,9 +962,10 @@ discard block |
||
954 | 962 | echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n"; |
955 | 963 | } |
956 | 964 | |
957 | - if ( !empty($wp_scripts->print_html) ) |
|
958 | - echo $wp_scripts->print_html; |
|
959 | -} |
|
965 | + if ( !empty($wp_scripts->print_html) ) { |
|
966 | + echo $wp_scripts->print_html; |
|
967 | + } |
|
968 | + } |
|
960 | 969 | |
961 | 970 | /** |
962 | 971 | * Prints the script queue in the HTML head on the front end. |
@@ -1106,8 +1115,9 @@ discard block |
||
1106 | 1115 | $wp_styles = wp_styles(); |
1107 | 1116 | |
1108 | 1117 | $zip = $compress_css ? 1 : 0; |
1109 | - if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) |
|
1110 | - $zip = 'gzip'; |
|
1118 | + if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP ) { |
|
1119 | + $zip = 'gzip'; |
|
1120 | + } |
|
1111 | 1121 | |
1112 | 1122 | if ( !empty($wp_styles->concat) ) { |
1113 | 1123 | $dir = $wp_styles->text_direction; |
@@ -1122,9 +1132,10 @@ discard block |
||
1122 | 1132 | } |
1123 | 1133 | } |
1124 | 1134 | |
1125 | - if ( !empty($wp_styles->print_html) ) |
|
1126 | - echo $wp_styles->print_html; |
|
1127 | -} |
|
1135 | + if ( !empty($wp_styles->print_html) ) { |
|
1136 | + echo $wp_styles->print_html; |
|
1137 | + } |
|
1138 | + } |
|
1128 | 1139 | |
1129 | 1140 | /** |
1130 | 1141 | * Determine the concatenation and compression settings for scripts and styles. |
@@ -1142,19 +1153,22 @@ discard block |
||
1142 | 1153 | |
1143 | 1154 | if ( ! isset($concatenate_scripts) ) { |
1144 | 1155 | $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true; |
1145 | - if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ) |
|
1146 | - $concatenate_scripts = false; |
|
1156 | + if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ) { |
|
1157 | + $concatenate_scripts = false; |
|
1158 | + } |
|
1147 | 1159 | } |
1148 | 1160 | |
1149 | 1161 | if ( ! isset($compress_scripts) ) { |
1150 | 1162 | $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true; |
1151 | - if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
|
1152 | - $compress_scripts = false; |
|
1163 | + if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) { |
|
1164 | + $compress_scripts = false; |
|
1165 | + } |
|
1153 | 1166 | } |
1154 | 1167 | |
1155 | 1168 | if ( ! isset($compress_css) ) { |
1156 | 1169 | $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true; |
1157 | - if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) |
|
1158 | - $compress_css = false; |
|
1170 | + if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) ) { |
|
1171 | + $compress_css = false; |
|
1172 | + } |
|
1159 | 1173 | } |
1160 | 1174 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Facilitates adding of the WordPress editor as used on the Write and Edit screens. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @since 3.3.0 |
|
7 | - * |
|
8 | - * Private, not included by default. See wp_editor() in wp-includes/general-template.php. |
|
9 | - */ |
|
3 | + * Facilitates adding of the WordPress editor as used on the Write and Edit screens. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @since 3.3.0 |
|
7 | + * |
|
8 | + * Private, not included by default. See wp_editor() in wp-includes/general-template.php. |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | final class _WP_Editors { |
12 | 12 | public static $mce_locale; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * } |
63 | 63 | * @return array Parsed arguments array. |
64 | 64 | */ |
65 | - public static function parse_settings( $editor_id, $settings ) { |
|
65 | + public static function parse_settings($editor_id, $settings) { |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Filter the wp_editor() settings. |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | * @param array $settings Array of editor arguments. |
75 | 75 | * @param string $editor_id ID for the current editor instance. |
76 | 76 | */ |
77 | - $settings = apply_filters( 'wp_editor_settings', $settings, $editor_id ); |
|
77 | + $settings = apply_filters('wp_editor_settings', $settings, $editor_id); |
|
78 | 78 | |
79 | - $set = wp_parse_args( $settings, array( |
|
79 | + $set = wp_parse_args($settings, array( |
|
80 | 80 | 'wpautop' => true, |
81 | 81 | 'media_buttons' => true, |
82 | 82 | 'default_editor' => '', |
@@ -92,43 +92,43 @@ discard block |
||
92 | 92 | '_content_editor_dfw' => false, |
93 | 93 | 'tinymce' => true, |
94 | 94 | 'quicktags' => true |
95 | - ) ); |
|
95 | + )); |
|
96 | 96 | |
97 | - self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() ); |
|
97 | + self::$this_tinymce = ($set['tinymce'] && user_can_richedit()); |
|
98 | 98 | |
99 | - if ( self::$this_tinymce ) { |
|
100 | - if ( false !== strpos( $editor_id, '[' ) ) { |
|
99 | + if (self::$this_tinymce) { |
|
100 | + if (false !== strpos($editor_id, '[')) { |
|
101 | 101 | self::$this_tinymce = false; |
102 | - _deprecated_argument( 'wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.' ); |
|
102 | + _deprecated_argument('wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.'); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | 106 | self::$this_quicktags = (bool) $set['quicktags']; |
107 | 107 | |
108 | - if ( self::$this_tinymce ) |
|
108 | + if (self::$this_tinymce) |
|
109 | 109 | self::$has_tinymce = true; |
110 | 110 | |
111 | - if ( self::$this_quicktags ) |
|
111 | + if (self::$this_quicktags) |
|
112 | 112 | self::$has_quicktags = true; |
113 | 113 | |
114 | - if ( $set['dfw'] ) { |
|
114 | + if ($set['dfw']) { |
|
115 | 115 | self::$old_dfw_compat = true; |
116 | 116 | } |
117 | 117 | |
118 | - if ( empty( $set['editor_height'] ) ) |
|
118 | + if (empty($set['editor_height'])) |
|
119 | 119 | return $set; |
120 | 120 | |
121 | - if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) { |
|
121 | + if ('content' === $editor_id && empty($set['tinymce']['wp_autoresize_on'])) { |
|
122 | 122 | // A cookie (set when a user resizes the editor) overrides the height. |
123 | - $cookie = (int) get_user_setting( 'ed_size' ); |
|
123 | + $cookie = (int) get_user_setting('ed_size'); |
|
124 | 124 | |
125 | - if ( $cookie ) |
|
125 | + if ($cookie) |
|
126 | 126 | $set['editor_height'] = $cookie; |
127 | 127 | } |
128 | 128 | |
129 | - if ( $set['editor_height'] < 50 ) |
|
129 | + if ($set['editor_height'] < 50) |
|
130 | 130 | $set['editor_height'] = 50; |
131 | - elseif ( $set['editor_height'] > 5000 ) |
|
131 | + elseif ($set['editor_height'] > 5000) |
|
132 | 132 | $set['editor_height'] = 5000; |
133 | 133 | |
134 | 134 | return $set; |
@@ -142,75 +142,75 @@ discard block |
||
142 | 142 | * @param string $editor_id ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers). |
143 | 143 | * @param array $settings See the _parse_settings() method for description. |
144 | 144 | */ |
145 | - public static function editor( $content, $editor_id, $settings = array() ) { |
|
146 | - $set = self::parse_settings( $editor_id, $settings ); |
|
147 | - $editor_class = ' class="' . trim( esc_attr( $set['editor_class'] ) . ' wp-editor-area' ) . '"'; |
|
148 | - $tabindex = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : ''; |
|
145 | + public static function editor($content, $editor_id, $settings = array()) { |
|
146 | + $set = self::parse_settings($editor_id, $settings); |
|
147 | + $editor_class = ' class="'.trim(esc_attr($set['editor_class']).' wp-editor-area').'"'; |
|
148 | + $tabindex = $set['tabindex'] ? ' tabindex="'.(int) $set['tabindex'].'"' : ''; |
|
149 | 149 | $default_editor = 'html'; |
150 | 150 | $toolbar = $buttons = $autocomplete = ''; |
151 | - $editor_id_attr = esc_attr( $editor_id ); |
|
151 | + $editor_id_attr = esc_attr($editor_id); |
|
152 | 152 | |
153 | - if ( $set['drag_drop_upload'] ) { |
|
153 | + if ($set['drag_drop_upload']) { |
|
154 | 154 | self::$drag_drop_upload = true; |
155 | 155 | } |
156 | 156 | |
157 | - if ( ! empty( $set['editor_height'] ) ) { |
|
158 | - $height = ' style="height: ' . (int) $set['editor_height'] . 'px"'; |
|
157 | + if ( ! empty($set['editor_height'])) { |
|
158 | + $height = ' style="height: '.(int) $set['editor_height'].'px"'; |
|
159 | 159 | } else { |
160 | - $height = ' rows="' . (int) $set['textarea_rows'] . '"'; |
|
160 | + $height = ' rows="'.(int) $set['textarea_rows'].'"'; |
|
161 | 161 | } |
162 | 162 | |
163 | - if ( ! current_user_can( 'upload_files' ) ) { |
|
163 | + if ( ! current_user_can('upload_files')) { |
|
164 | 164 | $set['media_buttons'] = false; |
165 | 165 | } |
166 | 166 | |
167 | - if ( self::$this_tinymce ) { |
|
167 | + if (self::$this_tinymce) { |
|
168 | 168 | $autocomplete = ' autocomplete="off"'; |
169 | 169 | |
170 | - if ( self::$this_quicktags ) { |
|
170 | + if (self::$this_quicktags) { |
|
171 | 171 | $default_editor = $set['default_editor'] ? $set['default_editor'] : wp_default_editor(); |
172 | 172 | // 'html' is used for the "Text" editor tab. |
173 | - if ( 'html' !== $default_editor ) { |
|
173 | + if ('html' !== $default_editor) { |
|
174 | 174 | $default_editor = 'tinymce'; |
175 | 175 | } |
176 | 176 | |
177 | - $buttons .= '<button type="button" id="' . $editor_id_attr . '-tmce" class="wp-switch-editor switch-tmce"' . |
|
178 | - ' data-wp-editor-id="' . $editor_id_attr . '">' . __('Visual') . "</button>\n"; |
|
179 | - $buttons .= '<button type="button" id="' . $editor_id_attr . '-html" class="wp-switch-editor switch-html"' . |
|
180 | - ' data-wp-editor-id="' . $editor_id_attr . '">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n"; |
|
177 | + $buttons .= '<button type="button" id="'.$editor_id_attr.'-tmce" class="wp-switch-editor switch-tmce"'. |
|
178 | + ' data-wp-editor-id="'.$editor_id_attr.'">'.__('Visual')."</button>\n"; |
|
179 | + $buttons .= '<button type="button" id="'.$editor_id_attr.'-html" class="wp-switch-editor switch-html"'. |
|
180 | + ' data-wp-editor-id="'.$editor_id_attr.'">'._x('Text', 'Name for the Text editor tab (formerly HTML)')."</button>\n"; |
|
181 | 181 | } else { |
182 | 182 | $default_editor = 'tinymce'; |
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
186 | 186 | $switch_class = 'html' === $default_editor ? 'html-active' : 'tmce-active'; |
187 | - $wrap_class = 'wp-core-ui wp-editor-wrap ' . $switch_class; |
|
187 | + $wrap_class = 'wp-core-ui wp-editor-wrap '.$switch_class; |
|
188 | 188 | |
189 | - if ( $set['_content_editor_dfw'] ) { |
|
189 | + if ($set['_content_editor_dfw']) { |
|
190 | 190 | $wrap_class .= ' has-dfw'; |
191 | 191 | } |
192 | 192 | |
193 | - echo '<div id="wp-' . $editor_id_attr . '-wrap" class="' . $wrap_class . '">'; |
|
193 | + echo '<div id="wp-'.$editor_id_attr.'-wrap" class="'.$wrap_class.'">'; |
|
194 | 194 | |
195 | - if ( self::$editor_buttons_css ) { |
|
196 | - wp_print_styles( 'editor-buttons' ); |
|
195 | + if (self::$editor_buttons_css) { |
|
196 | + wp_print_styles('editor-buttons'); |
|
197 | 197 | self::$editor_buttons_css = false; |
198 | 198 | } |
199 | 199 | |
200 | - if ( ! empty( $set['editor_css'] ) ) { |
|
201 | - echo $set['editor_css'] . "\n"; |
|
200 | + if ( ! empty($set['editor_css'])) { |
|
201 | + echo $set['editor_css']."\n"; |
|
202 | 202 | } |
203 | 203 | |
204 | - if ( ! empty( $buttons ) || $set['media_buttons'] ) { |
|
205 | - echo '<div id="wp-' . $editor_id_attr . '-editor-tools" class="wp-editor-tools hide-if-no-js">'; |
|
204 | + if ( ! empty($buttons) || $set['media_buttons']) { |
|
205 | + echo '<div id="wp-'.$editor_id_attr.'-editor-tools" class="wp-editor-tools hide-if-no-js">'; |
|
206 | 206 | |
207 | - if ( $set['media_buttons'] ) { |
|
207 | + if ($set['media_buttons']) { |
|
208 | 208 | self::$has_medialib = true; |
209 | 209 | |
210 | - if ( ! function_exists( 'media_buttons' ) ) |
|
211 | - include( ABSPATH . 'wp-admin/includes/media.php' ); |
|
210 | + if ( ! function_exists('media_buttons')) |
|
211 | + include(ABSPATH.'wp-admin/includes/media.php'); |
|
212 | 212 | |
213 | - echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">'; |
|
213 | + echo '<div id="wp-'.$editor_id_attr.'-media-buttons" class="wp-media-buttons">'; |
|
214 | 214 | |
215 | 215 | /** |
216 | 216 | * Fires after the default media button(s) are displayed. |
@@ -219,24 +219,24 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
221 | 221 | */ |
222 | - do_action( 'media_buttons', $editor_id ); |
|
222 | + do_action('media_buttons', $editor_id); |
|
223 | 223 | echo "</div>\n"; |
224 | 224 | } |
225 | 225 | |
226 | - echo '<div class="wp-editor-tabs">' . $buttons . "</div>\n"; |
|
226 | + echo '<div class="wp-editor-tabs">'.$buttons."</div>\n"; |
|
227 | 227 | echo "</div>\n"; |
228 | 228 | } |
229 | 229 | |
230 | 230 | $quicktags_toolbar = ''; |
231 | 231 | |
232 | - if ( self::$this_quicktags ) { |
|
233 | - if ( 'content' === $editor_id && ! empty( $GLOBALS['current_screen'] ) && $GLOBALS['current_screen']->base === 'post' ) { |
|
232 | + if (self::$this_quicktags) { |
|
233 | + if ('content' === $editor_id && ! empty($GLOBALS['current_screen']) && $GLOBALS['current_screen']->base === 'post') { |
|
234 | 234 | $toolbar_id = 'ed_toolbar'; |
235 | 235 | } else { |
236 | - $toolbar_id = 'qt_' . $editor_id_attr . '_toolbar'; |
|
236 | + $toolbar_id = 'qt_'.$editor_id_attr.'_toolbar'; |
|
237 | 237 | } |
238 | 238 | |
239 | - $quicktags_toolbar = '<div id="' . $toolbar_id . '" class="quicktags-toolbar"></div>'; |
|
239 | + $quicktags_toolbar = '<div id="'.$toolbar_id.'" class="quicktags-toolbar"></div>'; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | * |
247 | 247 | * @param string $output Editor's HTML markup. |
248 | 248 | */ |
249 | - $the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' . |
|
250 | - $quicktags_toolbar . |
|
251 | - '<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' . |
|
252 | - 'id="' . $editor_id_attr . '">%s</textarea></div>' ); |
|
249 | + $the_editor = apply_filters('the_editor', '<div id="wp-'.$editor_id_attr.'-editor-container" class="wp-editor-container">'. |
|
250 | + $quicktags_toolbar. |
|
251 | + '<textarea'.$editor_class.$height.$tabindex.$autocomplete.' cols="40" name="'.esc_attr($set['textarea_name']).'" '. |
|
252 | + 'id="'.$editor_id_attr.'">%s</textarea></div>'); |
|
253 | 253 | |
254 | 254 | // Prepare the content for the Visual or Text editor |
255 | - if ( self::$this_tinymce ) { |
|
256 | - add_filter( 'the_editor_content', 'format_for_editor', 10, 2 ); |
|
255 | + if (self::$this_tinymce) { |
|
256 | + add_filter('the_editor_content', 'format_for_editor', 10, 2); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -263,26 +263,26 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @param string $content Default editor content. |
265 | 265 | */ |
266 | - $content = apply_filters( 'the_editor_content', $content, $default_editor ); |
|
266 | + $content = apply_filters('the_editor_content', $content, $default_editor); |
|
267 | 267 | |
268 | 268 | // Back-compat for the `htmledit_pre` and `richedit_pre` filters |
269 | - if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) { |
|
269 | + if ('html' === $default_editor && has_filter('htmledit_pre')) { |
|
270 | 270 | // TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now |
271 | - _deprecated_function( 'add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )' ); |
|
272 | - $content = apply_filters( 'htmledit_pre', $content ); |
|
273 | - } elseif ( 'tinymce' === $default_editor && has_filter( 'richedit_pre' ) ) { |
|
274 | - _deprecated_function( 'add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )' ); |
|
275 | - $content = apply_filters( 'richedit_pre', $content ); |
|
271 | + _deprecated_function('add_filter( htmledit_pre )', '4.3.0', 'add_filter( format_for_editor )'); |
|
272 | + $content = apply_filters('htmledit_pre', $content); |
|
273 | + } elseif ('tinymce' === $default_editor && has_filter('richedit_pre')) { |
|
274 | + _deprecated_function('add_filter( richedit_pre )', '4.3.0', 'add_filter( format_for_editor )'); |
|
275 | + $content = apply_filters('richedit_pre', $content); |
|
276 | 276 | } |
277 | 277 | |
278 | - if ( false !== stripos( $content, 'textarea' ) ) { |
|
279 | - $content = preg_replace( '%</textarea%i', '</textarea', $content ); |
|
278 | + if (false !== stripos($content, 'textarea')) { |
|
279 | + $content = preg_replace('%</textarea%i', '</textarea', $content); |
|
280 | 280 | } |
281 | 281 | |
282 | - printf( $the_editor, $content ); |
|
282 | + printf($the_editor, $content); |
|
283 | 283 | echo "\n</div>\n\n"; |
284 | 284 | |
285 | - self::editor_settings( $editor_id, $set ); |
|
285 | + self::editor_settings($editor_id, $set); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
@@ -299,30 +299,30 @@ discard block |
||
299 | 299 | |
300 | 300 | $first_run = false; |
301 | 301 | |
302 | - if ( empty(self::$first_init) ) { |
|
303 | - if ( is_admin() ) { |
|
304 | - add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 ); |
|
305 | - add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 ); |
|
302 | + if (empty(self::$first_init)) { |
|
303 | + if (is_admin()) { |
|
304 | + add_action('admin_print_footer_scripts', array(__CLASS__, 'editor_js'), 50); |
|
305 | + add_action('admin_print_footer_scripts', array(__CLASS__, 'enqueue_scripts'), 1); |
|
306 | 306 | } else { |
307 | - add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 ); |
|
308 | - add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 ); |
|
307 | + add_action('wp_print_footer_scripts', array(__CLASS__, 'editor_js'), 50); |
|
308 | + add_action('wp_print_footer_scripts', array(__CLASS__, 'enqueue_scripts'), 1); |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | |
312 | - if ( self::$this_quicktags ) { |
|
312 | + if (self::$this_quicktags) { |
|
313 | 313 | |
314 | 314 | $qtInit = array( |
315 | 315 | 'id' => $editor_id, |
316 | 316 | 'buttons' => '' |
317 | 317 | ); |
318 | 318 | |
319 | - if ( is_array($set['quicktags']) ) |
|
319 | + if (is_array($set['quicktags'])) |
|
320 | 320 | $qtInit = array_merge($qtInit, $set['quicktags']); |
321 | 321 | |
322 | - if ( empty($qtInit['buttons']) ) |
|
322 | + if (empty($qtInit['buttons'])) |
|
323 | 323 | $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; |
324 | 324 | |
325 | - if ( $set['_content_editor_dfw'] ) { |
|
325 | + if ($set['_content_editor_dfw']) { |
|
326 | 326 | $qtInit['buttons'] .= ',dfw'; |
327 | 327 | } |
328 | 328 | |
@@ -334,27 +334,27 @@ discard block |
||
334 | 334 | * @param array $qtInit Quicktags settings. |
335 | 335 | * @param string $editor_id The unique editor ID, e.g. 'content'. |
336 | 336 | */ |
337 | - $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id ); |
|
337 | + $qtInit = apply_filters('quicktags_settings', $qtInit, $editor_id); |
|
338 | 338 | |
339 | 339 | self::$qt_settings[$editor_id] = $qtInit; |
340 | 340 | |
341 | - self::$qt_buttons = array_merge( self::$qt_buttons, explode(',', $qtInit['buttons']) ); |
|
341 | + self::$qt_buttons = array_merge(self::$qt_buttons, explode(',', $qtInit['buttons'])); |
|
342 | 342 | } |
343 | 343 | |
344 | - if ( self::$this_tinymce ) { |
|
344 | + if (self::$this_tinymce) { |
|
345 | 345 | |
346 | - if ( empty( self::$first_init ) ) { |
|
347 | - self::$baseurl = includes_url( 'js/tinymce' ); |
|
346 | + if (empty(self::$first_init)) { |
|
347 | + self::$baseurl = includes_url('js/tinymce'); |
|
348 | 348 | |
349 | 349 | $mce_locale = get_locale(); |
350 | - self::$mce_locale = $mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1 |
|
350 | + self::$mce_locale = $mce_locale = empty($mce_locale) ? 'en' : strtolower(substr($mce_locale, 0, 2)); // ISO 639-1 |
|
351 | 351 | |
352 | 352 | /** This filter is documented in wp-admin/includes/media.php */ |
353 | - $no_captions = (bool) apply_filters( 'disable_captions', '' ); |
|
353 | + $no_captions = (bool) apply_filters('disable_captions', ''); |
|
354 | 354 | $first_run = true; |
355 | 355 | $ext_plugins = ''; |
356 | 356 | |
357 | - if ( $set['teeny'] ) { |
|
357 | + if ($set['teeny']) { |
|
358 | 358 | |
359 | 359 | /** |
360 | 360 | * Filter the list of teenyMCE plugins. |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * @param array $plugins An array of teenyMCE plugins. |
365 | 365 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
366 | 366 | */ |
367 | - self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'colorpicker', 'lists', 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id ); |
|
367 | + self::$plugins = $plugins = apply_filters('teeny_mce_plugins', array('colorpicker', 'lists', 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink'), $editor_id); |
|
368 | 368 | } else { |
369 | 369 | |
370 | 370 | /** |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * |
385 | 385 | * @param array $external_plugins An array of external TinyMCE plugins. |
386 | 386 | */ |
387 | - $mce_external_plugins = apply_filters( 'mce_external_plugins', array() ); |
|
387 | + $mce_external_plugins = apply_filters('mce_external_plugins', array()); |
|
388 | 388 | |
389 | 389 | $plugins = array( |
390 | 390 | 'charmap', |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | 'wpview' |
408 | 408 | ); |
409 | 409 | |
410 | - if ( ! self::$has_medialib ) { |
|
410 | + if ( ! self::$has_medialib) { |
|
411 | 411 | $plugins[] = 'image'; |
412 | 412 | } |
413 | 413 | |
@@ -421,15 +421,15 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @param array $plugins An array of default TinyMCE plugins. |
423 | 423 | */ |
424 | - $plugins = array_unique( apply_filters( 'tiny_mce_plugins', $plugins ) ); |
|
424 | + $plugins = array_unique(apply_filters('tiny_mce_plugins', $plugins)); |
|
425 | 425 | |
426 | - if ( ( $key = array_search( 'spellchecker', $plugins ) ) !== false ) { |
|
426 | + if (($key = array_search('spellchecker', $plugins)) !== false) { |
|
427 | 427 | // Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors. |
428 | 428 | // It can be added with 'mce_external_plugins'. |
429 | - unset( $plugins[$key] ); |
|
429 | + unset($plugins[$key]); |
|
430 | 430 | } |
431 | 431 | |
432 | - if ( ! empty( $mce_external_plugins ) ) { |
|
432 | + if ( ! empty($mce_external_plugins)) { |
|
433 | 433 | |
434 | 434 | /** |
435 | 435 | * Filter the translations loaded for external TinyMCE 3.x plugins. |
@@ -444,64 +444,64 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @param array $translations Translations for external TinyMCE plugins. |
446 | 446 | */ |
447 | - $mce_external_languages = apply_filters( 'mce_external_languages', array() ); |
|
447 | + $mce_external_languages = apply_filters('mce_external_languages', array()); |
|
448 | 448 | |
449 | 449 | $loaded_langs = array(); |
450 | 450 | $strings = ''; |
451 | 451 | |
452 | - if ( ! empty( $mce_external_languages ) ) { |
|
453 | - foreach ( $mce_external_languages as $name => $path ) { |
|
454 | - if ( @is_file( $path ) && @is_readable( $path ) ) { |
|
455 | - include_once( $path ); |
|
456 | - $ext_plugins .= $strings . "\n"; |
|
452 | + if ( ! empty($mce_external_languages)) { |
|
453 | + foreach ($mce_external_languages as $name => $path) { |
|
454 | + if (@is_file($path) && @is_readable($path)) { |
|
455 | + include_once($path); |
|
456 | + $ext_plugins .= $strings."\n"; |
|
457 | 457 | $loaded_langs[] = $name; |
458 | 458 | } |
459 | 459 | } |
460 | 460 | } |
461 | 461 | |
462 | - foreach ( $mce_external_plugins as $name => $url ) { |
|
463 | - if ( in_array( $name, $plugins, true ) ) { |
|
464 | - unset( $mce_external_plugins[ $name ] ); |
|
462 | + foreach ($mce_external_plugins as $name => $url) { |
|
463 | + if (in_array($name, $plugins, true)) { |
|
464 | + unset($mce_external_plugins[$name]); |
|
465 | 465 | continue; |
466 | 466 | } |
467 | 467 | |
468 | - $url = set_url_scheme( $url ); |
|
469 | - $mce_external_plugins[ $name ] = $url; |
|
470 | - $plugurl = dirname( $url ); |
|
468 | + $url = set_url_scheme($url); |
|
469 | + $mce_external_plugins[$name] = $url; |
|
470 | + $plugurl = dirname($url); |
|
471 | 471 | $strings = ''; |
472 | 472 | |
473 | 473 | // Try to load langs/[locale].js and langs/[locale]_dlg.js |
474 | - if ( ! in_array( $name, $loaded_langs, true ) ) { |
|
475 | - $path = str_replace( content_url(), '', $plugurl ); |
|
476 | - $path = WP_CONTENT_DIR . $path . '/langs/'; |
|
474 | + if ( ! in_array($name, $loaded_langs, true)) { |
|
475 | + $path = str_replace(content_url(), '', $plugurl); |
|
476 | + $path = WP_CONTENT_DIR.$path.'/langs/'; |
|
477 | 477 | |
478 | - if ( function_exists('realpath') ) |
|
479 | - $path = trailingslashit( realpath($path) ); |
|
478 | + if (function_exists('realpath')) |
|
479 | + $path = trailingslashit(realpath($path)); |
|
480 | 480 | |
481 | - if ( @is_file( $path . $mce_locale . '.js' ) ) |
|
482 | - $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; |
|
481 | + if (@is_file($path.$mce_locale.'.js')) |
|
482 | + $strings .= @file_get_contents($path.$mce_locale.'.js')."\n"; |
|
483 | 483 | |
484 | - if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) |
|
485 | - $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n"; |
|
484 | + if (@is_file($path.$mce_locale.'_dlg.js')) |
|
485 | + $strings .= @file_get_contents($path.$mce_locale.'_dlg.js')."\n"; |
|
486 | 486 | |
487 | - if ( 'en' != $mce_locale && empty( $strings ) ) { |
|
488 | - if ( @is_file( $path . 'en.js' ) ) { |
|
489 | - $str1 = @file_get_contents( $path . 'en.js' ); |
|
490 | - $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; |
|
487 | + if ('en' != $mce_locale && empty($strings)) { |
|
488 | + if (@is_file($path.'en.js')) { |
|
489 | + $str1 = @file_get_contents($path.'en.js'); |
|
490 | + $strings .= preg_replace('/([\'"])en\./', '$1'.$mce_locale.'.', $str1, 1)."\n"; |
|
491 | 491 | } |
492 | 492 | |
493 | - if ( @is_file( $path . 'en_dlg.js' ) ) { |
|
494 | - $str2 = @file_get_contents( $path . 'en_dlg.js' ); |
|
495 | - $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; |
|
493 | + if (@is_file($path.'en_dlg.js')) { |
|
494 | + $str2 = @file_get_contents($path.'en_dlg.js'); |
|
495 | + $strings .= preg_replace('/([\'"])en\./', '$1'.$mce_locale.'.', $str2, 1)."\n"; |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
499 | - if ( ! empty( $strings ) ) |
|
500 | - $ext_plugins .= "\n" . $strings . "\n"; |
|
499 | + if ( ! empty($strings)) |
|
500 | + $ext_plugins .= "\n".$strings."\n"; |
|
501 | 501 | } |
502 | 502 | |
503 | - $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; |
|
504 | - $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n"; |
|
503 | + $ext_plugins .= 'tinyMCEPreInit.load_ext("'.$plugurl.'", "'.$mce_locale.'");'."\n"; |
|
504 | + $ext_plugins .= 'tinymce.PluginManager.load("'.$name.'", "'.$url.'");'."\n"; |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | } |
@@ -513,20 +513,20 @@ discard block |
||
513 | 513 | 'theme' => 'modern', |
514 | 514 | 'skin' => 'lightgray', |
515 | 515 | 'language' => self::$mce_locale, |
516 | - 'formats' => '{' . |
|
517 | - 'alignleft: [' . |
|
518 | - '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' . |
|
519 | - '{selector: "img,table,dl.wp-caption", classes: "alignleft"}' . |
|
520 | - '],' . |
|
521 | - 'aligncenter: [' . |
|
522 | - '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},' . |
|
523 | - '{selector: "img,table,dl.wp-caption", classes: "aligncenter"}' . |
|
524 | - '],' . |
|
525 | - 'alignright: [' . |
|
526 | - '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},' . |
|
527 | - '{selector: "img,table,dl.wp-caption", classes: "alignright"}' . |
|
528 | - '],' . |
|
529 | - 'strikethrough: {inline: "del"}' . |
|
516 | + 'formats' => '{'. |
|
517 | + 'alignleft: ['. |
|
518 | + '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},'. |
|
519 | + '{selector: "img,table,dl.wp-caption", classes: "alignleft"}'. |
|
520 | + '],'. |
|
521 | + 'aligncenter: ['. |
|
522 | + '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},'. |
|
523 | + '{selector: "img,table,dl.wp-caption", classes: "aligncenter"}'. |
|
524 | + '],'. |
|
525 | + 'alignright: ['. |
|
526 | + '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},'. |
|
527 | + '{selector: "img,table,dl.wp-caption", classes: "alignright"}'. |
|
528 | + '],'. |
|
529 | + 'strikethrough: {inline: "del"}'. |
|
530 | 530 | '}', |
531 | 531 | 'relative_urls' => false, |
532 | 532 | 'remove_script_host' => false, |
@@ -536,34 +536,34 @@ discard block |
||
536 | 536 | 'entities' => '38,amp,60,lt,62,gt', |
537 | 537 | 'entity_encoding' => 'raw', |
538 | 538 | 'keep_styles' => false, |
539 | - 'cache_suffix' => 'wp-mce-' . $tinymce_version, |
|
539 | + 'cache_suffix' => 'wp-mce-'.$tinymce_version, |
|
540 | 540 | |
541 | 541 | // Limit the preview styles in the menu/toolbar |
542 | 542 | 'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform', |
543 | 543 | |
544 | 544 | 'end_container_on_empty_block' => true, |
545 | 545 | 'wpeditimage_disable_captions' => $no_captions, |
546 | - 'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ), |
|
547 | - 'plugins' => implode( ',', $plugins ), |
|
546 | + 'wpeditimage_html5_captions' => current_theme_supports('html5', 'caption'), |
|
547 | + 'plugins' => implode(',', $plugins), |
|
548 | 548 | ); |
549 | 549 | |
550 | - if ( ! empty( $mce_external_plugins ) ) { |
|
551 | - self::$first_init['external_plugins'] = wp_json_encode( $mce_external_plugins ); |
|
550 | + if ( ! empty($mce_external_plugins)) { |
|
551 | + self::$first_init['external_plugins'] = wp_json_encode($mce_external_plugins); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | $suffix = SCRIPT_DEBUG ? '' : '.min'; |
555 | - $version = 'ver=' . $wp_version; |
|
556 | - $dashicons = includes_url( "css/dashicons$suffix.css?$version" ); |
|
555 | + $version = 'ver='.$wp_version; |
|
556 | + $dashicons = includes_url("css/dashicons$suffix.css?$version"); |
|
557 | 557 | |
558 | 558 | // WordPress default stylesheet and dashicons |
559 | 559 | $mce_css = array( |
560 | 560 | $dashicons, |
561 | - self::$baseurl . '/skins/wordpress/wp-content.css?' . $version |
|
561 | + self::$baseurl.'/skins/wordpress/wp-content.css?'.$version |
|
562 | 562 | ); |
563 | 563 | |
564 | 564 | $editor_styles = get_editor_stylesheets(); |
565 | - if ( ! empty( $editor_styles ) ) { |
|
566 | - foreach ( $editor_styles as $style ) { |
|
565 | + if ( ! empty($editor_styles)) { |
|
566 | + foreach ($editor_styles as $style) { |
|
567 | 567 | $mce_css[] = $style; |
568 | 568 | } |
569 | 569 | } |
@@ -575,13 +575,13 @@ discard block |
||
575 | 575 | * |
576 | 576 | * @param array $stylesheets Comma-delimited list of stylesheets. |
577 | 577 | */ |
578 | - $mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' ); |
|
578 | + $mce_css = trim(apply_filters('mce_css', implode(',', $mce_css)), ' ,'); |
|
579 | 579 | |
580 | - if ( ! empty($mce_css) ) |
|
580 | + if ( ! empty($mce_css)) |
|
581 | 581 | self::$first_init['content_css'] = $mce_css; |
582 | 582 | } |
583 | 583 | |
584 | - if ( $set['teeny'] ) { |
|
584 | + if ($set['teeny']) { |
|
585 | 585 | |
586 | 586 | /** |
587 | 587 | * Filter the list of teenyMCE buttons (Text tab). |
@@ -591,12 +591,12 @@ discard block |
||
591 | 591 | * @param array $buttons An array of teenyMCE buttons. |
592 | 592 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
593 | 593 | */ |
594 | - $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ); |
|
594 | + $mce_buttons = apply_filters('teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id); |
|
595 | 595 | $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array(); |
596 | 596 | } else { |
597 | - $mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker' ); |
|
597 | + $mce_buttons = array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker'); |
|
598 | 598 | |
599 | - if ( $set['_content_editor_dfw'] ) { |
|
599 | + if ($set['_content_editor_dfw']) { |
|
600 | 600 | $mce_buttons[] = 'dfw'; |
601 | 601 | } else { |
602 | 602 | $mce_buttons[] = 'fullscreen'; |
@@ -612,11 +612,11 @@ discard block |
||
612 | 612 | * @param array $buttons First-row list of buttons. |
613 | 613 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
614 | 614 | */ |
615 | - $mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id ); |
|
615 | + $mce_buttons = apply_filters('mce_buttons', $mce_buttons, $editor_id); |
|
616 | 616 | |
617 | - $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' ); |
|
617 | + $mce_buttons_2 = array('formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo'); |
|
618 | 618 | |
619 | - if ( ! wp_is_mobile() ) { |
|
619 | + if ( ! wp_is_mobile()) { |
|
620 | 620 | $mce_buttons_2[] = 'wp_help'; |
621 | 621 | } |
622 | 622 | |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | * @param array $buttons Second-row list of buttons. |
629 | 629 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
630 | 630 | */ |
631 | - $mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id ); |
|
631 | + $mce_buttons_2 = apply_filters('mce_buttons_2', $mce_buttons_2, $editor_id); |
|
632 | 632 | |
633 | 633 | /** |
634 | 634 | * Filter the third-row list of TinyMCE buttons (Visual tab). |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | * @param array $buttons Third-row list of buttons. |
639 | 639 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
640 | 640 | */ |
641 | - $mce_buttons_3 = apply_filters( 'mce_buttons_3', array(), $editor_id ); |
|
641 | + $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id); |
|
642 | 642 | |
643 | 643 | /** |
644 | 644 | * Filter the fourth-row list of TinyMCE buttons (Visual tab). |
@@ -648,30 +648,30 @@ discard block |
||
648 | 648 | * @param array $buttons Fourth-row list of buttons. |
649 | 649 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
650 | 650 | */ |
651 | - $mce_buttons_4 = apply_filters( 'mce_buttons_4', array(), $editor_id ); |
|
651 | + $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id); |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | $body_class = $editor_id; |
655 | 655 | |
656 | - if ( $post = get_post() ) { |
|
657 | - $body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status ); |
|
658 | - if ( post_type_supports( $post->post_type, 'post-formats' ) ) { |
|
659 | - $post_format = get_post_format( $post ); |
|
660 | - if ( $post_format && ! is_wp_error( $post_format ) ) |
|
661 | - $body_class .= ' post-format-' . sanitize_html_class( $post_format ); |
|
656 | + if ($post = get_post()) { |
|
657 | + $body_class .= ' post-type-'.sanitize_html_class($post->post_type).' post-status-'.sanitize_html_class($post->post_status); |
|
658 | + if (post_type_supports($post->post_type, 'post-formats')) { |
|
659 | + $post_format = get_post_format($post); |
|
660 | + if ($post_format && ! is_wp_error($post_format)) |
|
661 | + $body_class .= ' post-format-'.sanitize_html_class($post_format); |
|
662 | 662 | else |
663 | 663 | $body_class .= ' post-format-standard'; |
664 | 664 | } |
665 | 665 | } |
666 | 666 | |
667 | - $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); |
|
667 | + $body_class .= ' locale-'.sanitize_html_class(strtolower(str_replace('_', '-', get_locale()))); |
|
668 | 668 | |
669 | - if ( !empty($set['tinymce']['body_class']) ) { |
|
670 | - $body_class .= ' ' . $set['tinymce']['body_class']; |
|
669 | + if ( ! empty($set['tinymce']['body_class'])) { |
|
670 | + $body_class .= ' '.$set['tinymce']['body_class']; |
|
671 | 671 | unset($set['tinymce']['body_class']); |
672 | 672 | } |
673 | 673 | |
674 | - $mceInit = array ( |
|
674 | + $mceInit = array( |
|
675 | 675 | 'selector' => "#$editor_id", |
676 | 676 | 'resize' => 'vertical', |
677 | 677 | 'menubar' => false, |
@@ -686,10 +686,10 @@ discard block |
||
686 | 686 | ); |
687 | 687 | |
688 | 688 | // Merge with the first part of the init array |
689 | - $mceInit = array_merge( self::$first_init, $mceInit ); |
|
689 | + $mceInit = array_merge(self::$first_init, $mceInit); |
|
690 | 690 | |
691 | - if ( is_array( $set['tinymce'] ) ) |
|
692 | - $mceInit = array_merge( $mceInit, $set['tinymce'] ); |
|
691 | + if (is_array($set['tinymce'])) |
|
692 | + $mceInit = array_merge($mceInit, $set['tinymce']); |
|
693 | 693 | |
694 | 694 | /* |
695 | 695 | * For people who really REALLY know what they're doing with TinyMCE |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * is to use the default cleanup by not specifying valid_elements, |
700 | 700 | * as TinyMCE checks against the full set of HTML 5.0 elements and attributes. |
701 | 701 | */ |
702 | - if ( $set['teeny'] ) { |
|
702 | + if ($set['teeny']) { |
|
703 | 703 | |
704 | 704 | /** |
705 | 705 | * Filter the teenyMCE config before init. |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | * @param array $mceInit An array with teenyMCE config. |
710 | 710 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
711 | 711 | */ |
712 | - $mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id ); |
|
712 | + $mceInit = apply_filters('teeny_mce_before_init', $mceInit, $editor_id); |
|
713 | 713 | } else { |
714 | 714 | |
715 | 715 | /** |
@@ -720,10 +720,10 @@ discard block |
||
720 | 720 | * @param array $mceInit An array with TinyMCE config. |
721 | 721 | * @param string $editor_id Unique editor identifier, e.g. 'content'. |
722 | 722 | */ |
723 | - $mceInit = apply_filters( 'tiny_mce_before_init', $mceInit, $editor_id ); |
|
723 | + $mceInit = apply_filters('tiny_mce_before_init', $mceInit, $editor_id); |
|
724 | 724 | } |
725 | 725 | |
726 | - if ( empty( $mceInit['toolbar3'] ) && ! empty( $mceInit['toolbar4'] ) ) { |
|
726 | + if (empty($mceInit['toolbar3']) && ! empty($mceInit['toolbar4'])) { |
|
727 | 727 | $mceInit['toolbar3'] = $mceInit['toolbar4']; |
728 | 728 | $mceInit['toolbar4'] = ''; |
729 | 729 | } |
@@ -741,19 +741,19 @@ discard block |
||
741 | 741 | private static function _parse_init($init) { |
742 | 742 | $options = ''; |
743 | 743 | |
744 | - foreach ( $init as $k => $v ) { |
|
745 | - if ( is_bool($v) ) { |
|
744 | + foreach ($init as $k => $v) { |
|
745 | + if (is_bool($v)) { |
|
746 | 746 | $val = $v ? 'true' : 'false'; |
747 | - $options .= $k . ':' . $val . ','; |
|
747 | + $options .= $k.':'.$val.','; |
|
748 | 748 | continue; |
749 | - } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) { |
|
750 | - $options .= $k . ':' . $v . ','; |
|
749 | + } elseif ( ! empty($v) && is_string($v) && (('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v))) { |
|
750 | + $options .= $k.':'.$v.','; |
|
751 | 751 | continue; |
752 | 752 | } |
753 | - $options .= $k . ':"' . $v . '",'; |
|
753 | + $options .= $k.':"'.$v.'",'; |
|
754 | 754 | } |
755 | 755 | |
756 | - return '{' . trim( $options, ' ,' ) . '}'; |
|
756 | + return '{'.trim($options, ' ,').'}'; |
|
757 | 757 | } |
758 | 758 | |
759 | 759 | /** |
@@ -761,23 +761,23 @@ discard block |
||
761 | 761 | * @static |
762 | 762 | */ |
763 | 763 | public static function enqueue_scripts() { |
764 | - if ( self::$has_tinymce ) |
|
764 | + if (self::$has_tinymce) |
|
765 | 765 | wp_enqueue_script('editor'); |
766 | 766 | |
767 | - if ( self::$has_quicktags ) { |
|
768 | - wp_enqueue_script( 'quicktags' ); |
|
769 | - wp_enqueue_style( 'buttons' ); |
|
767 | + if (self::$has_quicktags) { |
|
768 | + wp_enqueue_script('quicktags'); |
|
769 | + wp_enqueue_style('buttons'); |
|
770 | 770 | } |
771 | 771 | |
772 | - if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) { |
|
772 | + if (in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true)) { |
|
773 | 773 | wp_enqueue_script('wplink'); |
774 | 774 | } |
775 | 775 | |
776 | - if ( self::$old_dfw_compat ) { |
|
776 | + if (self::$old_dfw_compat) { |
|
777 | 777 | wp_enqueue_script('wp-fullscreen-stub'); |
778 | 778 | } |
779 | 779 | |
780 | - if ( self::$has_medialib ) { |
|
780 | + if (self::$has_medialib) { |
|
781 | 781 | add_thickbox(); |
782 | 782 | wp_enqueue_script('media-upload'); |
783 | 783 | } |
@@ -790,10 +790,10 @@ discard block |
||
790 | 790 | * @param array $to_load An array containing boolean values whether TinyMCE |
791 | 791 | * and Quicktags are being loaded. |
792 | 792 | */ |
793 | - do_action( 'wp_enqueue_editor', array( |
|
793 | + do_action('wp_enqueue_editor', array( |
|
794 | 794 | 'tinymce' => self::$has_tinymce, |
795 | 795 | 'quicktags' => self::$has_quicktags, |
796 | - ) ); |
|
796 | + )); |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | /** |
@@ -805,257 +805,257 @@ discard block |
||
805 | 805 | * @param bool $json_only optional Whether to include the JavaScript calls to tinymce.addI18n() and tinymce.ScriptLoader.markDone(). |
806 | 806 | * @return string Translation object, JSON encoded. |
807 | 807 | */ |
808 | - public static function wp_mce_translation( $mce_locale = '', $json_only = false ) { |
|
808 | + public static function wp_mce_translation($mce_locale = '', $json_only = false) { |
|
809 | 809 | |
810 | 810 | $mce_translation = array( |
811 | 811 | // Default TinyMCE strings |
812 | - 'New document' => __( 'New document' ), |
|
813 | - 'Formats' => _x( 'Formats', 'TinyMCE' ), |
|
812 | + 'New document' => __('New document'), |
|
813 | + 'Formats' => _x('Formats', 'TinyMCE'), |
|
814 | 814 | |
815 | - 'Headings' => _x( 'Headings', 'TinyMCE' ), |
|
816 | - 'Heading 1' => __( 'Heading 1' ), |
|
817 | - 'Heading 2' => __( 'Heading 2' ), |
|
818 | - 'Heading 3' => __( 'Heading 3' ), |
|
819 | - 'Heading 4' => __( 'Heading 4' ), |
|
820 | - 'Heading 5' => __( 'Heading 5' ), |
|
821 | - 'Heading 6' => __( 'Heading 6' ), |
|
815 | + 'Headings' => _x('Headings', 'TinyMCE'), |
|
816 | + 'Heading 1' => __('Heading 1'), |
|
817 | + 'Heading 2' => __('Heading 2'), |
|
818 | + 'Heading 3' => __('Heading 3'), |
|
819 | + 'Heading 4' => __('Heading 4'), |
|
820 | + 'Heading 5' => __('Heading 5'), |
|
821 | + 'Heading 6' => __('Heading 6'), |
|
822 | 822 | |
823 | 823 | /* translators: block tags */ |
824 | - 'Blocks' => _x( 'Blocks', 'TinyMCE' ), |
|
825 | - 'Paragraph' => __( 'Paragraph' ), |
|
826 | - 'Blockquote' => __( 'Blockquote' ), |
|
827 | - 'Div' => _x( 'Div', 'HTML tag' ), |
|
828 | - 'Pre' => _x( 'Pre', 'HTML tag' ), |
|
829 | - 'Preformatted' => _x( 'Preformatted', 'HTML tag' ), |
|
830 | - 'Address' => _x( 'Address', 'HTML tag' ), |
|
831 | - |
|
832 | - 'Inline' => _x( 'Inline', 'HTML elements' ), |
|
833 | - 'Underline' => __( 'Underline' ), |
|
834 | - 'Strikethrough' => __( 'Strikethrough' ), |
|
835 | - 'Subscript' => __( 'Subscript' ), |
|
836 | - 'Superscript' => __( 'Superscript' ), |
|
837 | - 'Clear formatting' => __( 'Clear formatting' ), |
|
838 | - 'Bold' => __( 'Bold' ), |
|
839 | - 'Italic' => __( 'Italic' ), |
|
840 | - 'Code' => _x( 'Code', 'editor button' ), |
|
841 | - 'Source code' => __( 'Source code' ), |
|
842 | - 'Font Family' => __( 'Font Family' ), |
|
843 | - 'Font Sizes' => __( 'Font Sizes' ), |
|
844 | - |
|
845 | - 'Align center' => __( 'Align center' ), |
|
846 | - 'Align right' => __( 'Align right' ), |
|
847 | - 'Align left' => __( 'Align left' ), |
|
848 | - 'Justify' => __( 'Justify' ), |
|
849 | - 'Increase indent' => __( 'Increase indent' ), |
|
850 | - 'Decrease indent' => __( 'Decrease indent' ), |
|
851 | - |
|
852 | - 'Cut' => __( 'Cut' ), |
|
853 | - 'Copy' => __( 'Copy' ), |
|
854 | - 'Paste' => __( 'Paste' ), |
|
855 | - 'Select all' => __( 'Select all' ), |
|
856 | - 'Undo' => __( 'Undo' ), |
|
857 | - 'Redo' => __( 'Redo' ), |
|
858 | - |
|
859 | - 'Ok' => __( 'OK' ), |
|
860 | - 'Cancel' => __( 'Cancel' ), |
|
861 | - 'Close' => __( 'Close' ), |
|
862 | - 'Visual aids' => __( 'Visual aids' ), |
|
863 | - |
|
864 | - 'Bullet list' => __( 'Bulleted list' ), |
|
865 | - 'Numbered list' => __( 'Numbered list' ), |
|
866 | - 'Square' => _x( 'Square', 'list style' ), |
|
867 | - 'Default' => _x( 'Default', 'list style' ), |
|
868 | - 'Circle' => _x( 'Circle', 'list style' ), |
|
869 | - 'Disc' => _x('Disc', 'list style' ), |
|
870 | - 'Lower Greek' => _x( 'Lower Greek', 'list style' ), |
|
871 | - 'Lower Alpha' => _x( 'Lower Alpha', 'list style' ), |
|
872 | - 'Upper Alpha' => _x( 'Upper Alpha', 'list style' ), |
|
873 | - 'Upper Roman' => _x( 'Upper Roman', 'list style' ), |
|
874 | - 'Lower Roman' => _x( 'Lower Roman', 'list style' ), |
|
824 | + 'Blocks' => _x('Blocks', 'TinyMCE'), |
|
825 | + 'Paragraph' => __('Paragraph'), |
|
826 | + 'Blockquote' => __('Blockquote'), |
|
827 | + 'Div' => _x('Div', 'HTML tag'), |
|
828 | + 'Pre' => _x('Pre', 'HTML tag'), |
|
829 | + 'Preformatted' => _x('Preformatted', 'HTML tag'), |
|
830 | + 'Address' => _x('Address', 'HTML tag'), |
|
831 | + |
|
832 | + 'Inline' => _x('Inline', 'HTML elements'), |
|
833 | + 'Underline' => __('Underline'), |
|
834 | + 'Strikethrough' => __('Strikethrough'), |
|
835 | + 'Subscript' => __('Subscript'), |
|
836 | + 'Superscript' => __('Superscript'), |
|
837 | + 'Clear formatting' => __('Clear formatting'), |
|
838 | + 'Bold' => __('Bold'), |
|
839 | + 'Italic' => __('Italic'), |
|
840 | + 'Code' => _x('Code', 'editor button'), |
|
841 | + 'Source code' => __('Source code'), |
|
842 | + 'Font Family' => __('Font Family'), |
|
843 | + 'Font Sizes' => __('Font Sizes'), |
|
844 | + |
|
845 | + 'Align center' => __('Align center'), |
|
846 | + 'Align right' => __('Align right'), |
|
847 | + 'Align left' => __('Align left'), |
|
848 | + 'Justify' => __('Justify'), |
|
849 | + 'Increase indent' => __('Increase indent'), |
|
850 | + 'Decrease indent' => __('Decrease indent'), |
|
851 | + |
|
852 | + 'Cut' => __('Cut'), |
|
853 | + 'Copy' => __('Copy'), |
|
854 | + 'Paste' => __('Paste'), |
|
855 | + 'Select all' => __('Select all'), |
|
856 | + 'Undo' => __('Undo'), |
|
857 | + 'Redo' => __('Redo'), |
|
858 | + |
|
859 | + 'Ok' => __('OK'), |
|
860 | + 'Cancel' => __('Cancel'), |
|
861 | + 'Close' => __('Close'), |
|
862 | + 'Visual aids' => __('Visual aids'), |
|
863 | + |
|
864 | + 'Bullet list' => __('Bulleted list'), |
|
865 | + 'Numbered list' => __('Numbered list'), |
|
866 | + 'Square' => _x('Square', 'list style'), |
|
867 | + 'Default' => _x('Default', 'list style'), |
|
868 | + 'Circle' => _x('Circle', 'list style'), |
|
869 | + 'Disc' => _x('Disc', 'list style'), |
|
870 | + 'Lower Greek' => _x('Lower Greek', 'list style'), |
|
871 | + 'Lower Alpha' => _x('Lower Alpha', 'list style'), |
|
872 | + 'Upper Alpha' => _x('Upper Alpha', 'list style'), |
|
873 | + 'Upper Roman' => _x('Upper Roman', 'list style'), |
|
874 | + 'Lower Roman' => _x('Lower Roman', 'list style'), |
|
875 | 875 | |
876 | 876 | // Anchor plugin |
877 | - 'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ), |
|
878 | - 'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ), |
|
879 | - 'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ), |
|
877 | + 'Name' => _x('Name', 'Name of link anchor (TinyMCE)'), |
|
878 | + 'Anchor' => _x('Anchor', 'Link anchor (TinyMCE)'), |
|
879 | + 'Anchors' => _x('Anchors', 'Link anchors (TinyMCE)'), |
|
880 | 880 | |
881 | 881 | // Fullpage plugin |
882 | - 'Document properties' => __( 'Document properties' ), |
|
883 | - 'Robots' => __( 'Robots' ), |
|
884 | - 'Title' => __( 'Title' ), |
|
885 | - 'Keywords' => __( 'Keywords' ), |
|
886 | - 'Encoding' => __( 'Encoding' ), |
|
887 | - 'Description' => __( 'Description' ), |
|
888 | - 'Author' => __( 'Author' ), |
|
882 | + 'Document properties' => __('Document properties'), |
|
883 | + 'Robots' => __('Robots'), |
|
884 | + 'Title' => __('Title'), |
|
885 | + 'Keywords' => __('Keywords'), |
|
886 | + 'Encoding' => __('Encoding'), |
|
887 | + 'Description' => __('Description'), |
|
888 | + 'Author' => __('Author'), |
|
889 | 889 | |
890 | 890 | // Media, image plugins |
891 | - 'Insert/edit image' => __( 'Insert/edit image' ), |
|
892 | - 'General' => __( 'General' ), |
|
893 | - 'Advanced' => __( 'Advanced' ), |
|
894 | - 'Source' => __( 'Source' ), |
|
895 | - 'Border' => __( 'Border' ), |
|
896 | - 'Constrain proportions' => __( 'Constrain proportions' ), |
|
897 | - 'Vertical space' => __( 'Vertical space' ), |
|
898 | - 'Image description' => __( 'Image description' ), |
|
899 | - 'Style' => __( 'Style' ), |
|
900 | - 'Dimensions' => __( 'Dimensions' ), |
|
901 | - 'Insert image' => __( 'Insert image' ), |
|
902 | - 'Insert date/time' => __( 'Insert date/time' ), |
|
903 | - 'Insert/edit video' => __( 'Insert/edit video' ), |
|
904 | - 'Poster' => __( 'Poster' ), |
|
905 | - 'Alternative source' => __( 'Alternative source' ), |
|
906 | - 'Paste your embed code below:' => __( 'Paste your embed code below:' ), |
|
907 | - 'Insert video' => __( 'Insert video' ), |
|
908 | - 'Embed' => __( 'Embed' ), |
|
891 | + 'Insert/edit image' => __('Insert/edit image'), |
|
892 | + 'General' => __('General'), |
|
893 | + 'Advanced' => __('Advanced'), |
|
894 | + 'Source' => __('Source'), |
|
895 | + 'Border' => __('Border'), |
|
896 | + 'Constrain proportions' => __('Constrain proportions'), |
|
897 | + 'Vertical space' => __('Vertical space'), |
|
898 | + 'Image description' => __('Image description'), |
|
899 | + 'Style' => __('Style'), |
|
900 | + 'Dimensions' => __('Dimensions'), |
|
901 | + 'Insert image' => __('Insert image'), |
|
902 | + 'Insert date/time' => __('Insert date/time'), |
|
903 | + 'Insert/edit video' => __('Insert/edit video'), |
|
904 | + 'Poster' => __('Poster'), |
|
905 | + 'Alternative source' => __('Alternative source'), |
|
906 | + 'Paste your embed code below:' => __('Paste your embed code below:'), |
|
907 | + 'Insert video' => __('Insert video'), |
|
908 | + 'Embed' => __('Embed'), |
|
909 | 909 | |
910 | 910 | // Each of these have a corresponding plugin |
911 | - 'Special character' => __( 'Special character' ), |
|
912 | - 'Right to left' => _x( 'Right to left', 'editor button' ), |
|
913 | - 'Left to right' => _x( 'Left to right', 'editor button' ), |
|
914 | - 'Emoticons' => __( 'Emoticons' ), |
|
915 | - 'Nonbreaking space' => __( 'Nonbreaking space' ), |
|
916 | - 'Page break' => __( 'Page break' ), |
|
917 | - 'Paste as text' => __( 'Paste as text' ), |
|
918 | - 'Preview' => __( 'Preview' ), |
|
919 | - 'Print' => __( 'Print' ), |
|
920 | - 'Save' => __( 'Save' ), |
|
921 | - 'Fullscreen' => __( 'Fullscreen' ), |
|
922 | - 'Horizontal line' => __( 'Horizontal line' ), |
|
923 | - 'Horizontal space' => __( 'Horizontal space' ), |
|
924 | - 'Restore last draft' => __( 'Restore last draft' ), |
|
925 | - 'Insert/edit link' => __( 'Insert/edit link' ), |
|
926 | - 'Remove link' => __( 'Remove link' ), |
|
927 | - |
|
928 | - 'Color' => __( 'Color' ), |
|
929 | - 'Custom color' => __( 'Custom color' ), |
|
930 | - 'Custom...' => _x( 'Custom...', 'label for custom color' ), |
|
931 | - 'No color' => __( 'No color' ), |
|
911 | + 'Special character' => __('Special character'), |
|
912 | + 'Right to left' => _x('Right to left', 'editor button'), |
|
913 | + 'Left to right' => _x('Left to right', 'editor button'), |
|
914 | + 'Emoticons' => __('Emoticons'), |
|
915 | + 'Nonbreaking space' => __('Nonbreaking space'), |
|
916 | + 'Page break' => __('Page break'), |
|
917 | + 'Paste as text' => __('Paste as text'), |
|
918 | + 'Preview' => __('Preview'), |
|
919 | + 'Print' => __('Print'), |
|
920 | + 'Save' => __('Save'), |
|
921 | + 'Fullscreen' => __('Fullscreen'), |
|
922 | + 'Horizontal line' => __('Horizontal line'), |
|
923 | + 'Horizontal space' => __('Horizontal space'), |
|
924 | + 'Restore last draft' => __('Restore last draft'), |
|
925 | + 'Insert/edit link' => __('Insert/edit link'), |
|
926 | + 'Remove link' => __('Remove link'), |
|
927 | + |
|
928 | + 'Color' => __('Color'), |
|
929 | + 'Custom color' => __('Custom color'), |
|
930 | + 'Custom...' => _x('Custom...', 'label for custom color'), |
|
931 | + 'No color' => __('No color'), |
|
932 | 932 | |
933 | 933 | // Spelling, search/replace plugins |
934 | - 'Could not find the specified string.' => __( 'Could not find the specified string.' ), |
|
935 | - 'Replace' => _x( 'Replace', 'find/replace' ), |
|
936 | - 'Next' => _x( 'Next', 'find/replace' ), |
|
934 | + 'Could not find the specified string.' => __('Could not find the specified string.'), |
|
935 | + 'Replace' => _x('Replace', 'find/replace'), |
|
936 | + 'Next' => _x('Next', 'find/replace'), |
|
937 | 937 | /* translators: previous */ |
938 | - 'Prev' => _x( 'Prev', 'find/replace' ), |
|
939 | - 'Whole words' => _x( 'Whole words', 'find/replace' ), |
|
940 | - 'Find and replace' => __( 'Find and replace' ), |
|
941 | - 'Replace with' => _x('Replace with', 'find/replace' ), |
|
942 | - 'Find' => _x( 'Find', 'find/replace' ), |
|
943 | - 'Replace all' => _x( 'Replace all', 'find/replace' ), |
|
944 | - 'Match case' => __( 'Match case' ), |
|
945 | - 'Spellcheck' => __( 'Check Spelling' ), |
|
946 | - 'Finish' => _x( 'Finish', 'spellcheck' ), |
|
947 | - 'Ignore all' => _x( 'Ignore all', 'spellcheck' ), |
|
948 | - 'Ignore' => _x( 'Ignore', 'spellcheck' ), |
|
949 | - 'Add to Dictionary' => __( 'Add to Dictionary' ), |
|
938 | + 'Prev' => _x('Prev', 'find/replace'), |
|
939 | + 'Whole words' => _x('Whole words', 'find/replace'), |
|
940 | + 'Find and replace' => __('Find and replace'), |
|
941 | + 'Replace with' => _x('Replace with', 'find/replace'), |
|
942 | + 'Find' => _x('Find', 'find/replace'), |
|
943 | + 'Replace all' => _x('Replace all', 'find/replace'), |
|
944 | + 'Match case' => __('Match case'), |
|
945 | + 'Spellcheck' => __('Check Spelling'), |
|
946 | + 'Finish' => _x('Finish', 'spellcheck'), |
|
947 | + 'Ignore all' => _x('Ignore all', 'spellcheck'), |
|
948 | + 'Ignore' => _x('Ignore', 'spellcheck'), |
|
949 | + 'Add to Dictionary' => __('Add to Dictionary'), |
|
950 | 950 | |
951 | 951 | // TinyMCE tables |
952 | - 'Insert table' => __( 'Insert table' ), |
|
953 | - 'Delete table' => __( 'Delete table' ), |
|
954 | - 'Table properties' => __( 'Table properties' ), |
|
955 | - 'Row properties' => __( 'Table row properties' ), |
|
956 | - 'Cell properties' => __( 'Table cell properties' ), |
|
957 | - 'Border color' => __( 'Border color' ), |
|
958 | - |
|
959 | - 'Row' => __( 'Row' ), |
|
960 | - 'Rows' => __( 'Rows' ), |
|
961 | - 'Column' => _x( 'Column', 'table column' ), |
|
962 | - 'Cols' => _x( 'Cols', 'table columns' ), |
|
963 | - 'Cell' => _x( 'Cell', 'table cell' ), |
|
964 | - 'Header cell' => __( 'Header cell' ), |
|
965 | - 'Header' => _x( 'Header', 'table header' ), |
|
966 | - 'Body' => _x( 'Body', 'table body' ), |
|
967 | - 'Footer' => _x( 'Footer', 'table footer' ), |
|
968 | - |
|
969 | - 'Insert row before' => __( 'Insert row before' ), |
|
970 | - 'Insert row after' => __( 'Insert row after' ), |
|
971 | - 'Insert column before' => __( 'Insert column before' ), |
|
972 | - 'Insert column after' => __( 'Insert column after' ), |
|
973 | - 'Paste row before' => __( 'Paste table row before' ), |
|
974 | - 'Paste row after' => __( 'Paste table row after' ), |
|
975 | - 'Delete row' => __( 'Delete row' ), |
|
976 | - 'Delete column' => __( 'Delete column' ), |
|
977 | - 'Cut row' => __( 'Cut table row' ), |
|
978 | - 'Copy row' => __( 'Copy table row' ), |
|
979 | - 'Merge cells' => __( 'Merge table cells' ), |
|
980 | - 'Split cell' => __( 'Split table cell' ), |
|
981 | - |
|
982 | - 'Height' => __( 'Height' ), |
|
983 | - 'Width' => __( 'Width' ), |
|
984 | - 'Caption' => __( 'Caption' ), |
|
985 | - 'Alignment' => __( 'Alignment' ), |
|
986 | - 'H Align' => _x( 'H Align', 'horizontal table cell alignment' ), |
|
987 | - 'Left' => __( 'Left' ), |
|
988 | - 'Center' => __( 'Center' ), |
|
989 | - 'Right' => __( 'Right' ), |
|
990 | - 'None' => _x( 'None', 'table cell alignment attribute' ), |
|
991 | - 'V Align' => _x( 'V Align', 'vertical table cell alignment' ), |
|
992 | - 'Top' => __( 'Top' ), |
|
993 | - 'Middle' => __( 'Middle' ), |
|
994 | - 'Bottom' => __( 'Bottom' ), |
|
995 | - |
|
996 | - 'Row group' => __( 'Row group' ), |
|
997 | - 'Column group' => __( 'Column group' ), |
|
998 | - 'Row type' => __( 'Row type' ), |
|
999 | - 'Cell type' => __( 'Cell type' ), |
|
1000 | - 'Cell padding' => __( 'Cell padding' ), |
|
1001 | - 'Cell spacing' => __( 'Cell spacing' ), |
|
1002 | - 'Scope' => _x( 'Scope', 'table cell scope attribute' ), |
|
1003 | - |
|
1004 | - 'Insert template' => _x( 'Insert template', 'TinyMCE' ), |
|
1005 | - 'Templates' => _x( 'Templates', 'TinyMCE' ), |
|
1006 | - |
|
1007 | - 'Background color' => __( 'Background color' ), |
|
1008 | - 'Text color' => __( 'Text color' ), |
|
1009 | - 'Show blocks' => _x( 'Show blocks', 'editor button' ), |
|
1010 | - 'Show invisible characters' => __( 'Show invisible characters' ), |
|
952 | + 'Insert table' => __('Insert table'), |
|
953 | + 'Delete table' => __('Delete table'), |
|
954 | + 'Table properties' => __('Table properties'), |
|
955 | + 'Row properties' => __('Table row properties'), |
|
956 | + 'Cell properties' => __('Table cell properties'), |
|
957 | + 'Border color' => __('Border color'), |
|
958 | + |
|
959 | + 'Row' => __('Row'), |
|
960 | + 'Rows' => __('Rows'), |
|
961 | + 'Column' => _x('Column', 'table column'), |
|
962 | + 'Cols' => _x('Cols', 'table columns'), |
|
963 | + 'Cell' => _x('Cell', 'table cell'), |
|
964 | + 'Header cell' => __('Header cell'), |
|
965 | + 'Header' => _x('Header', 'table header'), |
|
966 | + 'Body' => _x('Body', 'table body'), |
|
967 | + 'Footer' => _x('Footer', 'table footer'), |
|
968 | + |
|
969 | + 'Insert row before' => __('Insert row before'), |
|
970 | + 'Insert row after' => __('Insert row after'), |
|
971 | + 'Insert column before' => __('Insert column before'), |
|
972 | + 'Insert column after' => __('Insert column after'), |
|
973 | + 'Paste row before' => __('Paste table row before'), |
|
974 | + 'Paste row after' => __('Paste table row after'), |
|
975 | + 'Delete row' => __('Delete row'), |
|
976 | + 'Delete column' => __('Delete column'), |
|
977 | + 'Cut row' => __('Cut table row'), |
|
978 | + 'Copy row' => __('Copy table row'), |
|
979 | + 'Merge cells' => __('Merge table cells'), |
|
980 | + 'Split cell' => __('Split table cell'), |
|
981 | + |
|
982 | + 'Height' => __('Height'), |
|
983 | + 'Width' => __('Width'), |
|
984 | + 'Caption' => __('Caption'), |
|
985 | + 'Alignment' => __('Alignment'), |
|
986 | + 'H Align' => _x('H Align', 'horizontal table cell alignment'), |
|
987 | + 'Left' => __('Left'), |
|
988 | + 'Center' => __('Center'), |
|
989 | + 'Right' => __('Right'), |
|
990 | + 'None' => _x('None', 'table cell alignment attribute'), |
|
991 | + 'V Align' => _x('V Align', 'vertical table cell alignment'), |
|
992 | + 'Top' => __('Top'), |
|
993 | + 'Middle' => __('Middle'), |
|
994 | + 'Bottom' => __('Bottom'), |
|
995 | + |
|
996 | + 'Row group' => __('Row group'), |
|
997 | + 'Column group' => __('Column group'), |
|
998 | + 'Row type' => __('Row type'), |
|
999 | + 'Cell type' => __('Cell type'), |
|
1000 | + 'Cell padding' => __('Cell padding'), |
|
1001 | + 'Cell spacing' => __('Cell spacing'), |
|
1002 | + 'Scope' => _x('Scope', 'table cell scope attribute'), |
|
1003 | + |
|
1004 | + 'Insert template' => _x('Insert template', 'TinyMCE'), |
|
1005 | + 'Templates' => _x('Templates', 'TinyMCE'), |
|
1006 | + |
|
1007 | + 'Background color' => __('Background color'), |
|
1008 | + 'Text color' => __('Text color'), |
|
1009 | + 'Show blocks' => _x('Show blocks', 'editor button'), |
|
1010 | + 'Show invisible characters' => __('Show invisible characters'), |
|
1011 | 1011 | |
1012 | 1012 | /* translators: word count */ |
1013 | - 'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ), |
|
1014 | - 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" . __( 'If you’re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ), |
|
1015 | - 'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __( 'Rich Text Area. Press Alt-Shift-H for help' ), |
|
1016 | - 'You have unsaved changes are you sure you want to navigate away?' => __( 'The changes you made will be lost if you navigate away from this page.' ), |
|
1017 | - 'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser’s edit menu instead.' ), |
|
1013 | + 'Words: {0}' => sprintf(__('Words: %s'), '{0}'), |
|
1014 | + 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __('Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.')."\n\n".__('If you’re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.'), |
|
1015 | + 'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __('Rich Text Area. Press Alt-Shift-H for help'), |
|
1016 | + 'You have unsaved changes are you sure you want to navigate away?' => __('The changes you made will be lost if you navigate away from this page.'), |
|
1017 | + 'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __('Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser’s edit menu instead.'), |
|
1018 | 1018 | |
1019 | 1019 | // TinyMCE menus |
1020 | - 'Insert' => _x( 'Insert', 'TinyMCE menu' ), |
|
1021 | - 'File' => _x( 'File', 'TinyMCE menu' ), |
|
1022 | - 'Edit' => _x( 'Edit', 'TinyMCE menu' ), |
|
1023 | - 'Tools' => _x( 'Tools', 'TinyMCE menu' ), |
|
1024 | - 'View' => _x( 'View', 'TinyMCE menu' ), |
|
1025 | - 'Table' => _x( 'Table', 'TinyMCE menu' ), |
|
1026 | - 'Format' => _x( 'Format', 'TinyMCE menu' ), |
|
1020 | + 'Insert' => _x('Insert', 'TinyMCE menu'), |
|
1021 | + 'File' => _x('File', 'TinyMCE menu'), |
|
1022 | + 'Edit' => _x('Edit', 'TinyMCE menu'), |
|
1023 | + 'Tools' => _x('Tools', 'TinyMCE menu'), |
|
1024 | + 'View' => _x('View', 'TinyMCE menu'), |
|
1025 | + 'Table' => _x('Table', 'TinyMCE menu'), |
|
1026 | + 'Format' => _x('Format', 'TinyMCE menu'), |
|
1027 | 1027 | |
1028 | 1028 | // WordPress strings |
1029 | - 'Toolbar Toggle' => __( 'Toolbar Toggle' ), |
|
1030 | - 'Insert Read More tag' => __( 'Insert Read More tag' ), |
|
1031 | - 'Insert Page Break tag' => __( 'Insert Page Break tag' ), |
|
1032 | - 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor |
|
1033 | - 'Distraction-free writing mode' => __( 'Distraction-free writing mode' ), |
|
1034 | - 'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar |
|
1035 | - 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar |
|
1036 | - 'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar |
|
1029 | + 'Toolbar Toggle' => __('Toolbar Toggle'), |
|
1030 | + 'Insert Read More tag' => __('Insert Read More tag'), |
|
1031 | + 'Insert Page Break tag' => __('Insert Page Break tag'), |
|
1032 | + 'Read more...' => __('Read more...'), // Title on the placeholder inside the editor |
|
1033 | + 'Distraction-free writing mode' => __('Distraction-free writing mode'), |
|
1034 | + 'No alignment' => __('No alignment'), // Tooltip for the 'alignnone' button in the image toolbar |
|
1035 | + 'Remove' => __('Remove'), // Tooltip for the 'remove' button in the image toolbar |
|
1036 | + 'Edit ' => __('Edit'), // Tooltip for the 'edit' button in the image toolbar |
|
1037 | 1037 | |
1038 | 1038 | // Shortcuts help modal |
1039 | - 'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ), |
|
1040 | - 'Default shortcuts,' => __( 'Default shortcuts,' ), |
|
1041 | - 'Additional shortcuts,' => __( 'Additional shortcuts,' ), |
|
1042 | - 'Focus shortcuts:' => __( 'Focus shortcuts:' ), |
|
1043 | - 'Inline toolbar (when an image, link or preview is selected)' => __( 'Inline toolbar (when an image, link or preview is selected)' ), |
|
1044 | - 'Editor menu (when enabled)' => __( 'Editor menu (when enabled)' ), |
|
1045 | - 'Editor toolbar' => __( 'Editor toolbar' ), |
|
1046 | - 'Elements path' => __( 'Elements path' ), |
|
1047 | - 'Ctrl + Alt + letter:' => __( 'Ctrl + Alt + letter:' ), |
|
1048 | - 'Shift + Alt + letter:' => __( 'Shift + Alt + letter:' ), |
|
1049 | - 'Cmd + letter:' => __( 'Cmd + letter:' ), |
|
1050 | - 'Ctrl + letter:' => __( 'Ctrl + letter:' ), |
|
1051 | - 'Letter' => __( 'Letter' ), |
|
1052 | - 'Action' => __( 'Action' ), |
|
1039 | + 'Keyboard Shortcuts' => __('Keyboard Shortcuts'), |
|
1040 | + 'Default shortcuts,' => __('Default shortcuts,'), |
|
1041 | + 'Additional shortcuts,' => __('Additional shortcuts,'), |
|
1042 | + 'Focus shortcuts:' => __('Focus shortcuts:'), |
|
1043 | + 'Inline toolbar (when an image, link or preview is selected)' => __('Inline toolbar (when an image, link or preview is selected)'), |
|
1044 | + 'Editor menu (when enabled)' => __('Editor menu (when enabled)'), |
|
1045 | + 'Editor toolbar' => __('Editor toolbar'), |
|
1046 | + 'Elements path' => __('Elements path'), |
|
1047 | + 'Ctrl + Alt + letter:' => __('Ctrl + Alt + letter:'), |
|
1048 | + 'Shift + Alt + letter:' => __('Shift + Alt + letter:'), |
|
1049 | + 'Cmd + letter:' => __('Cmd + letter:'), |
|
1050 | + 'Ctrl + letter:' => __('Ctrl + letter:'), |
|
1051 | + 'Letter' => __('Letter'), |
|
1052 | + 'Action' => __('Action'), |
|
1053 | 1053 | 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' => |
1054 | - __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ), |
|
1054 | + __('To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.'), |
|
1055 | 1055 | 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' => |
1056 | - __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ), |
|
1056 | + __('When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.'), |
|
1057 | 1057 | 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' => |
1058 | - __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ), |
|
1058 | + __('The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.'), |
|
1059 | 1059 | ); |
1060 | 1060 | |
1061 | 1061 | /** |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | * Url |
1070 | 1070 | */ |
1071 | 1071 | |
1072 | - if ( ! $mce_locale ) { |
|
1072 | + if ( ! $mce_locale) { |
|
1073 | 1073 | $mce_locale = self::$mce_locale; |
1074 | 1074 | } |
1075 | 1075 | |
@@ -1081,32 +1081,32 @@ discard block |
||
1081 | 1081 | * @param array $mce_translation Key/value pairs of strings. |
1082 | 1082 | * @param string $mce_locale Locale. |
1083 | 1083 | */ |
1084 | - $mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale ); |
|
1084 | + $mce_translation = apply_filters('wp_mce_translation', $mce_translation, $mce_locale); |
|
1085 | 1085 | |
1086 | - foreach ( $mce_translation as $key => $value ) { |
|
1086 | + foreach ($mce_translation as $key => $value) { |
|
1087 | 1087 | // Remove strings that are not translated. |
1088 | - if ( $key === $value ) { |
|
1089 | - unset( $mce_translation[$key] ); |
|
1088 | + if ($key === $value) { |
|
1089 | + unset($mce_translation[$key]); |
|
1090 | 1090 | continue; |
1091 | 1091 | } |
1092 | 1092 | |
1093 | - if ( false !== strpos( $value, '&' ) ) { |
|
1094 | - $mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' ); |
|
1093 | + if (false !== strpos($value, '&')) { |
|
1094 | + $mce_translation[$key] = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); |
|
1095 | 1095 | } |
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | // Set direction |
1099 | - if ( is_rtl() ) { |
|
1099 | + if (is_rtl()) { |
|
1100 | 1100 | $mce_translation['_dir'] = 'rtl'; |
1101 | 1101 | } |
1102 | 1102 | |
1103 | - if ( $json_only ) { |
|
1104 | - return wp_json_encode( $mce_translation ); |
|
1103 | + if ($json_only) { |
|
1104 | + return wp_json_encode($mce_translation); |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | - $baseurl = self::$baseurl ? self::$baseurl : includes_url( 'js/tinymce' ); |
|
1107 | + $baseurl = self::$baseurl ? self::$baseurl : includes_url('js/tinymce'); |
|
1108 | 1108 | |
1109 | - return "tinymce.addI18n( '$mce_locale', " . wp_json_encode( $mce_translation ) . ");\n" . |
|
1109 | + return "tinymce.addI18n( '$mce_locale', ".wp_json_encode($mce_translation).");\n". |
|
1110 | 1110 | "tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n"; |
1111 | 1111 | } |
1112 | 1112 | |
@@ -1128,38 +1128,38 @@ discard block |
||
1128 | 1128 | * These plugins can be refreshed by appending query string to the URL passed to "mce_external_plugins" filter. |
1129 | 1129 | * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code). |
1130 | 1130 | */ |
1131 | - $version = 'ver=' . $tinymce_version; |
|
1132 | - $tmce_on = !empty(self::$mce_settings); |
|
1131 | + $version = 'ver='.$tinymce_version; |
|
1132 | + $tmce_on = ! empty(self::$mce_settings); |
|
1133 | 1133 | |
1134 | - if ( ! isset($concatenate_scripts) ) |
|
1134 | + if ( ! isset($concatenate_scripts)) |
|
1135 | 1135 | script_concat_settings(); |
1136 | 1136 | |
1137 | 1137 | $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) |
1138 | 1138 | && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'); |
1139 | 1139 | |
1140 | 1140 | $mceInit = $qtInit = ''; |
1141 | - if ( $tmce_on ) { |
|
1142 | - foreach ( self::$mce_settings as $editor_id => $init ) { |
|
1143 | - $options = self::_parse_init( $init ); |
|
1141 | + if ($tmce_on) { |
|
1142 | + foreach (self::$mce_settings as $editor_id => $init) { |
|
1143 | + $options = self::_parse_init($init); |
|
1144 | 1144 | $mceInit .= "'$editor_id':{$options},"; |
1145 | 1145 | } |
1146 | - $mceInit = '{' . trim($mceInit, ',') . '}'; |
|
1146 | + $mceInit = '{'.trim($mceInit, ',').'}'; |
|
1147 | 1147 | } else { |
1148 | 1148 | $mceInit = '{}'; |
1149 | 1149 | } |
1150 | 1150 | |
1151 | - if ( !empty(self::$qt_settings) ) { |
|
1152 | - foreach ( self::$qt_settings as $editor_id => $init ) { |
|
1153 | - $options = self::_parse_init( $init ); |
|
1151 | + if ( ! empty(self::$qt_settings)) { |
|
1152 | + foreach (self::$qt_settings as $editor_id => $init) { |
|
1153 | + $options = self::_parse_init($init); |
|
1154 | 1154 | $qtInit .= "'$editor_id':{$options},"; |
1155 | 1155 | } |
1156 | - $qtInit = '{' . trim($qtInit, ',') . '}'; |
|
1156 | + $qtInit = '{'.trim($qtInit, ',').'}'; |
|
1157 | 1157 | } else { |
1158 | 1158 | $qtInit = '{}'; |
1159 | 1159 | } |
1160 | 1160 | |
1161 | 1161 | $ref = array( |
1162 | - 'plugins' => implode( ',', self::$plugins ), |
|
1162 | + 'plugins' => implode(',', self::$plugins), |
|
1163 | 1163 | 'theme' => 'modern', |
1164 | 1164 | 'language' => self::$mce_locale |
1165 | 1165 | ); |
@@ -1173,7 +1173,7 @@ discard block |
||
1173 | 1173 | * |
1174 | 1174 | * @param array $mce_settings TinyMCE settings array. |
1175 | 1175 | */ |
1176 | - do_action( 'before_wp_tiny_mce', self::$mce_settings ); |
|
1176 | + do_action('before_wp_tiny_mce', self::$mce_settings); |
|
1177 | 1177 | ?> |
1178 | 1178 | |
1179 | 1179 | <script type="text/javascript"> |
@@ -1182,14 +1182,14 @@ discard block |
||
1182 | 1182 | suffix: "<?php echo $suffix; ?>", |
1183 | 1183 | <?php |
1184 | 1184 | |
1185 | - if ( self::$drag_drop_upload ) { |
|
1185 | + if (self::$drag_drop_upload) { |
|
1186 | 1186 | echo 'dragDropUpload: true,'; |
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | ?> |
1190 | 1190 | mceInit: <?php echo $mceInit; ?>, |
1191 | 1191 | qtInit: <?php echo $qtInit; ?>, |
1192 | - ref: <?php echo self::_parse_init( $ref ); ?>, |
|
1192 | + ref: <?php echo self::_parse_init($ref); ?>, |
|
1193 | 1193 | load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} |
1194 | 1194 | }; |
1195 | 1195 | </script> |
@@ -1197,19 +1197,19 @@ discard block |
||
1197 | 1197 | |
1198 | 1198 | $baseurl = self::$baseurl; |
1199 | 1199 | // Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG) |
1200 | - $mce_suffix = false !== strpos( $wp_version, '-src' ) ? '' : '.min'; |
|
1200 | + $mce_suffix = false !== strpos($wp_version, '-src') ? '' : '.min'; |
|
1201 | 1201 | |
1202 | - if ( $tmce_on ) { |
|
1203 | - if ( $compressed ) { |
|
1202 | + if ($tmce_on) { |
|
1203 | + if ($compressed) { |
|
1204 | 1204 | echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n"; |
1205 | 1205 | } else { |
1206 | 1206 | echo "<script type='text/javascript' src='{$baseurl}/tinymce{$mce_suffix}.js?$version'></script>\n"; |
1207 | 1207 | echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n"; |
1208 | 1208 | } |
1209 | 1209 | |
1210 | - echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n"; |
|
1210 | + echo "<script type='text/javascript'>\n".self::wp_mce_translation()."</script>\n"; |
|
1211 | 1211 | |
1212 | - if ( self::$ext_plugins ) { |
|
1212 | + if (self::$ext_plugins) { |
|
1213 | 1213 | // Load the old-format English strings to prevent unsightly labels in old style popups |
1214 | 1214 | echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n"; |
1215 | 1215 | } |
@@ -1223,17 +1223,17 @@ discard block |
||
1223 | 1223 | * |
1224 | 1224 | * @param array $mce_settings TinyMCE settings array. |
1225 | 1225 | */ |
1226 | - do_action( 'wp_tiny_mce_init', self::$mce_settings ); |
|
1226 | + do_action('wp_tiny_mce_init', self::$mce_settings); |
|
1227 | 1227 | |
1228 | 1228 | ?> |
1229 | 1229 | <script type="text/javascript"> |
1230 | 1230 | <?php |
1231 | 1231 | |
1232 | - if ( self::$ext_plugins ) |
|
1233 | - echo self::$ext_plugins . "\n"; |
|
1232 | + if (self::$ext_plugins) |
|
1233 | + echo self::$ext_plugins."\n"; |
|
1234 | 1234 | |
1235 | - if ( ! is_admin() ) |
|
1236 | - echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";'; |
|
1235 | + if ( ! is_admin()) |
|
1236 | + echo 'var ajaxurl = "'.admin_url('admin-ajax.php', 'relative').'";'; |
|
1237 | 1237 | |
1238 | 1238 | ?> |
1239 | 1239 | |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | </script> |
1269 | 1269 | <?php |
1270 | 1270 | |
1271 | - if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) |
|
1271 | + if (in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true)) |
|
1272 | 1272 | self::wp_link_dialog(); |
1273 | 1273 | |
1274 | 1274 | /** |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | * |
1279 | 1279 | * @param array $mce_settings TinyMCE settings array. |
1280 | 1280 | */ |
1281 | - do_action( 'after_wp_tiny_mce', self::$mce_settings ); |
|
1281 | + do_action('after_wp_tiny_mce', self::$mce_settings); |
|
1282 | 1282 | } |
1283 | 1283 | |
1284 | 1284 | /** |
@@ -1287,7 +1287,7 @@ discard block |
||
1287 | 1287 | * @global int $content_width |
1288 | 1288 | */ |
1289 | 1289 | public static function wp_fullscreen_html() { |
1290 | - _deprecated_function( __FUNCTION__, '4.3' ); |
|
1290 | + _deprecated_function(__FUNCTION__, '4.3'); |
|
1291 | 1291 | } |
1292 | 1292 | |
1293 | 1293 | /** |
@@ -1299,9 +1299,9 @@ discard block |
||
1299 | 1299 | * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments. |
1300 | 1300 | * @return false|array Results. |
1301 | 1301 | */ |
1302 | - public static function wp_link_query( $args = array() ) { |
|
1303 | - $pts = get_post_types( array( 'public' => true ), 'objects' ); |
|
1304 | - $pt_names = array_keys( $pts ); |
|
1302 | + public static function wp_link_query($args = array()) { |
|
1303 | + $pts = get_post_types(array('public' => true), 'objects'); |
|
1304 | + $pt_names = array_keys($pts); |
|
1305 | 1305 | |
1306 | 1306 | $query = array( |
1307 | 1307 | 'post_type' => $pt_names, |
@@ -1312,12 +1312,12 @@ discard block |
||
1312 | 1312 | 'posts_per_page' => 20, |
1313 | 1313 | ); |
1314 | 1314 | |
1315 | - $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1; |
|
1315 | + $args['pagenum'] = isset($args['pagenum']) ? absint($args['pagenum']) : 1; |
|
1316 | 1316 | |
1317 | - if ( isset( $args['s'] ) ) |
|
1317 | + if (isset($args['s'])) |
|
1318 | 1318 | $query['s'] = $args['s']; |
1319 | 1319 | |
1320 | - $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0; |
|
1320 | + $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ($args['pagenum'] - 1) : 0; |
|
1321 | 1321 | |
1322 | 1322 | /** |
1323 | 1323 | * Filter the link query arguments. |
@@ -1330,27 +1330,27 @@ discard block |
||
1330 | 1330 | * |
1331 | 1331 | * @param array $query An array of WP_Query arguments. |
1332 | 1332 | */ |
1333 | - $query = apply_filters( 'wp_link_query_args', $query ); |
|
1333 | + $query = apply_filters('wp_link_query_args', $query); |
|
1334 | 1334 | |
1335 | 1335 | // Do main query. |
1336 | 1336 | $get_posts = new WP_Query; |
1337 | - $posts = $get_posts->query( $query ); |
|
1337 | + $posts = $get_posts->query($query); |
|
1338 | 1338 | // Check if any posts were found. |
1339 | - if ( ! $get_posts->post_count ) |
|
1339 | + if ( ! $get_posts->post_count) |
|
1340 | 1340 | return false; |
1341 | 1341 | |
1342 | 1342 | // Build results. |
1343 | 1343 | $results = array(); |
1344 | - foreach ( $posts as $post ) { |
|
1345 | - if ( 'post' == $post->post_type ) |
|
1346 | - $info = mysql2date( __( 'Y/m/d' ), $post->post_date ); |
|
1344 | + foreach ($posts as $post) { |
|
1345 | + if ('post' == $post->post_type) |
|
1346 | + $info = mysql2date(__('Y/m/d'), $post->post_date); |
|
1347 | 1347 | else |
1348 | - $info = $pts[ $post->post_type ]->labels->singular_name; |
|
1348 | + $info = $pts[$post->post_type]->labels->singular_name; |
|
1349 | 1349 | |
1350 | 1350 | $results[] = array( |
1351 | 1351 | 'ID' => $post->ID, |
1352 | - 'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ), |
|
1353 | - 'permalink' => get_permalink( $post->ID ), |
|
1352 | + 'title' => trim(esc_html(strip_tags(get_the_title($post)))), |
|
1353 | + 'permalink' => get_permalink($post->ID), |
|
1354 | 1354 | 'info' => $info, |
1355 | 1355 | ); |
1356 | 1356 | } |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | * } |
1378 | 1378 | * @param array $query An array of WP_Query arguments. |
1379 | 1379 | */ |
1380 | - return apply_filters( 'wp_link_query', $results, $query ); |
|
1380 | + return apply_filters('wp_link_query', $results, $query); |
|
1381 | 1381 | } |
1382 | 1382 | |
1383 | 1383 | /** |
@@ -1388,36 +1388,36 @@ discard block |
||
1388 | 1388 | * @static |
1389 | 1389 | */ |
1390 | 1390 | public static function wp_link_dialog() { |
1391 | - $search_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' search-panel-visible' : ''; |
|
1391 | + $search_panel_visible = '1' == get_user_setting('wplink', '0') ? ' search-panel-visible' : ''; |
|
1392 | 1392 | |
1393 | 1393 | // display: none is required here, see #WP27605 |
1394 | 1394 | ?> |
1395 | 1395 | <div id="wp-link-backdrop" style="display: none"></div> |
1396 | 1396 | <div id="wp-link-wrap" class="wp-core-ui<?php echo $search_panel_visible; ?>" style="display: none"> |
1397 | 1397 | <form id="wp-link" tabindex="-1"> |
1398 | - <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?> |
|
1398 | + <?php wp_nonce_field('internal-linking', '_ajax_linking_nonce', false); ?> |
|
1399 | 1399 | <div id="link-modal-title"> |
1400 | - <?php _e( 'Insert/edit link' ) ?> |
|
1401 | - <button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button> |
|
1400 | + <?php _e('Insert/edit link') ?> |
|
1401 | + <button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e('Close'); ?></span></button> |
|
1402 | 1402 | </div> |
1403 | 1403 | <div id="link-selector"> |
1404 | 1404 | <div id="link-options"> |
1405 | - <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p> |
|
1405 | + <p class="howto"><?php _e('Enter the destination URL'); ?></p> |
|
1406 | 1406 | <div> |
1407 | - <label><span><?php _e( 'URL' ); ?></span><input id="wp-link-url" type="text" /></label> |
|
1407 | + <label><span><?php _e('URL'); ?></span><input id="wp-link-url" type="text" /></label> |
|
1408 | 1408 | </div> |
1409 | 1409 | <div class="wp-link-text-field"> |
1410 | - <label><span><?php _e( 'Link Text' ); ?></span><input id="wp-link-text" type="text" /></label> |
|
1410 | + <label><span><?php _e('Link Text'); ?></span><input id="wp-link-text" type="text" /></label> |
|
1411 | 1411 | </div> |
1412 | 1412 | <div class="link-target"> |
1413 | - <label><span> </span><input type="checkbox" id="wp-link-target" /> <?php _e( 'Open link in a new window/tab' ); ?></label> |
|
1413 | + <label><span> </span><input type="checkbox" id="wp-link-target" /> <?php _e('Open link in a new window/tab'); ?></label> |
|
1414 | 1414 | </div> |
1415 | 1415 | </div> |
1416 | - <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></a></p> |
|
1416 | + <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e('Or link to existing content'); ?></a></p> |
|
1417 | 1417 | <div id="search-panel"> |
1418 | 1418 | <div class="link-search-wrapper"> |
1419 | 1419 | <label> |
1420 | - <span class="search-label"><?php _e( 'Search' ); ?></span> |
|
1420 | + <span class="search-label"><?php _e('Search'); ?></span> |
|
1421 | 1421 | <input type="search" id="wp-link-search" class="link-search-field" autocomplete="off" /> |
1422 | 1422 | <span class="spinner"></span> |
1423 | 1423 | </label> |
@@ -1430,8 +1430,8 @@ discard block |
||
1430 | 1430 | </div> |
1431 | 1431 | <div id="most-recent-results" class="query-results" tabindex="0"> |
1432 | 1432 | <div class="query-notice" id="query-notice-message"> |
1433 | - <em class="query-notice-default"><?php _e( 'No search term specified. Showing recent items.' ); ?></em> |
|
1434 | - <em class="query-notice-hint screen-reader-text"><?php _e( 'Search or use up and down arrow keys to select an item.' ); ?></em> |
|
1433 | + <em class="query-notice-default"><?php _e('No search term specified. Showing recent items.'); ?></em> |
|
1434 | + <em class="query-notice-hint screen-reader-text"><?php _e('Search or use up and down arrow keys to select an item.'); ?></em> |
|
1435 | 1435 | </div> |
1436 | 1436 | <ul></ul> |
1437 | 1437 | <div class="river-waiting"> |
@@ -1442,10 +1442,10 @@ discard block |
||
1442 | 1442 | </div> |
1443 | 1443 | <div class="submitbox"> |
1444 | 1444 | <div id="wp-link-cancel"> |
1445 | - <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> |
|
1445 | + <a class="submitdelete deletion" href="#"><?php _e('Cancel'); ?></a> |
|
1446 | 1446 | </div> |
1447 | 1447 | <div id="wp-link-update"> |
1448 | - <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit"> |
|
1448 | + <input type="submit" value="<?php esc_attr_e('Add Link'); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit"> |
|
1449 | 1449 | </div> |
1450 | 1450 | </div> |
1451 | 1451 | </form> |
@@ -105,31 +105,36 @@ discard block |
||
105 | 105 | |
106 | 106 | self::$this_quicktags = (bool) $set['quicktags']; |
107 | 107 | |
108 | - if ( self::$this_tinymce ) |
|
109 | - self::$has_tinymce = true; |
|
108 | + if ( self::$this_tinymce ) { |
|
109 | + self::$has_tinymce = true; |
|
110 | + } |
|
110 | 111 | |
111 | - if ( self::$this_quicktags ) |
|
112 | - self::$has_quicktags = true; |
|
112 | + if ( self::$this_quicktags ) { |
|
113 | + self::$has_quicktags = true; |
|
114 | + } |
|
113 | 115 | |
114 | 116 | if ( $set['dfw'] ) { |
115 | 117 | self::$old_dfw_compat = true; |
116 | 118 | } |
117 | 119 | |
118 | - if ( empty( $set['editor_height'] ) ) |
|
119 | - return $set; |
|
120 | + if ( empty( $set['editor_height'] ) ) { |
|
121 | + return $set; |
|
122 | + } |
|
120 | 123 | |
121 | 124 | if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) { |
122 | 125 | // A cookie (set when a user resizes the editor) overrides the height. |
123 | 126 | $cookie = (int) get_user_setting( 'ed_size' ); |
124 | 127 | |
125 | - if ( $cookie ) |
|
126 | - $set['editor_height'] = $cookie; |
|
128 | + if ( $cookie ) { |
|
129 | + $set['editor_height'] = $cookie; |
|
130 | + } |
|
127 | 131 | } |
128 | 132 | |
129 | - if ( $set['editor_height'] < 50 ) |
|
130 | - $set['editor_height'] = 50; |
|
131 | - elseif ( $set['editor_height'] > 5000 ) |
|
132 | - $set['editor_height'] = 5000; |
|
133 | + if ( $set['editor_height'] < 50 ) { |
|
134 | + $set['editor_height'] = 50; |
|
135 | + } elseif ( $set['editor_height'] > 5000 ) { |
|
136 | + $set['editor_height'] = 5000; |
|
137 | + } |
|
133 | 138 | |
134 | 139 | return $set; |
135 | 140 | } |
@@ -207,8 +212,9 @@ discard block |
||
207 | 212 | if ( $set['media_buttons'] ) { |
208 | 213 | self::$has_medialib = true; |
209 | 214 | |
210 | - if ( ! function_exists( 'media_buttons' ) ) |
|
211 | - include( ABSPATH . 'wp-admin/includes/media.php' ); |
|
215 | + if ( ! function_exists( 'media_buttons' ) ) { |
|
216 | + include( ABSPATH . 'wp-admin/includes/media.php' ); |
|
217 | + } |
|
212 | 218 | |
213 | 219 | echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">'; |
214 | 220 | |
@@ -316,11 +322,13 @@ discard block |
||
316 | 322 | 'buttons' => '' |
317 | 323 | ); |
318 | 324 | |
319 | - if ( is_array($set['quicktags']) ) |
|
320 | - $qtInit = array_merge($qtInit, $set['quicktags']); |
|
325 | + if ( is_array($set['quicktags']) ) { |
|
326 | + $qtInit = array_merge($qtInit, $set['quicktags']); |
|
327 | + } |
|
321 | 328 | |
322 | - if ( empty($qtInit['buttons']) ) |
|
323 | - $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; |
|
329 | + if ( empty($qtInit['buttons']) ) { |
|
330 | + $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; |
|
331 | + } |
|
324 | 332 | |
325 | 333 | if ( $set['_content_editor_dfw'] ) { |
326 | 334 | $qtInit['buttons'] .= ',dfw'; |
@@ -475,14 +483,17 @@ discard block |
||
475 | 483 | $path = str_replace( content_url(), '', $plugurl ); |
476 | 484 | $path = WP_CONTENT_DIR . $path . '/langs/'; |
477 | 485 | |
478 | - if ( function_exists('realpath') ) |
|
479 | - $path = trailingslashit( realpath($path) ); |
|
486 | + if ( function_exists('realpath') ) { |
|
487 | + $path = trailingslashit( realpath($path) ); |
|
488 | + } |
|
480 | 489 | |
481 | - if ( @is_file( $path . $mce_locale . '.js' ) ) |
|
482 | - $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; |
|
490 | + if ( @is_file( $path . $mce_locale . '.js' ) ) { |
|
491 | + $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; |
|
492 | + } |
|
483 | 493 | |
484 | - if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) |
|
485 | - $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n"; |
|
494 | + if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) { |
|
495 | + $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n"; |
|
496 | + } |
|
486 | 497 | |
487 | 498 | if ( 'en' != $mce_locale && empty( $strings ) ) { |
488 | 499 | if ( @is_file( $path . 'en.js' ) ) { |
@@ -496,8 +507,9 @@ discard block |
||
496 | 507 | } |
497 | 508 | } |
498 | 509 | |
499 | - if ( ! empty( $strings ) ) |
|
500 | - $ext_plugins .= "\n" . $strings . "\n"; |
|
510 | + if ( ! empty( $strings ) ) { |
|
511 | + $ext_plugins .= "\n" . $strings . "\n"; |
|
512 | + } |
|
501 | 513 | } |
502 | 514 | |
503 | 515 | $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; |
@@ -577,8 +589,9 @@ discard block |
||
577 | 589 | */ |
578 | 590 | $mce_css = trim( apply_filters( 'mce_css', implode( ',', $mce_css ) ), ' ,' ); |
579 | 591 | |
580 | - if ( ! empty($mce_css) ) |
|
581 | - self::$first_init['content_css'] = $mce_css; |
|
592 | + if ( ! empty($mce_css) ) { |
|
593 | + self::$first_init['content_css'] = $mce_css; |
|
594 | + } |
|
582 | 595 | } |
583 | 596 | |
584 | 597 | if ( $set['teeny'] ) { |
@@ -657,10 +670,11 @@ discard block |
||
657 | 670 | $body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status ); |
658 | 671 | if ( post_type_supports( $post->post_type, 'post-formats' ) ) { |
659 | 672 | $post_format = get_post_format( $post ); |
660 | - if ( $post_format && ! is_wp_error( $post_format ) ) |
|
661 | - $body_class .= ' post-format-' . sanitize_html_class( $post_format ); |
|
662 | - else |
|
663 | - $body_class .= ' post-format-standard'; |
|
673 | + if ( $post_format && ! is_wp_error( $post_format ) ) { |
|
674 | + $body_class .= ' post-format-' . sanitize_html_class( $post_format ); |
|
675 | + } else { |
|
676 | + $body_class .= ' post-format-standard'; |
|
677 | + } |
|
664 | 678 | } |
665 | 679 | } |
666 | 680 | |
@@ -688,8 +702,9 @@ discard block |
||
688 | 702 | // Merge with the first part of the init array |
689 | 703 | $mceInit = array_merge( self::$first_init, $mceInit ); |
690 | 704 | |
691 | - if ( is_array( $set['tinymce'] ) ) |
|
692 | - $mceInit = array_merge( $mceInit, $set['tinymce'] ); |
|
705 | + if ( is_array( $set['tinymce'] ) ) { |
|
706 | + $mceInit = array_merge( $mceInit, $set['tinymce'] ); |
|
707 | + } |
|
693 | 708 | |
694 | 709 | /* |
695 | 710 | * For people who really REALLY know what they're doing with TinyMCE |
@@ -761,8 +776,9 @@ discard block |
||
761 | 776 | * @static |
762 | 777 | */ |
763 | 778 | public static function enqueue_scripts() { |
764 | - if ( self::$has_tinymce ) |
|
765 | - wp_enqueue_script('editor'); |
|
779 | + if ( self::$has_tinymce ) { |
|
780 | + wp_enqueue_script('editor'); |
|
781 | + } |
|
766 | 782 | |
767 | 783 | if ( self::$has_quicktags ) { |
768 | 784 | wp_enqueue_script( 'quicktags' ); |
@@ -1131,8 +1147,9 @@ discard block |
||
1131 | 1147 | $version = 'ver=' . $tinymce_version; |
1132 | 1148 | $tmce_on = !empty(self::$mce_settings); |
1133 | 1149 | |
1134 | - if ( ! isset($concatenate_scripts) ) |
|
1135 | - script_concat_settings(); |
|
1150 | + if ( ! isset($concatenate_scripts) ) { |
|
1151 | + script_concat_settings(); |
|
1152 | + } |
|
1136 | 1153 | |
1137 | 1154 | $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) |
1138 | 1155 | && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'); |
@@ -1229,11 +1246,13 @@ discard block |
||
1229 | 1246 | <script type="text/javascript"> |
1230 | 1247 | <?php |
1231 | 1248 | |
1232 | - if ( self::$ext_plugins ) |
|
1233 | - echo self::$ext_plugins . "\n"; |
|
1249 | + if ( self::$ext_plugins ) { |
|
1250 | + echo self::$ext_plugins . "\n"; |
|
1251 | + } |
|
1234 | 1252 | |
1235 | - if ( ! is_admin() ) |
|
1236 | - echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";'; |
|
1253 | + if ( ! is_admin() ) { |
|
1254 | + echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";'; |
|
1255 | + } |
|
1237 | 1256 | |
1238 | 1257 | ?> |
1239 | 1258 | |
@@ -1268,8 +1287,9 @@ discard block |
||
1268 | 1287 | </script> |
1269 | 1288 | <?php |
1270 | 1289 | |
1271 | - if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) |
|
1272 | - self::wp_link_dialog(); |
|
1290 | + if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) ) { |
|
1291 | + self::wp_link_dialog(); |
|
1292 | + } |
|
1273 | 1293 | |
1274 | 1294 | /** |
1275 | 1295 | * Fires after any core TinyMCE editor instances are created. |
@@ -1314,8 +1334,9 @@ discard block |
||
1314 | 1334 | |
1315 | 1335 | $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1; |
1316 | 1336 | |
1317 | - if ( isset( $args['s'] ) ) |
|
1318 | - $query['s'] = $args['s']; |
|
1337 | + if ( isset( $args['s'] ) ) { |
|
1338 | + $query['s'] = $args['s']; |
|
1339 | + } |
|
1319 | 1340 | |
1320 | 1341 | $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0; |
1321 | 1342 | |
@@ -1336,16 +1357,18 @@ discard block |
||
1336 | 1357 | $get_posts = new WP_Query; |
1337 | 1358 | $posts = $get_posts->query( $query ); |
1338 | 1359 | // Check if any posts were found. |
1339 | - if ( ! $get_posts->post_count ) |
|
1340 | - return false; |
|
1360 | + if ( ! $get_posts->post_count ) { |
|
1361 | + return false; |
|
1362 | + } |
|
1341 | 1363 | |
1342 | 1364 | // Build results. |
1343 | 1365 | $results = array(); |
1344 | 1366 | foreach ( $posts as $post ) { |
1345 | - if ( 'post' == $post->post_type ) |
|
1346 | - $info = mysql2date( __( 'Y/m/d' ), $post->post_date ); |
|
1347 | - else |
|
1348 | - $info = $pts[ $post->post_type ]->labels->singular_name; |
|
1367 | + if ( 'post' == $post->post_type ) { |
|
1368 | + $info = mysql2date( __( 'Y/m/d' ), $post->post_date ); |
|
1369 | + } else { |
|
1370 | + $info = $pts[ $post->post_type ]->labels->singular_name; |
|
1371 | + } |
|
1349 | 1372 | |
1350 | 1373 | $results[] = array( |
1351 | 1374 | 'ID' => $post->ID, |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Sets up the default filters and actions for Multisite. |
|
4 | - * |
|
5 | - * If you need to remove a default hook, this file will give you the priority |
|
6 | - * for which to use to remove the hook. |
|
7 | - * |
|
8 | - * Not all of the Multisite default hooks are found in ms-default-filters.php |
|
9 | - * |
|
10 | - * @package WordPress |
|
11 | - * @subpackage Multisite |
|
12 | - * @see default-filters.php |
|
13 | - * @since 3.0.0 |
|
14 | - */ |
|
3 | + * Sets up the default filters and actions for Multisite. |
|
4 | + * |
|
5 | + * If you need to remove a default hook, this file will give you the priority |
|
6 | + * for which to use to remove the hook. |
|
7 | + * |
|
8 | + * Not all of the Multisite default hooks are found in ms-default-filters.php |
|
9 | + * |
|
10 | + * @package WordPress |
|
11 | + * @subpackage Multisite |
|
12 | + * @see default-filters.php |
|
13 | + * @since 3.0.0 |
|
14 | + */ |
|
15 | 15 | |
16 | 16 | add_action( 'init', 'ms_subdomain_constants' ); |
17 | 17 |
@@ -13,77 +13,77 @@ |
||
13 | 13 | * @since 3.0.0 |
14 | 14 | */ |
15 | 15 | |
16 | -add_action( 'init', 'ms_subdomain_constants' ); |
|
16 | +add_action('init', 'ms_subdomain_constants'); |
|
17 | 17 | |
18 | 18 | // Functions |
19 | -add_action( 'update_option_blog_public', 'update_blog_public', 10, 2 ); |
|
20 | -add_filter( 'option_users_can_register', 'users_can_register_signup_filter' ); |
|
21 | -add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' ); |
|
19 | +add_action('update_option_blog_public', 'update_blog_public', 10, 2); |
|
20 | +add_filter('option_users_can_register', 'users_can_register_signup_filter'); |
|
21 | +add_filter('site_option_welcome_user_email', 'welcome_user_msg_filter'); |
|
22 | 22 | |
23 | 23 | // Users |
24 | -add_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' ); |
|
25 | -add_action( 'init', 'maybe_add_existing_user_to_blog' ); |
|
26 | -add_action( 'wpmu_new_user', 'newuser_notify_siteadmin' ); |
|
27 | -add_action( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 ); |
|
28 | -add_filter( 'sanitize_user', 'strtolower' ); |
|
24 | +add_filter('wpmu_validate_user_signup', 'signup_nonce_check'); |
|
25 | +add_action('init', 'maybe_add_existing_user_to_blog'); |
|
26 | +add_action('wpmu_new_user', 'newuser_notify_siteadmin'); |
|
27 | +add_action('wpmu_activate_user', 'add_new_user_to_blog', 10, 3); |
|
28 | +add_filter('sanitize_user', 'strtolower'); |
|
29 | 29 | |
30 | 30 | // Blogs |
31 | -add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' ); |
|
32 | -add_action( 'wpmu_new_blog', 'wpmu_log_new_registrations', 10, 2 ); |
|
33 | -add_action( 'wpmu_new_blog', 'newblog_notify_siteadmin', 10, 2 ); |
|
31 | +add_filter('wpmu_validate_blog_signup', 'signup_nonce_check'); |
|
32 | +add_action('wpmu_new_blog', 'wpmu_log_new_registrations', 10, 2); |
|
33 | +add_action('wpmu_new_blog', 'newblog_notify_siteadmin', 10, 2); |
|
34 | 34 | |
35 | 35 | // Register Nonce |
36 | -add_action( 'signup_hidden_fields', 'signup_nonce_fields' ); |
|
36 | +add_action('signup_hidden_fields', 'signup_nonce_fields'); |
|
37 | 37 | |
38 | 38 | // Template |
39 | -add_action( 'template_redirect', 'maybe_redirect_404' ); |
|
40 | -add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); |
|
39 | +add_action('template_redirect', 'maybe_redirect_404'); |
|
40 | +add_filter('allowed_redirect_hosts', 'redirect_this_site'); |
|
41 | 41 | |
42 | 42 | // Administration |
43 | -add_filter( 'term_id_filter', 'global_terms', 10, 2 ); |
|
44 | -add_action( 'delete_post', '_update_posts_count_on_delete' ); |
|
45 | -add_action( 'delete_post', '_update_blog_date_on_post_delete' ); |
|
46 | -add_action( 'transition_post_status', '_update_blog_date_on_post_publish', 10, 3 ); |
|
47 | -add_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2 ); |
|
43 | +add_filter('term_id_filter', 'global_terms', 10, 2); |
|
44 | +add_action('delete_post', '_update_posts_count_on_delete'); |
|
45 | +add_action('delete_post', '_update_blog_date_on_post_delete'); |
|
46 | +add_action('transition_post_status', '_update_blog_date_on_post_publish', 10, 3); |
|
47 | +add_action('transition_post_status', '_update_posts_count_on_transition_post_status', 10, 2); |
|
48 | 48 | |
49 | 49 | // Counts |
50 | -add_action( 'admin_init', 'wp_schedule_update_network_counts'); |
|
51 | -add_action( 'update_network_counts', 'wp_update_network_counts'); |
|
52 | -foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) |
|
53 | - add_action( $action, 'wp_maybe_update_network_user_counts' ); |
|
54 | -foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) |
|
55 | - add_action( $action, 'wp_maybe_update_network_site_counts' ); |
|
56 | -unset( $action ); |
|
50 | +add_action('admin_init', 'wp_schedule_update_network_counts'); |
|
51 | +add_action('update_network_counts', 'wp_update_network_counts'); |
|
52 | +foreach (array('user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user') as $action) |
|
53 | + add_action($action, 'wp_maybe_update_network_user_counts'); |
|
54 | +foreach (array('make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog') as $action) |
|
55 | + add_action($action, 'wp_maybe_update_network_site_counts'); |
|
56 | +unset($action); |
|
57 | 57 | |
58 | 58 | // Files |
59 | -add_filter( 'wp_upload_bits', 'upload_is_file_too_big' ); |
|
60 | -add_filter( 'import_upload_size_limit', 'fix_import_form_size' ); |
|
61 | -add_filter( 'upload_mimes', 'check_upload_mimes' ); |
|
62 | -add_filter( 'upload_size_limit', 'upload_size_limit_filter' ); |
|
63 | -add_action( 'upload_ui_over_quota', 'multisite_over_quota_message' ); |
|
59 | +add_filter('wp_upload_bits', 'upload_is_file_too_big'); |
|
60 | +add_filter('import_upload_size_limit', 'fix_import_form_size'); |
|
61 | +add_filter('upload_mimes', 'check_upload_mimes'); |
|
62 | +add_filter('upload_size_limit', 'upload_size_limit_filter'); |
|
63 | +add_action('upload_ui_over_quota', 'multisite_over_quota_message'); |
|
64 | 64 | |
65 | 65 | |
66 | -add_action( 'phpmailer_init', 'fix_phpmailer_messageid' ); |
|
66 | +add_action('phpmailer_init', 'fix_phpmailer_messageid'); |
|
67 | 67 | |
68 | 68 | // Disable somethings by default for multisite |
69 | -add_filter( 'enable_update_services_configuration', '__return_false' ); |
|
70 | -if ( ! defined('POST_BY_EMAIL') || ! POST_BY_EMAIL ) // back compat constant. |
|
71 | - add_filter( 'enable_post_by_email_configuration', '__return_false' ); |
|
72 | -if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER ) // back compat constant. |
|
73 | - add_filter( 'enable_edit_any_user_configuration', '__return_false' ); |
|
74 | -add_filter( 'force_filtered_html_on_import', '__return_true' ); |
|
69 | +add_filter('enable_update_services_configuration', '__return_false'); |
|
70 | +if ( ! defined('POST_BY_EMAIL') || ! POST_BY_EMAIL) // back compat constant. |
|
71 | + add_filter('enable_post_by_email_configuration', '__return_false'); |
|
72 | +if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER) // back compat constant. |
|
73 | + add_filter('enable_edit_any_user_configuration', '__return_false'); |
|
74 | +add_filter('force_filtered_html_on_import', '__return_true'); |
|
75 | 75 | |
76 | 76 | // WP_HOME and WP_SITEURL should not have any effect in MS |
77 | -remove_filter( 'option_siteurl', '_config_wp_siteurl' ); |
|
78 | -remove_filter( 'option_home', '_config_wp_home' ); |
|
77 | +remove_filter('option_siteurl', '_config_wp_siteurl'); |
|
78 | +remove_filter('option_home', '_config_wp_home'); |
|
79 | 79 | |
80 | 80 | // Some options changes should trigger blog details refresh. |
81 | -add_action( 'update_option_blogname', 'refresh_blog_details', 10, 0 ); |
|
82 | -add_action( 'update_option_siteurl', 'refresh_blog_details', 10, 0 ); |
|
83 | -add_action( 'update_option_post_count', 'refresh_blog_details', 10, 0 ); |
|
81 | +add_action('update_option_blogname', 'refresh_blog_details', 10, 0); |
|
82 | +add_action('update_option_siteurl', 'refresh_blog_details', 10, 0); |
|
83 | +add_action('update_option_post_count', 'refresh_blog_details', 10, 0); |
|
84 | 84 | |
85 | 85 | // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used. |
86 | -add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); |
|
86 | +add_filter('default_site_option_ms_files_rewriting', '__return_true'); |
|
87 | 87 | |
88 | 88 | // Whitelist multisite domains for HTTP requests |
89 | -add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 ); |
|
89 | +add_filter('http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2); |
@@ -49,10 +49,12 @@ discard block |
||
49 | 49 | // Counts |
50 | 50 | add_action( 'admin_init', 'wp_schedule_update_network_counts'); |
51 | 51 | add_action( 'update_network_counts', 'wp_update_network_counts'); |
52 | -foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) |
|
52 | +foreach ( array( 'user_register', 'deleted_user', 'wpmu_new_user', 'make_spam_user', 'make_ham_user' ) as $action ) { |
|
53 | 53 | add_action( $action, 'wp_maybe_update_network_user_counts' ); |
54 | -foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) |
|
54 | +} |
|
55 | +foreach ( array( 'make_spam_blog', 'make_ham_blog', 'archive_blog', 'unarchive_blog', 'make_delete_blog', 'make_undelete_blog' ) as $action ) { |
|
55 | 56 | add_action( $action, 'wp_maybe_update_network_site_counts' ); |
57 | +} |
|
56 | 58 | unset( $action ); |
57 | 59 | |
58 | 60 | // Files |
@@ -67,10 +69,14 @@ discard block |
||
67 | 69 | |
68 | 70 | // Disable somethings by default for multisite |
69 | 71 | add_filter( 'enable_update_services_configuration', '__return_false' ); |
70 | -if ( ! defined('POST_BY_EMAIL') || ! POST_BY_EMAIL ) // back compat constant. |
|
72 | +if ( ! defined('POST_BY_EMAIL') || ! POST_BY_EMAIL ) { |
|
73 | + // back compat constant. |
|
71 | 74 | add_filter( 'enable_post_by_email_configuration', '__return_false' ); |
72 | -if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER ) // back compat constant. |
|
75 | +} |
|
76 | +if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER ) { |
|
77 | + // back compat constant. |
|
73 | 78 | add_filter( 'enable_edit_any_user_configuration', '__return_false' ); |
79 | +} |
|
74 | 80 | add_filter( 'force_filtered_html_on_import', '__return_true' ); |
75 | 81 | |
76 | 82 | // WP_HOME and WP_SITEURL should not have any effect in MS |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if (isset($info['flac']['STREAMINFO']['audio_signature'])) { |
168 | 168 | |
169 | 169 | if ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { |
170 | - $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); |
|
170 | + $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); |
|
171 | 171 | } |
172 | 172 | else { |
173 | 173 | $info['md5_data_source'] = ''; |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
349 | - * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment |
|
350 | - * External usage: audio.ogg |
|
351 | - */ |
|
349 | + * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment |
|
350 | + * External usage: audio.ogg |
|
351 | + */ |
|
352 | 352 | public function parsePICTURE() { |
353 | 353 | $info = &$this->getid3->info; |
354 | 354 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $BlockHeader = $this->fread(4); |
49 | 49 | $LBFBT = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1)); |
50 | 50 | $LastBlockFlag = (bool) ($LBFBT & 0x80); |
51 | - $BlockType = ($LBFBT & 0x7F); |
|
51 | + $BlockType = ($LBFBT & 0x7F); |
|
52 | 52 | $BlockLength = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3)); |
53 | 53 | $BlockTypeText = self::metaBlockTypeLookup($BlockType); |
54 | 54 | |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | $BlockTypeText_raw['block_type_text'] = $BlockTypeText; |
71 | 71 | $BlockTypeText_raw['block_length'] = $BlockLength; |
72 | 72 | if ($BlockTypeText_raw['block_type'] != 0x06) { // do not read attachment data automatically |
73 | - $BlockTypeText_raw['block_data'] = $this->fread($BlockLength); |
|
73 | + $BlockTypeText_raw['block_data'] = $this->fread($BlockLength); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | switch ($BlockTypeText) { |
77 | 77 | case 'STREAMINFO': // 0x00 |
78 | - if (!$this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) { |
|
78 | + if ( ! $this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | break; |
@@ -85,31 +85,31 @@ discard block |
||
85 | 85 | break; |
86 | 86 | |
87 | 87 | case 'APPLICATION': // 0x02 |
88 | - if (!$this->parseAPPLICATION($BlockTypeText_raw['block_data'])) { |
|
88 | + if ( ! $this->parseAPPLICATION($BlockTypeText_raw['block_data'])) { |
|
89 | 89 | return false; |
90 | 90 | } |
91 | 91 | break; |
92 | 92 | |
93 | 93 | case 'SEEKTABLE': // 0x03 |
94 | - if (!$this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) { |
|
94 | + if ( ! $this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) { |
|
95 | 95 | return false; |
96 | 96 | } |
97 | 97 | break; |
98 | 98 | |
99 | 99 | case 'VORBIS_COMMENT': // 0x04 |
100 | - if (!$this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) { |
|
100 | + if ( ! $this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) { |
|
101 | 101 | return false; |
102 | 102 | } |
103 | 103 | break; |
104 | 104 | |
105 | 105 | case 'CUESHEET': // 0x05 |
106 | - if (!$this->parseCUESHEET($BlockTypeText_raw['block_data'])) { |
|
106 | + if ( ! $this->parseCUESHEET($BlockTypeText_raw['block_data'])) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | break; |
110 | 110 | |
111 | 111 | case 'PICTURE': // 0x06 |
112 | - if (!$this->parsePICTURE()) { |
|
112 | + if ( ! $this->parsePICTURE()) { |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | break; |
@@ -124,18 +124,18 @@ discard block |
||
124 | 124 | while ($LastBlockFlag === false); |
125 | 125 | |
126 | 126 | // handle tags |
127 | - if (!empty($info['flac']['VORBIS_COMMENT']['comments'])) { |
|
127 | + if ( ! empty($info['flac']['VORBIS_COMMENT']['comments'])) { |
|
128 | 128 | $info['flac']['comments'] = $info['flac']['VORBIS_COMMENT']['comments']; |
129 | 129 | } |
130 | - if (!empty($info['flac']['VORBIS_COMMENT']['vendor'])) { |
|
130 | + if ( ! empty($info['flac']['VORBIS_COMMENT']['vendor'])) { |
|
131 | 131 | $info['audio']['encoder'] = str_replace('reference ', '', $info['flac']['VORBIS_COMMENT']['vendor']); |
132 | 132 | } |
133 | 133 | |
134 | 134 | // copy attachments to 'comments' array if nesesary |
135 | 135 | if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) { |
136 | 136 | foreach ($info['flac']['PICTURE'] as $entry) { |
137 | - if (!empty($entry['data'])) { |
|
138 | - if (!isset($info['flac']['comments']['picture'])) { |
|
137 | + if ( ! empty($entry['data'])) { |
|
138 | + if ( ! isset($info['flac']['comments']['picture'])) { |
|
139 | 139 | $info['flac']['comments']['picture'] = array(); |
140 | 140 | } |
141 | 141 | $comments_picture_data = array(); |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | if (isset($info['flac']['STREAMINFO'])) { |
154 | - if (!$this->isDependencyFor('matroska')) { |
|
154 | + if ( ! $this->isDependencyFor('matroska')) { |
|
155 | 155 | $info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset']; |
156 | 156 | } |
157 | 157 | $info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8); |
158 | 158 | if ($info['flac']['uncompressed_audio_bytes'] == 0) { |
159 | 159 | return $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero'); |
160 | 160 | } |
161 | - if (!empty($info['flac']['compressed_audio_bytes'])) { |
|
161 | + if ( ! empty($info['flac']['compressed_audio_bytes'])) { |
|
162 | 162 | $info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes']; |
163 | 163 | } |
164 | 164 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | for ($i = 0; $i < strlen($md5); $i++) { |
176 | 176 | $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); |
177 | 177 | } |
178 | - if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { |
|
178 | + if ( ! preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { |
|
179 | 179 | unset($info['md5_data_source']); |
180 | 180 | } |
181 | 181 | } |
@@ -206,14 +206,14 @@ discard block |
||
206 | 206 | $streaminfo['max_frame_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 7, 3)); |
207 | 207 | |
208 | 208 | $SRCSBSS = getid3_lib::BigEndian2Bin(substr($BlockData, 10, 8)); |
209 | - $streaminfo['sample_rate'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 0, 20)); |
|
210 | - $streaminfo['channels'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 20, 3)) + 1; |
|
211 | - $streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23, 5)) + 1; |
|
209 | + $streaminfo['sample_rate'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 0, 20)); |
|
210 | + $streaminfo['channels'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 20, 3)) + 1; |
|
211 | + $streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23, 5)) + 1; |
|
212 | 212 | $streaminfo['samples_stream'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 28, 36)); |
213 | 213 | |
214 | 214 | $streaminfo['audio_signature'] = substr($BlockData, 18, 16); |
215 | 215 | |
216 | - if (!empty($streaminfo['sample_rate'])) { |
|
216 | + if ( ! empty($streaminfo['sample_rate'])) { |
|
217 | 217 | |
218 | 218 | $info['audio']['bitrate_mode'] = 'vbr'; |
219 | 219 | $info['audio']['sample_rate'] = $streaminfo['sample_rate']; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $info['audio']['bits_per_sample'] = $streaminfo['bits_per_sample']; |
222 | 222 | $info['playtime_seconds'] = $streaminfo['samples_stream'] / $streaminfo['sample_rate']; |
223 | 223 | if ($info['playtime_seconds'] > 0) { |
224 | - if (!$this->isDependencyFor('matroska')) { |
|
224 | + if ( ! $this->isDependencyFor('matroska')) { |
|
225 | 225 | $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; |
226 | 226 | } |
227 | 227 | else { |
@@ -297,16 +297,16 @@ discard block |
||
297 | 297 | private function parseCUESHEET($BlockData) { |
298 | 298 | $info = &$this->getid3->info; |
299 | 299 | $offset = 0; |
300 | - $info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($BlockData, $offset, 128), "\0"); |
|
300 | + $info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($BlockData, $offset, 128), "\0"); |
|
301 | 301 | $offset += 128; |
302 | - $info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); |
|
302 | + $info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); |
|
303 | 303 | $offset += 8; |
304 | 304 | $info['flac']['CUESHEET']['flags']['is_cd'] = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80); |
305 | 305 | $offset += 1; |
306 | 306 | |
307 | 307 | $offset += 258; // reserved |
308 | 308 | |
309 | - $info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); |
|
309 | + $info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); |
|
310 | 310 | $offset += 1; |
311 | 311 | |
312 | 312 | for ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | $info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset'] = $TrackSampleOffset; |
319 | 319 | |
320 | - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc'] = substr($BlockData, $offset, 12); |
|
320 | + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc'] = substr($BlockData, $offset, 12); |
|
321 | 321 | $offset += 12; |
322 | 322 | |
323 | 323 | $TrackFlagsRaw = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | $offset += 13; // reserved |
329 | 329 | |
330 | - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); |
|
330 | + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); |
|
331 | 331 | $offset += 1; |
332 | 332 | |
333 | 333 | for ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) { |
@@ -396,35 +396,35 @@ discard block |
||
396 | 396 | public static function applicationIDLookup($applicationid) { |
397 | 397 | // http://flac.sourceforge.net/id.html |
398 | 398 | static $lookup = array( |
399 | - 0x41544348 => 'FlacFile', // "ATCH" |
|
400 | - 0x42534F4C => 'beSolo', // "BSOL" |
|
401 | - 0x42554753 => 'Bugs Player', // "BUGS" |
|
402 | - 0x43756573 => 'GoldWave cue points (specification)', // "Cues" |
|
403 | - 0x46696361 => 'CUE Splitter', // "Fica" |
|
404 | - 0x46746F6C => 'flac-tools', // "Ftol" |
|
405 | - 0x4D4F5442 => 'MOTB MetaCzar', // "MOTB" |
|
406 | - 0x4D505345 => 'MP3 Stream Editor', // "MPSE" |
|
407 | - 0x4D754D4C => 'MusicML: Music Metadata Language', // "MuML" |
|
408 | - 0x52494646 => 'Sound Devices RIFF chunk storage', // "RIFF" |
|
409 | - 0x5346464C => 'Sound Font FLAC', // "SFFL" |
|
410 | - 0x534F4E59 => 'Sony Creative Software', // "SONY" |
|
411 | - 0x5351455A => 'flacsqueeze', // "SQEZ" |
|
412 | - 0x54745776 => 'TwistedWave', // "TtWv" |
|
413 | - 0x55495453 => 'UITS Embedding tools', // "UITS" |
|
414 | - 0x61696666 => 'FLAC AIFF chunk storage', // "aiff" |
|
415 | - 0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks', // "imag" |
|
416 | - 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // "peem" |
|
417 | - 0x71667374 => 'QFLAC Studio', // "qfst" |
|
418 | - 0x72696666 => 'FLAC RIFF chunk storage', // "riff" |
|
419 | - 0x74756E65 => 'TagTuner', // "tune" |
|
420 | - 0x78626174 => 'XBAT', // "xbat" |
|
421 | - 0x786D6364 => 'xmcd', // "xmcd" |
|
399 | + 0x41544348 => 'FlacFile', // "ATCH" |
|
400 | + 0x42534F4C => 'beSolo', // "BSOL" |
|
401 | + 0x42554753 => 'Bugs Player', // "BUGS" |
|
402 | + 0x43756573 => 'GoldWave cue points (specification)', // "Cues" |
|
403 | + 0x46696361 => 'CUE Splitter', // "Fica" |
|
404 | + 0x46746F6C => 'flac-tools', // "Ftol" |
|
405 | + 0x4D4F5442 => 'MOTB MetaCzar', // "MOTB" |
|
406 | + 0x4D505345 => 'MP3 Stream Editor', // "MPSE" |
|
407 | + 0x4D754D4C => 'MusicML: Music Metadata Language', // "MuML" |
|
408 | + 0x52494646 => 'Sound Devices RIFF chunk storage', // "RIFF" |
|
409 | + 0x5346464C => 'Sound Font FLAC', // "SFFL" |
|
410 | + 0x534F4E59 => 'Sony Creative Software', // "SONY" |
|
411 | + 0x5351455A => 'flacsqueeze', // "SQEZ" |
|
412 | + 0x54745776 => 'TwistedWave', // "TtWv" |
|
413 | + 0x55495453 => 'UITS Embedding tools', // "UITS" |
|
414 | + 0x61696666 => 'FLAC AIFF chunk storage', // "aiff" |
|
415 | + 0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks', // "imag" |
|
416 | + 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // "peem" |
|
417 | + 0x71667374 => 'QFLAC Studio', // "qfst" |
|
418 | + 0x72696666 => 'FLAC RIFF chunk storage', // "riff" |
|
419 | + 0x74756E65 => 'TagTuner', // "tune" |
|
420 | + 0x78626174 => 'XBAT', // "xbat" |
|
421 | + 0x786D6364 => 'xmcd', // "xmcd" |
|
422 | 422 | ); |
423 | 423 | return (isset($lookup[$applicationid]) ? $lookup[$applicationid] : 'reserved'); |
424 | 424 | } |
425 | 425 | |
426 | 426 | public static function pictureTypeLookup($type_id) { |
427 | - static $lookup = array ( |
|
427 | + static $lookup = array( |
|
428 | 428 | 0 => 'Other', |
429 | 429 | 1 => '32x32 pixels \'file icon\' (PNG only)', |
430 | 430 | 2 => 'Other file icon', |
@@ -168,8 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | if ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { |
170 | 170 | $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); |
171 | - } |
|
172 | - else { |
|
171 | + } else { |
|
173 | 172 | $info['md5_data_source'] = ''; |
174 | 173 | $md5 = $info['flac']['STREAMINFO']['audio_signature']; |
175 | 174 | for ($i = 0; $i < strlen($md5); $i++) { |
@@ -223,8 +222,7 @@ discard block |
||
223 | 222 | if ($info['playtime_seconds'] > 0) { |
224 | 223 | if (!$this->isDependencyFor('matroska')) { |
225 | 224 | $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; |
226 | - } |
|
227 | - else { |
|
225 | + } else { |
|
228 | 226 | $this->warning('Cannot determine audio bitrate because total stream size is unknown'); |
229 | 227 | } |
230 | 228 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public function Analyze() { |
22 | 22 | $info = &$this->getid3->info; |
23 | 23 | |
24 | - if (!getid3_lib::intValueSupported($info['filesize'])) { |
|
24 | + if ( ! getid3_lib::intValueSupported($info['filesize'])) { |
|
25 | 25 | $info['warning'][] = 'Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; |
26 | 26 | return false; |
27 | 27 | } |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | |
35 | 35 | $info['avdataend'] = $info['filesize'] - 128; |
36 | 36 | |
37 | - $ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30)); |
|
38 | - $ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30)); |
|
39 | - $ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30)); |
|
40 | - $ParsedID3v1['year'] = $this->cutfield(substr($id3v1tag, 93, 4)); |
|
41 | - $ParsedID3v1['comment'] = substr($id3v1tag, 97, 30); // can't remove nulls yet, track detection depends on them |
|
42 | - $ParsedID3v1['genreid'] = ord(substr($id3v1tag, 127, 1)); |
|
37 | + $ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30)); |
|
38 | + $ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30)); |
|
39 | + $ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30)); |
|
40 | + $ParsedID3v1['year'] = $this->cutfield(substr($id3v1tag, 93, 4)); |
|
41 | + $ParsedID3v1['comment'] = substr($id3v1tag, 97, 30); // can't remove nulls yet, track detection depends on them |
|
42 | + $ParsedID3v1['genreid'] = ord(substr($id3v1tag, 127, 1)); |
|
43 | 43 | |
44 | 44 | // If second-last byte of comment field is null and last byte of comment field is non-null |
45 | 45 | // then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number |
46 | 46 | if (($id3v1tag{125} === "\x00") && ($id3v1tag{126} !== "\x00")) { |
47 | - $ParsedID3v1['track'] = ord(substr($ParsedID3v1['comment'], 29, 1)); |
|
48 | - $ParsedID3v1['comment'] = substr($ParsedID3v1['comment'], 0, 28); |
|
47 | + $ParsedID3v1['track'] = ord(substr($ParsedID3v1['comment'], 29, 1)); |
|
48 | + $ParsedID3v1['comment'] = substr($ParsedID3v1['comment'], 0, 28); |
|
49 | 49 | } |
50 | 50 | $ParsedID3v1['comment'] = $this->cutfield($ParsedID3v1['comment']); |
51 | 51 | |
52 | 52 | $ParsedID3v1['genre'] = $this->LookupGenreName($ParsedID3v1['genreid']); |
53 | - if (!empty($ParsedID3v1['genre'])) { |
|
53 | + if ( ! empty($ParsedID3v1['genre'])) { |
|
54 | 54 | unset($ParsedID3v1['genreid']); |
55 | 55 | } |
56 | 56 | if (isset($ParsedID3v1['genre']) && (empty($ParsedID3v1['genre']) || ($ParsedID3v1['genre'] == 'Unknown'))) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $ParsedID3v1['year'], |
70 | 70 | (isset($ParsedID3v1['genre']) ? $this->LookupGenreID($ParsedID3v1['genre']) : false), |
71 | 71 | $ParsedID3v1['comment'], |
72 | - (!empty($ParsedID3v1['track']) ? $ParsedID3v1['track'] : '')); |
|
72 | + ( ! empty($ParsedID3v1['track']) ? $ParsedID3v1['track'] : '')); |
|
73 | 73 | $ParsedID3v1['padding_valid'] = true; |
74 | 74 | if ($id3v1tag !== $GoodFormatID3v1tag) { |
75 | 75 | $ParsedID3v1['padding_valid'] = false; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | return trim(substr($str, 0, strcspn($str, "\x00"))); |
108 | 108 | } |
109 | 109 | |
110 | - public static function ArrayOfGenres($allowSCMPXextended=false) { |
|
110 | + public static function ArrayOfGenres($allowSCMPXextended = false) { |
|
111 | 111 | static $GenreLookup = array( |
112 | 112 | 0 => 'Blues', |
113 | 113 | 1 => 'Classic Rock', |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | return ($allowSCMPXextended ? $GenreLookupSCMPX : $GenreLookup); |
292 | 292 | } |
293 | 293 | |
294 | - public static function LookupGenreName($genreid, $allowSCMPXextended=true) { |
|
294 | + public static function LookupGenreName($genreid, $allowSCMPXextended = true) { |
|
295 | 295 | switch ($genreid) { |
296 | 296 | case 'RX': |
297 | 297 | case 'CR': |
298 | 298 | break; |
299 | 299 | default: |
300 | - if (!is_numeric($genreid)) { |
|
300 | + if ( ! is_numeric($genreid)) { |
|
301 | 301 | return false; |
302 | 302 | } |
303 | 303 | $genreid = intval($genreid); // to handle 3 or '3' or '03' |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | return (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false); |
308 | 308 | } |
309 | 309 | |
310 | - public static function LookupGenreID($genre, $allowSCMPXextended=false) { |
|
310 | + public static function LookupGenreID($genre, $allowSCMPXextended = false) { |
|
311 | 311 | $GenreLookup = self::ArrayOfGenres($allowSCMPXextended); |
312 | 312 | $LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre)); |
313 | 313 | foreach ($GenreLookup as $key => $value) { |
@@ -325,13 +325,13 @@ discard block |
||
325 | 325 | return $OriginalGenre; |
326 | 326 | } |
327 | 327 | |
328 | - public static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='') { |
|
328 | + public static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track = '') { |
|
329 | 329 | $ID3v1Tag = 'TAG'; |
330 | - $ID3v1Tag .= str_pad(trim(substr($title, 0, 30)), 30, "\x00", STR_PAD_RIGHT); |
|
330 | + $ID3v1Tag .= str_pad(trim(substr($title, 0, 30)), 30, "\x00", STR_PAD_RIGHT); |
|
331 | 331 | $ID3v1Tag .= str_pad(trim(substr($artist, 0, 30)), 30, "\x00", STR_PAD_RIGHT); |
332 | - $ID3v1Tag .= str_pad(trim(substr($album, 0, 30)), 30, "\x00", STR_PAD_RIGHT); |
|
333 | - $ID3v1Tag .= str_pad(trim(substr($year, 0, 4)), 4, "\x00", STR_PAD_LEFT); |
|
334 | - if (!empty($track) && ($track > 0) && ($track <= 255)) { |
|
332 | + $ID3v1Tag .= str_pad(trim(substr($album, 0, 30)), 30, "\x00", STR_PAD_RIGHT); |
|
333 | + $ID3v1Tag .= str_pad(trim(substr($year, 0, 4)), 4, "\x00", STR_PAD_LEFT); |
|
334 | + if ( ! empty($track) && ($track > 0) && ($track <= 255)) { |
|
335 | 335 | $ID3v1Tag .= str_pad(trim(substr($comment, 0, 28)), 28, "\x00", STR_PAD_RIGHT); |
336 | 336 | $ID3v1Tag .= "\x00"; |
337 | 337 | if (gettype($track) == 'string') { |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Sets up the default filters and actions for most |
|
4 | - * of the WordPress hooks. |
|
5 | - * |
|
6 | - * If you need to remove a default hook, this file will |
|
7 | - * give you the priority for which to use to remove the |
|
8 | - * hook. |
|
9 | - * |
|
10 | - * Not all of the default hooks are found in default-filters.php |
|
11 | - * |
|
12 | - * @package WordPress |
|
13 | - */ |
|
3 | + * Sets up the default filters and actions for most |
|
4 | + * of the WordPress hooks. |
|
5 | + * |
|
6 | + * If you need to remove a default hook, this file will |
|
7 | + * give you the priority for which to use to remove the |
|
8 | + * hook. |
|
9 | + * |
|
10 | + * Not all of the default hooks are found in default-filters.php |
|
11 | + * |
|
12 | + * @package WordPress |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | // Strip, trim, kses, special chars for string saves |
16 | 16 | foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | add_action( 'wp_print_styles', 'print_emoji_styles' ); |
230 | 230 | |
231 | 231 | if ( isset( $_GET['replytocom'] ) ) |
232 | - add_action( 'wp_head', 'wp_no_robots' ); |
|
232 | + add_action( 'wp_head', 'wp_no_robots' ); |
|
233 | 233 | |
234 | 234 | // Login actions |
235 | 235 | add_action( 'login_head', 'wp_print_head_scripts', 9 ); |
@@ -13,400 +13,400 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | // Strip, trim, kses, special chars for string saves |
16 | -foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { |
|
17 | - add_filter( $filter, 'sanitize_text_field' ); |
|
18 | - add_filter( $filter, 'wp_filter_kses' ); |
|
19 | - add_filter( $filter, '_wp_specialchars', 30 ); |
|
16 | +foreach (array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname') as $filter) { |
|
17 | + add_filter($filter, 'sanitize_text_field'); |
|
18 | + add_filter($filter, 'wp_filter_kses'); |
|
19 | + add_filter($filter, '_wp_specialchars', 30); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // Strip, kses, special chars for string display |
23 | -foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) { |
|
24 | - if ( is_admin() ) { |
|
23 | +foreach (array('term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname') as $filter) { |
|
24 | + if (is_admin()) { |
|
25 | 25 | // These are expensive. Run only on admin pages for defense in depth. |
26 | - add_filter( $filter, 'sanitize_text_field' ); |
|
27 | - add_filter( $filter, 'wp_kses_data' ); |
|
26 | + add_filter($filter, 'sanitize_text_field'); |
|
27 | + add_filter($filter, 'wp_kses_data'); |
|
28 | 28 | } |
29 | - add_filter( $filter, '_wp_specialchars', 30 ); |
|
29 | + add_filter($filter, '_wp_specialchars', 30); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // Kses only for textarea saves |
33 | -foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) { |
|
34 | - add_filter( $filter, 'wp_filter_kses' ); |
|
33 | +foreach (array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description') as $filter) { |
|
34 | + add_filter($filter, 'wp_filter_kses'); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | // Kses only for textarea admin displays |
38 | -if ( is_admin() ) { |
|
39 | - foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) { |
|
40 | - add_filter( $filter, 'wp_kses_data' ); |
|
38 | +if (is_admin()) { |
|
39 | + foreach (array('term_description', 'link_description', 'link_notes', 'user_description') as $filter) { |
|
40 | + add_filter($filter, 'wp_kses_data'); |
|
41 | 41 | } |
42 | - add_filter( 'comment_text', 'wp_kses_post' ); |
|
42 | + add_filter('comment_text', 'wp_kses_post'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | // Email saves |
46 | -foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) { |
|
47 | - add_filter( $filter, 'trim' ); |
|
48 | - add_filter( $filter, 'sanitize_email' ); |
|
49 | - add_filter( $filter, 'wp_filter_kses' ); |
|
46 | +foreach (array('pre_comment_author_email', 'pre_user_email') as $filter) { |
|
47 | + add_filter($filter, 'trim'); |
|
48 | + add_filter($filter, 'sanitize_email'); |
|
49 | + add_filter($filter, 'wp_filter_kses'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Email admin display |
53 | -foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { |
|
54 | - add_filter( $filter, 'sanitize_email' ); |
|
55 | - if ( is_admin() ) |
|
56 | - add_filter( $filter, 'wp_kses_data' ); |
|
53 | +foreach (array('comment_author_email', 'user_email') as $filter) { |
|
54 | + add_filter($filter, 'sanitize_email'); |
|
55 | + if (is_admin()) |
|
56 | + add_filter($filter, 'wp_kses_data'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Save URL |
60 | -foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', |
|
61 | - 'pre_link_rss', 'pre_post_guid' ) as $filter ) { |
|
62 | - add_filter( $filter, 'wp_strip_all_tags' ); |
|
63 | - add_filter( $filter, 'esc_url_raw' ); |
|
64 | - add_filter( $filter, 'wp_filter_kses' ); |
|
60 | +foreach (array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', |
|
61 | + 'pre_link_rss', 'pre_post_guid') as $filter) { |
|
62 | + add_filter($filter, 'wp_strip_all_tags'); |
|
63 | + add_filter($filter, 'esc_url_raw'); |
|
64 | + add_filter($filter, 'wp_filter_kses'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | // Display URL |
68 | -foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) { |
|
69 | - if ( is_admin() ) |
|
70 | - add_filter( $filter, 'wp_strip_all_tags' ); |
|
71 | - add_filter( $filter, 'esc_url' ); |
|
72 | - if ( is_admin() ) |
|
73 | - add_filter( $filter, 'wp_kses_data' ); |
|
68 | +foreach (array('user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid') as $filter) { |
|
69 | + if (is_admin()) |
|
70 | + add_filter($filter, 'wp_strip_all_tags'); |
|
71 | + add_filter($filter, 'esc_url'); |
|
72 | + if (is_admin()) |
|
73 | + add_filter($filter, 'wp_kses_data'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // Slugs |
77 | -add_filter( 'pre_term_slug', 'sanitize_title' ); |
|
77 | +add_filter('pre_term_slug', 'sanitize_title'); |
|
78 | 78 | |
79 | 79 | // Keys |
80 | -foreach ( array( 'pre_post_type', 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) { |
|
81 | - add_filter( $filter, 'sanitize_key' ); |
|
80 | +foreach (array('pre_post_type', 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status') as $filter) { |
|
81 | + add_filter($filter, 'sanitize_key'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // Mime types |
85 | -add_filter( 'pre_post_mime_type', 'sanitize_mime_type' ); |
|
86 | -add_filter( 'post_mime_type', 'sanitize_mime_type' ); |
|
85 | +add_filter('pre_post_mime_type', 'sanitize_mime_type'); |
|
86 | +add_filter('post_mime_type', 'sanitize_mime_type'); |
|
87 | 87 | |
88 | 88 | // Places to balance tags on input |
89 | -foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) { |
|
90 | - add_filter( $filter, 'convert_invalid_entities' ); |
|
91 | - add_filter( $filter, 'balanceTags', 50 ); |
|
89 | +foreach (array('content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content') as $filter) { |
|
90 | + add_filter($filter, 'convert_invalid_entities'); |
|
91 | + add_filter($filter, 'balanceTags', 50); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // Format strings for display. |
95 | -foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) { |
|
96 | - add_filter( $filter, 'wptexturize' ); |
|
97 | - add_filter( $filter, 'convert_chars' ); |
|
98 | - add_filter( $filter, 'esc_html' ); |
|
95 | +foreach (array('comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title') as $filter) { |
|
96 | + add_filter($filter, 'wptexturize'); |
|
97 | + add_filter($filter, 'convert_chars'); |
|
98 | + add_filter($filter, 'esc_html'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // Format WordPress |
102 | -foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) |
|
103 | - add_filter( $filter, 'capital_P_dangit', 11 ); |
|
104 | -add_filter( 'comment_text', 'capital_P_dangit', 31 ); |
|
102 | +foreach (array('the_content', 'the_title', 'wp_title') as $filter) |
|
103 | + add_filter($filter, 'capital_P_dangit', 11); |
|
104 | +add_filter('comment_text', 'capital_P_dangit', 31); |
|
105 | 105 | |
106 | 106 | // Format titles |
107 | -foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { |
|
108 | - add_filter( $filter, 'wptexturize' ); |
|
109 | - add_filter( $filter, 'strip_tags' ); |
|
107 | +foreach (array('single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description') as $filter) { |
|
108 | + add_filter($filter, 'wptexturize'); |
|
109 | + add_filter($filter, 'strip_tags'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Format text area for display. |
113 | -foreach ( array( 'term_description' ) as $filter ) { |
|
114 | - add_filter( $filter, 'wptexturize' ); |
|
115 | - add_filter( $filter, 'convert_chars' ); |
|
116 | - add_filter( $filter, 'wpautop' ); |
|
117 | - add_filter( $filter, 'shortcode_unautop'); |
|
113 | +foreach (array('term_description') as $filter) { |
|
114 | + add_filter($filter, 'wptexturize'); |
|
115 | + add_filter($filter, 'convert_chars'); |
|
116 | + add_filter($filter, 'wpautop'); |
|
117 | + add_filter($filter, 'shortcode_unautop'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | // Format for RSS |
121 | -add_filter( 'term_name_rss', 'convert_chars' ); |
|
121 | +add_filter('term_name_rss', 'convert_chars'); |
|
122 | 122 | |
123 | 123 | // Pre save hierarchy |
124 | -add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 ); |
|
125 | -add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); |
|
124 | +add_filter('wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2); |
|
125 | +add_filter('wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3); |
|
126 | 126 | |
127 | 127 | // Display filters |
128 | -add_filter( 'the_title', 'wptexturize' ); |
|
129 | -add_filter( 'the_title', 'convert_chars' ); |
|
130 | -add_filter( 'the_title', 'trim' ); |
|
128 | +add_filter('the_title', 'wptexturize'); |
|
129 | +add_filter('the_title', 'convert_chars'); |
|
130 | +add_filter('the_title', 'trim'); |
|
131 | 131 | |
132 | -add_filter( 'the_content', 'wptexturize' ); |
|
133 | -add_filter( 'the_content', 'convert_smilies' ); |
|
134 | -add_filter( 'the_content', 'convert_chars' ); |
|
135 | -add_filter( 'the_content', 'wpautop' ); |
|
136 | -add_filter( 'the_content', 'shortcode_unautop' ); |
|
137 | -add_filter( 'the_content', 'prepend_attachment' ); |
|
132 | +add_filter('the_content', 'wptexturize'); |
|
133 | +add_filter('the_content', 'convert_smilies'); |
|
134 | +add_filter('the_content', 'convert_chars'); |
|
135 | +add_filter('the_content', 'wpautop'); |
|
136 | +add_filter('the_content', 'shortcode_unautop'); |
|
137 | +add_filter('the_content', 'prepend_attachment'); |
|
138 | 138 | |
139 | -add_filter( 'the_excerpt', 'wptexturize' ); |
|
140 | -add_filter( 'the_excerpt', 'convert_smilies' ); |
|
141 | -add_filter( 'the_excerpt', 'convert_chars' ); |
|
142 | -add_filter( 'the_excerpt', 'wpautop' ); |
|
143 | -add_filter( 'the_excerpt', 'shortcode_unautop'); |
|
144 | -add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); |
|
139 | +add_filter('the_excerpt', 'wptexturize'); |
|
140 | +add_filter('the_excerpt', 'convert_smilies'); |
|
141 | +add_filter('the_excerpt', 'convert_chars'); |
|
142 | +add_filter('the_excerpt', 'wpautop'); |
|
143 | +add_filter('the_excerpt', 'shortcode_unautop'); |
|
144 | +add_filter('get_the_excerpt', 'wp_trim_excerpt'); |
|
145 | 145 | |
146 | -add_filter( 'comment_text', 'wptexturize' ); |
|
147 | -add_filter( 'comment_text', 'convert_chars' ); |
|
148 | -add_filter( 'comment_text', 'make_clickable', 9 ); |
|
149 | -add_filter( 'comment_text', 'force_balance_tags', 25 ); |
|
150 | -add_filter( 'comment_text', 'convert_smilies', 20 ); |
|
151 | -add_filter( 'comment_text', 'wpautop', 30 ); |
|
146 | +add_filter('comment_text', 'wptexturize'); |
|
147 | +add_filter('comment_text', 'convert_chars'); |
|
148 | +add_filter('comment_text', 'make_clickable', 9); |
|
149 | +add_filter('comment_text', 'force_balance_tags', 25); |
|
150 | +add_filter('comment_text', 'convert_smilies', 20); |
|
151 | +add_filter('comment_text', 'wpautop', 30); |
|
152 | 152 | |
153 | -add_filter( 'comment_excerpt', 'convert_chars' ); |
|
153 | +add_filter('comment_excerpt', 'convert_chars'); |
|
154 | 154 | |
155 | -add_filter( 'list_cats', 'wptexturize' ); |
|
155 | +add_filter('list_cats', 'wptexturize'); |
|
156 | 156 | |
157 | -add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 ); |
|
157 | +add_filter('wp_sprintf', 'wp_sprintf_l', 10, 2); |
|
158 | 158 | |
159 | 159 | // RSS filters |
160 | -add_filter( 'the_title_rss', 'strip_tags' ); |
|
161 | -add_filter( 'the_title_rss', 'ent2ncr', 8 ); |
|
162 | -add_filter( 'the_title_rss', 'esc_html' ); |
|
163 | -add_filter( 'the_content_rss', 'ent2ncr', 8 ); |
|
164 | -add_filter( 'the_content_feed', 'wp_staticize_emoji' ); |
|
165 | -add_filter( 'the_excerpt_rss', 'convert_chars' ); |
|
166 | -add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); |
|
167 | -add_filter( 'comment_author_rss', 'ent2ncr', 8 ); |
|
168 | -add_filter( 'comment_text_rss', 'ent2ncr', 8 ); |
|
169 | -add_filter( 'comment_text_rss', 'esc_html' ); |
|
170 | -add_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
|
171 | -add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); |
|
172 | -add_filter( 'the_author', 'ent2ncr', 8 ); |
|
173 | -add_filter( 'the_guid', 'esc_url' ); |
|
160 | +add_filter('the_title_rss', 'strip_tags'); |
|
161 | +add_filter('the_title_rss', 'ent2ncr', 8); |
|
162 | +add_filter('the_title_rss', 'esc_html'); |
|
163 | +add_filter('the_content_rss', 'ent2ncr', 8); |
|
164 | +add_filter('the_content_feed', 'wp_staticize_emoji'); |
|
165 | +add_filter('the_excerpt_rss', 'convert_chars'); |
|
166 | +add_filter('the_excerpt_rss', 'ent2ncr', 8); |
|
167 | +add_filter('comment_author_rss', 'ent2ncr', 8); |
|
168 | +add_filter('comment_text_rss', 'ent2ncr', 8); |
|
169 | +add_filter('comment_text_rss', 'esc_html'); |
|
170 | +add_filter('comment_text_rss', 'wp_staticize_emoji'); |
|
171 | +add_filter('bloginfo_rss', 'ent2ncr', 8); |
|
172 | +add_filter('the_author', 'ent2ncr', 8); |
|
173 | +add_filter('the_guid', 'esc_url'); |
|
174 | 174 | |
175 | 175 | // Email filters |
176 | -add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); |
|
176 | +add_filter('wp_mail', 'wp_staticize_emoji_for_email'); |
|
177 | 177 | |
178 | 178 | // Misc filters |
179 | -add_filter( 'option_ping_sites', 'privacy_ping_filter' ); |
|
180 | -add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop |
|
181 | -add_filter( 'option_blog_charset', '_canonical_charset' ); |
|
182 | -add_filter( 'option_home', '_config_wp_home' ); |
|
183 | -add_filter( 'option_siteurl', '_config_wp_siteurl' ); |
|
184 | -add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); |
|
185 | -add_filter( 'teeny_mce_before_init', '_mce_set_direction' ); |
|
186 | -add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); |
|
187 | -add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); |
|
188 | -add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 3 ); |
|
189 | -add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 ); |
|
190 | -add_filter( 'pre_comment_content', 'wp_rel_nofollow', 15 ); |
|
191 | -add_filter( 'comment_email', 'antispambot' ); |
|
192 | -add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' ); |
|
193 | -add_filter( 'option_category_base', '_wp_filter_taxonomy_base' ); |
|
194 | -add_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2); |
|
195 | -add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); |
|
196 | -add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); |
|
197 | -add_filter( 'editable_slug', 'urldecode' ); |
|
198 | -add_filter( 'editable_slug', 'esc_textarea' ); |
|
199 | -add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); |
|
200 | -add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' ); |
|
201 | -add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' ); |
|
202 | -add_filter( 'title_save_pre', 'trim' ); |
|
203 | - |
|
204 | -add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 ); |
|
179 | +add_filter('option_ping_sites', 'privacy_ping_filter'); |
|
180 | +add_filter('option_blog_charset', '_wp_specialchars'); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop |
|
181 | +add_filter('option_blog_charset', '_canonical_charset'); |
|
182 | +add_filter('option_home', '_config_wp_home'); |
|
183 | +add_filter('option_siteurl', '_config_wp_siteurl'); |
|
184 | +add_filter('tiny_mce_before_init', '_mce_set_direction'); |
|
185 | +add_filter('teeny_mce_before_init', '_mce_set_direction'); |
|
186 | +add_filter('pre_kses', 'wp_pre_kses_less_than'); |
|
187 | +add_filter('sanitize_title', 'sanitize_title_with_dashes', 10, 3); |
|
188 | +add_action('check_comment_flood', 'check_comment_flood_db', 10, 3); |
|
189 | +add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); |
|
190 | +add_filter('pre_comment_content', 'wp_rel_nofollow', 15); |
|
191 | +add_filter('comment_email', 'antispambot'); |
|
192 | +add_filter('option_tag_base', '_wp_filter_taxonomy_base'); |
|
193 | +add_filter('option_category_base', '_wp_filter_taxonomy_base'); |
|
194 | +add_filter('the_posts', '_close_comments_for_old_posts', 10, 2); |
|
195 | +add_filter('comments_open', '_close_comments_for_old_post', 10, 2); |
|
196 | +add_filter('pings_open', '_close_comments_for_old_post', 10, 2); |
|
197 | +add_filter('editable_slug', 'urldecode'); |
|
198 | +add_filter('editable_slug', 'esc_textarea'); |
|
199 | +add_filter('nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object'); |
|
200 | +add_filter('pingback_ping_source_uri', 'pingback_ping_source_uri'); |
|
201 | +add_filter('xmlrpc_pingback_error', 'xmlrpc_pingback_error'); |
|
202 | +add_filter('title_save_pre', 'trim'); |
|
203 | + |
|
204 | +add_filter('http_request_host_is_external', 'allowed_http_request_hosts', 10, 2); |
|
205 | 205 | |
206 | 206 | // Actions |
207 | -add_action( 'wp_head', '_wp_render_title_tag', 1 ); |
|
208 | -add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); |
|
209 | -add_action( 'wp_head', 'feed_links', 2 ); |
|
210 | -add_action( 'wp_head', 'feed_links_extra', 3 ); |
|
211 | -add_action( 'wp_head', 'rsd_link' ); |
|
212 | -add_action( 'wp_head', 'wlwmanifest_link' ); |
|
213 | -add_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); |
|
214 | -add_action( 'wp_head', 'locale_stylesheet' ); |
|
215 | -add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); |
|
216 | -add_action( 'wp_head', 'noindex', 1 ); |
|
217 | -add_action( 'wp_head', 'print_emoji_detection_script', 7 ); |
|
218 | -add_action( 'wp_head', 'wp_print_styles', 8 ); |
|
219 | -add_action( 'wp_head', 'wp_print_head_scripts', 9 ); |
|
220 | -add_action( 'wp_head', 'wp_generator' ); |
|
221 | -add_action( 'wp_head', 'rel_canonical' ); |
|
222 | -add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); |
|
223 | -add_action( 'wp_head', 'wp_site_icon', 99 ); |
|
224 | -add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); |
|
225 | -add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); |
|
226 | -add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); |
|
227 | -add_action( 'init', 'check_theme_switched', 99 ); |
|
228 | -add_action( 'after_switch_theme', '_wp_sidebars_changed' ); |
|
229 | -add_action( 'wp_print_styles', 'print_emoji_styles' ); |
|
230 | - |
|
231 | -if ( isset( $_GET['replytocom'] ) ) |
|
232 | - add_action( 'wp_head', 'wp_no_robots' ); |
|
207 | +add_action('wp_head', '_wp_render_title_tag', 1); |
|
208 | +add_action('wp_head', 'wp_enqueue_scripts', 1); |
|
209 | +add_action('wp_head', 'feed_links', 2); |
|
210 | +add_action('wp_head', 'feed_links_extra', 3); |
|
211 | +add_action('wp_head', 'rsd_link'); |
|
212 | +add_action('wp_head', 'wlwmanifest_link'); |
|
213 | +add_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); |
|
214 | +add_action('wp_head', 'locale_stylesheet'); |
|
215 | +add_action('publish_future_post', 'check_and_publish_future_post', 10, 1); |
|
216 | +add_action('wp_head', 'noindex', 1); |
|
217 | +add_action('wp_head', 'print_emoji_detection_script', 7); |
|
218 | +add_action('wp_head', 'wp_print_styles', 8); |
|
219 | +add_action('wp_head', 'wp_print_head_scripts', 9); |
|
220 | +add_action('wp_head', 'wp_generator'); |
|
221 | +add_action('wp_head', 'rel_canonical'); |
|
222 | +add_action('wp_head', 'wp_shortlink_wp_head', 10, 0); |
|
223 | +add_action('wp_head', 'wp_site_icon', 99); |
|
224 | +add_action('wp_footer', 'wp_print_footer_scripts', 20); |
|
225 | +add_action('template_redirect', 'wp_shortlink_header', 11, 0); |
|
226 | +add_action('wp_print_footer_scripts', '_wp_footer_scripts'); |
|
227 | +add_action('init', 'check_theme_switched', 99); |
|
228 | +add_action('after_switch_theme', '_wp_sidebars_changed'); |
|
229 | +add_action('wp_print_styles', 'print_emoji_styles'); |
|
230 | + |
|
231 | +if (isset($_GET['replytocom'])) |
|
232 | + add_action('wp_head', 'wp_no_robots'); |
|
233 | 233 | |
234 | 234 | // Login actions |
235 | -add_action( 'login_head', 'wp_print_head_scripts', 9 ); |
|
236 | -add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); |
|
237 | -add_action( 'login_init', 'send_frame_options_header', 10, 0 ); |
|
235 | +add_action('login_head', 'wp_print_head_scripts', 9); |
|
236 | +add_action('login_footer', 'wp_print_footer_scripts', 20); |
|
237 | +add_action('login_init', 'send_frame_options_header', 10, 0); |
|
238 | 238 | |
239 | 239 | // Feed Generator Tags |
240 | -foreach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) { |
|
241 | - add_action( $action, 'the_generator' ); |
|
240 | +foreach (array('rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head') as $action) { |
|
241 | + add_action($action, 'the_generator'); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | // Feed Site Icon |
245 | -add_action( 'atom_head', 'atom_site_icon' ); |
|
246 | -add_action( 'rss2_head', 'rss2_site_icon' ); |
|
245 | +add_action('atom_head', 'atom_site_icon'); |
|
246 | +add_action('rss2_head', 'rss2_site_icon'); |
|
247 | 247 | |
248 | 248 | |
249 | 249 | // WP Cron |
250 | -if ( !defined( 'DOING_CRON' ) ) |
|
251 | - add_action( 'init', 'wp_cron' ); |
|
250 | +if ( ! defined('DOING_CRON')) |
|
251 | + add_action('init', 'wp_cron'); |
|
252 | 252 | |
253 | 253 | // 2 Actions 2 Furious |
254 | -add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); |
|
255 | -add_action( 'do_feed_rss', 'do_feed_rss', 10, 1 ); |
|
256 | -add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); |
|
257 | -add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); |
|
258 | -add_action( 'do_pings', 'do_all_pings', 10, 1 ); |
|
259 | -add_action( 'do_robots', 'do_robots' ); |
|
260 | -add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 2 ); |
|
261 | -add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); |
|
262 | -add_action( 'admin_print_scripts', 'print_emoji_detection_script' ); |
|
263 | -add_action( 'admin_print_scripts', 'print_head_scripts', 20 ); |
|
264 | -add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' ); |
|
265 | -add_action( 'admin_print_styles', 'print_emoji_styles' ); |
|
266 | -add_action( 'admin_print_styles', 'print_admin_styles', 20 ); |
|
267 | -add_action( 'init', 'smilies_init', 5 ); |
|
268 | -add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); |
|
269 | -add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); |
|
270 | -add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); |
|
254 | +add_action('do_feed_rdf', 'do_feed_rdf', 10, 1); |
|
255 | +add_action('do_feed_rss', 'do_feed_rss', 10, 1); |
|
256 | +add_action('do_feed_rss2', 'do_feed_rss2', 10, 1); |
|
257 | +add_action('do_feed_atom', 'do_feed_atom', 10, 1); |
|
258 | +add_action('do_pings', 'do_all_pings', 10, 1); |
|
259 | +add_action('do_robots', 'do_robots'); |
|
260 | +add_action('set_comment_cookies', 'wp_set_comment_cookies', 10, 2); |
|
261 | +add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); |
|
262 | +add_action('admin_print_scripts', 'print_emoji_detection_script'); |
|
263 | +add_action('admin_print_scripts', 'print_head_scripts', 20); |
|
264 | +add_action('admin_print_footer_scripts', '_wp_footer_scripts'); |
|
265 | +add_action('admin_print_styles', 'print_emoji_styles'); |
|
266 | +add_action('admin_print_styles', 'print_admin_styles', 20); |
|
267 | +add_action('init', 'smilies_init', 5); |
|
268 | +add_action('plugins_loaded', 'wp_maybe_load_widgets', 0); |
|
269 | +add_action('plugins_loaded', 'wp_maybe_load_embeds', 0); |
|
270 | +add_action('shutdown', 'wp_ob_end_flush_all', 1); |
|
271 | 271 | // Create a revision whenever a post is updated. |
272 | -add_action( 'post_updated', 'wp_save_post_revision', 10, 1 ); |
|
273 | -add_action( 'publish_post', '_publish_post_hook', 5, 1 ); |
|
274 | -add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); |
|
275 | -add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); |
|
276 | -add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); |
|
277 | -add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); |
|
278 | -add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' ); |
|
279 | -add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); |
|
280 | -add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); |
|
281 | -add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); |
|
282 | -add_action( 'welcome_panel', 'wp_welcome_panel' ); |
|
272 | +add_action('post_updated', 'wp_save_post_revision', 10, 1); |
|
273 | +add_action('publish_post', '_publish_post_hook', 5, 1); |
|
274 | +add_action('transition_post_status', '_transition_post_status', 5, 3); |
|
275 | +add_action('transition_post_status', '_update_term_count_on_transition_post_status', 10, 3); |
|
276 | +add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); |
|
277 | +add_action('wp_scheduled_delete', 'wp_scheduled_delete'); |
|
278 | +add_action('wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts'); |
|
279 | +add_action('admin_init', 'send_frame_options_header', 10, 0); |
|
280 | +add_action('importer_scheduled_cleanup', 'wp_delete_attachment'); |
|
281 | +add_action('upgrader_scheduled_cleanup', 'wp_delete_attachment'); |
|
282 | +add_action('welcome_panel', 'wp_welcome_panel'); |
|
283 | 283 | |
284 | 284 | // Navigation menu actions |
285 | -add_action( 'delete_post', '_wp_delete_post_menu_item' ); |
|
286 | -add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 ); |
|
287 | -add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 ); |
|
285 | +add_action('delete_post', '_wp_delete_post_menu_item'); |
|
286 | +add_action('delete_term', '_wp_delete_tax_menu_item', 10, 3); |
|
287 | +add_action('transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3); |
|
288 | 288 | |
289 | 289 | // Post Thumbnail CSS class filtering |
290 | -add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); |
|
291 | -add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); |
|
290 | +add_action('begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add'); |
|
291 | +add_action('end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove'); |
|
292 | 292 | |
293 | 293 | // Redirect Old Slugs |
294 | -add_action( 'template_redirect', 'wp_old_slug_redirect' ); |
|
295 | -add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 ); |
|
294 | +add_action('template_redirect', 'wp_old_slug_redirect'); |
|
295 | +add_action('post_updated', 'wp_check_for_changed_slugs', 12, 3); |
|
296 | 296 | |
297 | 297 | // Nonce check for Post Previews |
298 | -add_action( 'init', '_show_post_preview' ); |
|
298 | +add_action('init', '_show_post_preview'); |
|
299 | 299 | |
300 | 300 | // Output JS to reset window.name for previews |
301 | -add_action( 'wp_head', 'wp_post_preview_js', 1 ); |
|
301 | +add_action('wp_head', 'wp_post_preview_js', 1); |
|
302 | 302 | |
303 | 303 | // Timezone |
304 | -add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' ); |
|
304 | +add_filter('pre_option_gmt_offset', 'wp_timezone_override_offset'); |
|
305 | 305 | |
306 | 306 | // Admin Color Schemes |
307 | -add_action( 'admin_init', 'register_admin_color_schemes', 1); |
|
308 | -add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); |
|
307 | +add_action('admin_init', 'register_admin_color_schemes', 1); |
|
308 | +add_action('admin_color_scheme_picker', 'admin_color_scheme_picker'); |
|
309 | 309 | |
310 | 310 | // If the upgrade hasn't run yet, assume link manager is used. |
311 | -add_filter( 'default_option_link_manager_enabled', '__return_true' ); |
|
311 | +add_filter('default_option_link_manager_enabled', '__return_true'); |
|
312 | 312 | |
313 | 313 | // This option no longer exists; tell plugins we always support auto-embedding. |
314 | -add_filter( 'default_option_embed_autourls', '__return_true' ); |
|
314 | +add_filter('default_option_embed_autourls', '__return_true'); |
|
315 | 315 | |
316 | 316 | // Default settings for heartbeat |
317 | -add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' ); |
|
317 | +add_filter('heartbeat_settings', 'wp_heartbeat_settings'); |
|
318 | 318 | |
319 | 319 | // Check if the user is logged out |
320 | -add_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); |
|
321 | -add_filter( 'heartbeat_send', 'wp_auth_check' ); |
|
322 | -add_filter( 'heartbeat_nopriv_send', 'wp_auth_check' ); |
|
320 | +add_action('admin_enqueue_scripts', 'wp_auth_check_load'); |
|
321 | +add_filter('heartbeat_send', 'wp_auth_check'); |
|
322 | +add_filter('heartbeat_nopriv_send', 'wp_auth_check'); |
|
323 | 323 | |
324 | 324 | // Default authentication filters |
325 | -add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); |
|
326 | -add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 ); |
|
327 | -add_filter( 'determine_current_user', 'wp_validate_auth_cookie' ); |
|
328 | -add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 ); |
|
325 | +add_filter('authenticate', 'wp_authenticate_username_password', 20, 3); |
|
326 | +add_filter('authenticate', 'wp_authenticate_spam_check', 99); |
|
327 | +add_filter('determine_current_user', 'wp_validate_auth_cookie'); |
|
328 | +add_filter('determine_current_user', 'wp_validate_logged_in_cookie', 20); |
|
329 | 329 | |
330 | 330 | // Split term updates. |
331 | -add_action( 'admin_init', '_wp_check_for_scheduled_split_terms' ); |
|
332 | -add_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 ); |
|
333 | -add_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 ); |
|
334 | -add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 ); |
|
335 | -add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); |
|
331 | +add_action('admin_init', '_wp_check_for_scheduled_split_terms'); |
|
332 | +add_action('split_shared_term', '_wp_check_split_default_terms', 10, 4); |
|
333 | +add_action('split_shared_term', '_wp_check_split_terms_in_menus', 10, 4); |
|
334 | +add_action('split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4); |
|
335 | +add_action('wp_split_shared_term_batch', '_wp_batch_split_terms'); |
|
336 | 336 | |
337 | 337 | /** |
338 | 338 | * Filters formerly mixed into wp-includes |
339 | 339 | */ |
340 | 340 | // Theme |
341 | -add_action( 'wp_loaded', '_custom_header_background_just_in_time' ); |
|
342 | -add_action( 'plugins_loaded', '_wp_customize_include' ); |
|
343 | -add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' ); |
|
344 | -add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); |
|
341 | +add_action('wp_loaded', '_custom_header_background_just_in_time'); |
|
342 | +add_action('plugins_loaded', '_wp_customize_include'); |
|
343 | +add_action('admin_enqueue_scripts', '_wp_customize_loader_settings'); |
|
344 | +add_action('delete_attachment', '_delete_attachment_theme_mod'); |
|
345 | 345 | |
346 | 346 | // Calendar widget cache |
347 | -add_action( 'save_post', 'delete_get_calendar_cache' ); |
|
348 | -add_action( 'delete_post', 'delete_get_calendar_cache' ); |
|
349 | -add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); |
|
350 | -add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' ); |
|
347 | +add_action('save_post', 'delete_get_calendar_cache'); |
|
348 | +add_action('delete_post', 'delete_get_calendar_cache'); |
|
349 | +add_action('update_option_start_of_week', 'delete_get_calendar_cache'); |
|
350 | +add_action('update_option_gmt_offset', 'delete_get_calendar_cache'); |
|
351 | 351 | |
352 | 352 | // Author |
353 | -add_action( 'transition_post_status', '__clear_multi_author_cache' ); |
|
353 | +add_action('transition_post_status', '__clear_multi_author_cache'); |
|
354 | 354 | |
355 | 355 | // Post |
356 | -add_action( 'init', 'create_initial_post_types', 0 ); // highest priority |
|
357 | -add_action( 'admin_menu', '_add_post_type_submenus' ); |
|
358 | -add_action( 'before_delete_post', '_reset_front_page_settings_for_post' ); |
|
359 | -add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' ); |
|
356 | +add_action('init', 'create_initial_post_types', 0); // highest priority |
|
357 | +add_action('admin_menu', '_add_post_type_submenus'); |
|
358 | +add_action('before_delete_post', '_reset_front_page_settings_for_post'); |
|
359 | +add_action('wp_trash_post', '_reset_front_page_settings_for_post'); |
|
360 | 360 | |
361 | 361 | // Post Formats |
362 | -add_filter( 'request', '_post_format_request' ); |
|
363 | -add_filter( 'term_link', '_post_format_link', 10, 3 ); |
|
364 | -add_filter( 'get_post_format', '_post_format_get_term' ); |
|
365 | -add_filter( 'get_terms', '_post_format_get_terms', 10, 3 ); |
|
366 | -add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); |
|
362 | +add_filter('request', '_post_format_request'); |
|
363 | +add_filter('term_link', '_post_format_link', 10, 3); |
|
364 | +add_filter('get_post_format', '_post_format_get_term'); |
|
365 | +add_filter('get_terms', '_post_format_get_terms', 10, 3); |
|
366 | +add_filter('wp_get_object_terms', '_post_format_wp_get_object_terms'); |
|
367 | 367 | |
368 | 368 | // KSES |
369 | -add_action( 'init', 'kses_init' ); |
|
370 | -add_action( 'set_current_user', 'kses_init' ); |
|
369 | +add_action('init', 'kses_init'); |
|
370 | +add_action('set_current_user', 'kses_init'); |
|
371 | 371 | |
372 | 372 | // Script Loader |
373 | -add_action( 'wp_default_scripts', 'wp_default_scripts' ); |
|
374 | -add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' ); |
|
375 | -add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); |
|
373 | +add_action('wp_default_scripts', 'wp_default_scripts'); |
|
374 | +add_filter('wp_print_scripts', 'wp_just_in_time_script_localization'); |
|
375 | +add_filter('print_scripts_array', 'wp_prototype_before_jquery'); |
|
376 | 376 | |
377 | -add_action( 'wp_default_styles', 'wp_default_styles' ); |
|
378 | -add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); |
|
377 | +add_action('wp_default_styles', 'wp_default_styles'); |
|
378 | +add_filter('style_loader_src', 'wp_style_loader_src', 10, 2); |
|
379 | 379 | |
380 | 380 | // Taxonomy |
381 | -add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority |
|
381 | +add_action('init', 'create_initial_taxonomies', 0); // highest priority |
|
382 | 382 | |
383 | 383 | // Canonical |
384 | -add_action( 'template_redirect', 'redirect_canonical' ); |
|
385 | -add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); |
|
384 | +add_action('template_redirect', 'redirect_canonical'); |
|
385 | +add_action('template_redirect', 'wp_redirect_admin_locations', 1000); |
|
386 | 386 | |
387 | 387 | // Shortcodes |
388 | -add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop() |
|
388 | +add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() |
|
389 | 389 | |
390 | 390 | // Media |
391 | -add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' ); |
|
392 | -add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' ); |
|
391 | +add_action('wp_playlist_scripts', 'wp_playlist_scripts'); |
|
392 | +add_action('customize_controls_enqueue_scripts', 'wp_plupload_default_settings'); |
|
393 | 393 | |
394 | 394 | // Nav menu |
395 | -add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 ); |
|
395 | +add_filter('nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2); |
|
396 | 396 | |
397 | 397 | // Widgets |
398 | -add_action( 'init', 'wp_widgets_init', 1 ); |
|
398 | +add_action('init', 'wp_widgets_init', 1); |
|
399 | 399 | |
400 | 400 | // Admin Bar |
401 | 401 | // Don't remove. Wrong way to disable. |
402 | -add_action( 'template_redirect', '_wp_admin_bar_init', 0 ); |
|
403 | -add_action( 'admin_init', '_wp_admin_bar_init' ); |
|
404 | -add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); |
|
405 | -add_action( 'in_admin_header', 'wp_admin_bar_render', 0 ); |
|
402 | +add_action('template_redirect', '_wp_admin_bar_init', 0); |
|
403 | +add_action('admin_init', '_wp_admin_bar_init'); |
|
404 | +add_action('wp_footer', 'wp_admin_bar_render', 1000); |
|
405 | +add_action('in_admin_header', 'wp_admin_bar_render', 0); |
|
406 | 406 | |
407 | 407 | // Former admin filters that can also be hooked on the front end |
408 | -add_action( 'media_buttons', 'media_buttons' ); |
|
409 | -add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 ); |
|
410 | -add_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 ); |
|
408 | +add_action('media_buttons', 'media_buttons'); |
|
409 | +add_filter('image_send_to_editor', 'image_add_caption', 20, 8); |
|
410 | +add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3); |
|
411 | 411 | |
412 | -unset( $filter, $action ); |
|
412 | +unset($filter, $action); |
@@ -52,9 +52,10 @@ discard block |
||
52 | 52 | // Email admin display |
53 | 53 | foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { |
54 | 54 | add_filter( $filter, 'sanitize_email' ); |
55 | - if ( is_admin() ) |
|
56 | - add_filter( $filter, 'wp_kses_data' ); |
|
57 | -} |
|
55 | + if ( is_admin() ) { |
|
56 | + add_filter( $filter, 'wp_kses_data' ); |
|
57 | + } |
|
58 | + } |
|
58 | 59 | |
59 | 60 | // Save URL |
60 | 61 | foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', |
@@ -66,12 +67,14 @@ discard block |
||
66 | 67 | |
67 | 68 | // Display URL |
68 | 69 | foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) { |
69 | - if ( is_admin() ) |
|
70 | - add_filter( $filter, 'wp_strip_all_tags' ); |
|
70 | + if ( is_admin() ) { |
|
71 | + add_filter( $filter, 'wp_strip_all_tags' ); |
|
72 | + } |
|
71 | 73 | add_filter( $filter, 'esc_url' ); |
72 | - if ( is_admin() ) |
|
73 | - add_filter( $filter, 'wp_kses_data' ); |
|
74 | -} |
|
74 | + if ( is_admin() ) { |
|
75 | + add_filter( $filter, 'wp_kses_data' ); |
|
76 | + } |
|
77 | + } |
|
75 | 78 | |
76 | 79 | // Slugs |
77 | 80 | add_filter( 'pre_term_slug', 'sanitize_title' ); |
@@ -99,8 +102,9 @@ discard block |
||
99 | 102 | } |
100 | 103 | |
101 | 104 | // Format WordPress |
102 | -foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) |
|
105 | +foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter ) { |
|
103 | 106 | add_filter( $filter, 'capital_P_dangit', 11 ); |
107 | +} |
|
104 | 108 | add_filter( 'comment_text', 'capital_P_dangit', 31 ); |
105 | 109 | |
106 | 110 | // Format titles |
@@ -228,8 +232,9 @@ discard block |
||
228 | 232 | add_action( 'after_switch_theme', '_wp_sidebars_changed' ); |
229 | 233 | add_action( 'wp_print_styles', 'print_emoji_styles' ); |
230 | 234 | |
231 | -if ( isset( $_GET['replytocom'] ) ) |
|
235 | +if ( isset( $_GET['replytocom'] ) ) { |
|
232 | 236 | add_action( 'wp_head', 'wp_no_robots' ); |
237 | +} |
|
233 | 238 | |
234 | 239 | // Login actions |
235 | 240 | add_action( 'login_head', 'wp_print_head_scripts', 9 ); |
@@ -247,8 +252,9 @@ discard block |
||
247 | 252 | |
248 | 253 | |
249 | 254 | // WP Cron |
250 | -if ( !defined( 'DOING_CRON' ) ) |
|
255 | +if ( !defined( 'DOING_CRON' ) ) { |
|
251 | 256 | add_action( 'init', 'wp_cron' ); |
257 | +} |
|
252 | 258 | |
253 | 259 | // 2 Actions 2 Furious |
254 | 260 | add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); |
@@ -4,4 +4,4 @@ |
||
4 | 4 | * |
5 | 5 | * @package WordPress |
6 | 6 | */ |
7 | -_deprecated_file( basename(__FILE__), '2.1', null, __( 'This file no longer needs to be included.' ) ); |
|
7 | +_deprecated_file(basename(__FILE__), '2.1', null, __('This file no longer needs to be included.')); |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * A class for displaying various tree-like structures. |
|
4 | - * |
|
5 | - * Extend the Walker class to use it, see examples below. Child classes |
|
6 | - * do not need to implement all of the abstract methods in the class. The child |
|
7 | - * only needs to implement the methods that are needed. |
|
8 | - * |
|
9 | - * @since 2.1.0 |
|
10 | - * |
|
11 | - * @package WordPress |
|
12 | - * @abstract |
|
13 | - */ |
|
3 | + * A class for displaying various tree-like structures. |
|
4 | + * |
|
5 | + * Extend the Walker class to use it, see examples below. Child classes |
|
6 | + * do not need to implement all of the abstract methods in the class. The child |
|
7 | + * only needs to implement the methods that are needed. |
|
8 | + * |
|
9 | + * @since 2.1.0 |
|
10 | + * |
|
11 | + * @package WordPress |
|
12 | + * @abstract |
|
13 | + */ |
|
14 | 14 | class Walker { |
15 | 15 | /** |
16 | 16 | * What the class handles. |
@@ -258,16 +258,16 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * paged_walk() - produce a page of nested elements |
|
262 | - * |
|
263 | - * Given an array of hierarchical elements, the maximum depth, a specific page number, |
|
264 | - * and number of elements per page, this function first determines all top level root elements |
|
265 | - * belonging to that page, then lists them and all of their children in hierarchical order. |
|
266 | - * |
|
261 | + * paged_walk() - produce a page of nested elements |
|
262 | + * |
|
263 | + * Given an array of hierarchical elements, the maximum depth, a specific page number, |
|
264 | + * and number of elements per page, this function first determines all top level root elements |
|
265 | + * belonging to that page, then lists them and all of their children in hierarchical order. |
|
266 | + * |
|
267 | 267 | * $max_depth = 0 means display all levels. |
268 | 268 | * $max_depth > 0 specifies the number of display levels. |
269 | 269 | * |
270 | - * @since 2.7.0 |
|
270 | + * @since 2.7.0 |
|
271 | 271 | * |
272 | 272 | * @param array $elements |
273 | 273 | * @param int $max_depth The maximum hierarchical depth. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param int $depth Depth of the item. |
61 | 61 | * @param array $args An array of additional arguments. |
62 | 62 | */ |
63 | - public function start_lvl( &$output, $depth = 0, $args = array() ) {} |
|
63 | + public function start_lvl(&$output, $depth = 0, $args = array()) {} |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Ends the list of after the elements are added. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param int $depth Depth of the item. |
76 | 76 | * @param array $args An array of additional arguments. |
77 | 77 | */ |
78 | - public function end_lvl( &$output, $depth = 0, $args = array() ) {} |
|
78 | + public function end_lvl(&$output, $depth = 0, $args = array()) {} |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Start the element output. |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param array $args An array of additional arguments. |
93 | 93 | * @param int $current_object_id ID of the current item. |
94 | 94 | */ |
95 | - public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {} |
|
95 | + public function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0) {} |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * Ends the element output, if needed. |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param int $depth Depth of the item. |
108 | 108 | * @param array $args An array of additional arguments. |
109 | 109 | */ |
110 | - public function end_el( &$output, $object, $depth = 0, $args = array() ) {} |
|
110 | + public function end_el(&$output, $object, $depth = 0, $args = array()) {} |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * Traverse elements to create list from elements. |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | * @param array $args An array of arguments. |
129 | 129 | * @param string $output Passed by reference. Used to append additional content. |
130 | 130 | */ |
131 | - public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
|
132 | - if ( ! $element ) { |
|
131 | + public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { |
|
132 | + if ( ! $element) { |
|
133 | 133 | return; |
134 | 134 | } |
135 | 135 | |
@@ -137,38 +137,38 @@ discard block |
||
137 | 137 | $id = $element->$id_field; |
138 | 138 | |
139 | 139 | //display this element |
140 | - $this->has_children = ! empty( $children_elements[ $id ] ); |
|
141 | - if ( isset( $args[0] ) && is_array( $args[0] ) ) { |
|
140 | + $this->has_children = ! empty($children_elements[$id]); |
|
141 | + if (isset($args[0]) && is_array($args[0])) { |
|
142 | 142 | $args[0]['has_children'] = $this->has_children; // Backwards compatibility. |
143 | 143 | } |
144 | 144 | |
145 | - $cb_args = array_merge( array(&$output, $element, $depth), $args); |
|
145 | + $cb_args = array_merge(array(&$output, $element, $depth), $args); |
|
146 | 146 | call_user_func_array(array($this, 'start_el'), $cb_args); |
147 | 147 | |
148 | 148 | // descend only when the depth is right and there are childrens for this element |
149 | - if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) { |
|
149 | + if (($max_depth == 0 || $max_depth > $depth + 1) && isset($children_elements[$id])) { |
|
150 | 150 | |
151 | - foreach( $children_elements[ $id ] as $child ){ |
|
151 | + foreach ($children_elements[$id] as $child) { |
|
152 | 152 | |
153 | - if ( !isset($newlevel) ) { |
|
153 | + if ( ! isset($newlevel)) { |
|
154 | 154 | $newlevel = true; |
155 | 155 | //start the child delimiter |
156 | - $cb_args = array_merge( array(&$output, $depth), $args); |
|
156 | + $cb_args = array_merge(array(&$output, $depth), $args); |
|
157 | 157 | call_user_func_array(array($this, 'start_lvl'), $cb_args); |
158 | 158 | } |
159 | - $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); |
|
159 | + $this->display_element($child, $children_elements, $max_depth, $depth + 1, $args, $output); |
|
160 | 160 | } |
161 | - unset( $children_elements[ $id ] ); |
|
161 | + unset($children_elements[$id]); |
|
162 | 162 | } |
163 | 163 | |
164 | - if ( isset($newlevel) && $newlevel ){ |
|
164 | + if (isset($newlevel) && $newlevel) { |
|
165 | 165 | //end the child delimiter |
166 | - $cb_args = array_merge( array(&$output, $depth), $args); |
|
166 | + $cb_args = array_merge(array(&$output, $depth), $args); |
|
167 | 167 | call_user_func_array(array($this, 'end_lvl'), $cb_args); |
168 | 168 | } |
169 | 169 | |
170 | 170 | //end this element |
171 | - $cb_args = array_merge( array(&$output, $element, $depth), $args); |
|
171 | + $cb_args = array_merge(array(&$output, $element, $depth), $args); |
|
172 | 172 | call_user_func_array(array($this, 'end_el'), $cb_args); |
173 | 173 | } |
174 | 174 | |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | * @param int $max_depth The maximum hierarchical depth. |
188 | 188 | * @return string The hierarchical item output. |
189 | 189 | */ |
190 | - public function walk( $elements, $max_depth ) { |
|
190 | + public function walk($elements, $max_depth) { |
|
191 | 191 | $args = array_slice(func_get_args(), 2); |
192 | 192 | $output = ''; |
193 | 193 | |
194 | 194 | //invalid parameter or nothing to walk |
195 | - if ( $max_depth < -1 || empty( $elements ) ) { |
|
195 | + if ($max_depth < -1 || empty($elements)) { |
|
196 | 196 | return $output; |
197 | 197 | } |
198 | 198 | |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | // flat display |
202 | 202 | if ( -1 == $max_depth ) { |
203 | 203 | $empty_array = array(); |
204 | - foreach ( $elements as $e ) |
|
205 | - $this->display_element( $e, $empty_array, 1, 0, $args, $output ); |
|
204 | + foreach ($elements as $e) |
|
205 | + $this->display_element($e, $empty_array, 1, 0, $args, $output); |
|
206 | 206 | return $output; |
207 | 207 | } |
208 | 208 | |
@@ -214,44 +214,44 @@ discard block |
||
214 | 214 | */ |
215 | 215 | $top_level_elements = array(); |
216 | 216 | $children_elements = array(); |
217 | - foreach ( $elements as $e) { |
|
218 | - if ( 0 == $e->$parent_field ) |
|
217 | + foreach ($elements as $e) { |
|
218 | + if (0 == $e->$parent_field) |
|
219 | 219 | $top_level_elements[] = $e; |
220 | 220 | else |
221 | - $children_elements[ $e->$parent_field ][] = $e; |
|
221 | + $children_elements[$e->$parent_field][] = $e; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /* |
225 | 225 | * When none of the elements is top level. |
226 | 226 | * Assume the first one must be root of the sub elements. |
227 | 227 | */ |
228 | - if ( empty($top_level_elements) ) { |
|
228 | + if (empty($top_level_elements)) { |
|
229 | 229 | |
230 | - $first = array_slice( $elements, 0, 1 ); |
|
230 | + $first = array_slice($elements, 0, 1); |
|
231 | 231 | $root = $first[0]; |
232 | 232 | |
233 | 233 | $top_level_elements = array(); |
234 | 234 | $children_elements = array(); |
235 | - foreach ( $elements as $e) { |
|
236 | - if ( $root->$parent_field == $e->$parent_field ) |
|
235 | + foreach ($elements as $e) { |
|
236 | + if ($root->$parent_field == $e->$parent_field) |
|
237 | 237 | $top_level_elements[] = $e; |
238 | 238 | else |
239 | - $children_elements[ $e->$parent_field ][] = $e; |
|
239 | + $children_elements[$e->$parent_field][] = $e; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | - foreach ( $top_level_elements as $e ) |
|
244 | - $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); |
|
243 | + foreach ($top_level_elements as $e) |
|
244 | + $this->display_element($e, $children_elements, $max_depth, 0, $args, $output); |
|
245 | 245 | |
246 | 246 | /* |
247 | 247 | * If we are displaying all levels, and remaining children_elements is not empty, |
248 | 248 | * then we got orphans, which should be displayed regardless. |
249 | 249 | */ |
250 | - if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) { |
|
250 | + if (($max_depth == 0) && count($children_elements) > 0) { |
|
251 | 251 | $empty_array = array(); |
252 | - foreach ( $children_elements as $orphans ) |
|
253 | - foreach( $orphans as $op ) |
|
254 | - $this->display_element( $op, $empty_array, 1, 0, $args, $output ); |
|
252 | + foreach ($children_elements as $orphans) |
|
253 | + foreach ($orphans as $op) |
|
254 | + $this->display_element($op, $empty_array, 1, 0, $args, $output); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | return $output; |
@@ -275,20 +275,20 @@ discard block |
||
275 | 275 | * @param int $per_page |
276 | 276 | * @return string XHTML of the specified page of elements |
277 | 277 | */ |
278 | - public function paged_walk( $elements, $max_depth, $page_num, $per_page ) { |
|
279 | - if ( empty( $elements ) || $max_depth < -1 ) { |
|
278 | + public function paged_walk($elements, $max_depth, $page_num, $per_page) { |
|
279 | + if (empty($elements) || $max_depth < -1) { |
|
280 | 280 | return ''; |
281 | 281 | } |
282 | 282 | |
283 | - $args = array_slice( func_get_args(), 4 ); |
|
283 | + $args = array_slice(func_get_args(), 4); |
|
284 | 284 | $output = ''; |
285 | 285 | |
286 | 286 | $parent_field = $this->db_fields['parent']; |
287 | 287 | |
288 | 288 | $count = -1; |
289 | 289 | if ( -1 == $max_depth ) |
290 | - $total_top = count( $elements ); |
|
291 | - if ( $page_num < 1 || $per_page < 0 ) { |
|
290 | + $total_top = count($elements); |
|
291 | + if ($page_num < 1 || $per_page < 0) { |
|
292 | 292 | // No paging |
293 | 293 | $paging = false; |
294 | 294 | $start = 0; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $this->max_pages = 1; |
298 | 298 | } else { |
299 | 299 | $paging = true; |
300 | - $start = ( (int)$page_num - 1 ) * (int)$per_page; |
|
300 | + $start = ((int) $page_num - 1) * (int) $per_page; |
|
301 | 301 | $end = $start + $per_page; |
302 | 302 | if ( -1 == $max_depth ) |
303 | 303 | $this->max_pages = ceil($total_top / $per_page); |
@@ -305,21 +305,21 @@ discard block |
||
305 | 305 | |
306 | 306 | // flat display |
307 | 307 | if ( -1 == $max_depth ) { |
308 | - if ( !empty($args[0]['reverse_top_level']) ) { |
|
309 | - $elements = array_reverse( $elements ); |
|
308 | + if ( ! empty($args[0]['reverse_top_level'])) { |
|
309 | + $elements = array_reverse($elements); |
|
310 | 310 | $oldstart = $start; |
311 | 311 | $start = $total_top - $end; |
312 | 312 | $end = $total_top - $oldstart; |
313 | 313 | } |
314 | 314 | |
315 | 315 | $empty_array = array(); |
316 | - foreach ( $elements as $e ) { |
|
316 | + foreach ($elements as $e) { |
|
317 | 317 | $count++; |
318 | - if ( $count < $start ) |
|
318 | + if ($count < $start) |
|
319 | 319 | continue; |
320 | - if ( $count >= $end ) |
|
320 | + if ($count >= $end) |
|
321 | 321 | break; |
322 | - $this->display_element( $e, $empty_array, 1, 0, $args, $output ); |
|
322 | + $this->display_element($e, $empty_array, 1, 0, $args, $output); |
|
323 | 323 | } |
324 | 324 | return $output; |
325 | 325 | } |
@@ -331,51 +331,51 @@ discard block |
||
331 | 331 | */ |
332 | 332 | $top_level_elements = array(); |
333 | 333 | $children_elements = array(); |
334 | - foreach ( $elements as $e) { |
|
335 | - if ( 0 == $e->$parent_field ) |
|
334 | + foreach ($elements as $e) { |
|
335 | + if (0 == $e->$parent_field) |
|
336 | 336 | $top_level_elements[] = $e; |
337 | 337 | else |
338 | - $children_elements[ $e->$parent_field ][] = $e; |
|
338 | + $children_elements[$e->$parent_field][] = $e; |
|
339 | 339 | } |
340 | 340 | |
341 | - $total_top = count( $top_level_elements ); |
|
342 | - if ( $paging ) |
|
341 | + $total_top = count($top_level_elements); |
|
342 | + if ($paging) |
|
343 | 343 | $this->max_pages = ceil($total_top / $per_page); |
344 | 344 | else |
345 | 345 | $end = $total_top; |
346 | 346 | |
347 | - if ( !empty($args[0]['reverse_top_level']) ) { |
|
348 | - $top_level_elements = array_reverse( $top_level_elements ); |
|
347 | + if ( ! empty($args[0]['reverse_top_level'])) { |
|
348 | + $top_level_elements = array_reverse($top_level_elements); |
|
349 | 349 | $oldstart = $start; |
350 | 350 | $start = $total_top - $end; |
351 | 351 | $end = $total_top - $oldstart; |
352 | 352 | } |
353 | - if ( !empty($args[0]['reverse_children']) ) { |
|
354 | - foreach ( $children_elements as $parent => $children ) |
|
355 | - $children_elements[$parent] = array_reverse( $children ); |
|
353 | + if ( ! empty($args[0]['reverse_children'])) { |
|
354 | + foreach ($children_elements as $parent => $children) |
|
355 | + $children_elements[$parent] = array_reverse($children); |
|
356 | 356 | } |
357 | 357 | |
358 | - foreach ( $top_level_elements as $e ) { |
|
358 | + foreach ($top_level_elements as $e) { |
|
359 | 359 | $count++; |
360 | 360 | |
361 | 361 | // For the last page, need to unset earlier children in order to keep track of orphans. |
362 | - if ( $end >= $total_top && $count < $start ) |
|
363 | - $this->unset_children( $e, $children_elements ); |
|
362 | + if ($end >= $total_top && $count < $start) |
|
363 | + $this->unset_children($e, $children_elements); |
|
364 | 364 | |
365 | - if ( $count < $start ) |
|
365 | + if ($count < $start) |
|
366 | 366 | continue; |
367 | 367 | |
368 | - if ( $count >= $end ) |
|
368 | + if ($count >= $end) |
|
369 | 369 | break; |
370 | 370 | |
371 | - $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); |
|
371 | + $this->display_element($e, $children_elements, $max_depth, 0, $args, $output); |
|
372 | 372 | } |
373 | 373 | |
374 | - if ( $end >= $total_top && count( $children_elements ) > 0 ) { |
|
374 | + if ($end >= $total_top && count($children_elements) > 0) { |
|
375 | 375 | $empty_array = array(); |
376 | - foreach ( $children_elements as $orphans ) |
|
377 | - foreach( $orphans as $op ) |
|
378 | - $this->display_element( $op, $empty_array, 1, 0, $args, $output ); |
|
376 | + foreach ($children_elements as $orphans) |
|
377 | + foreach ($orphans as $op) |
|
378 | + $this->display_element($op, $empty_array, 1, 0, $args, $output); |
|
379 | 379 | } |
380 | 380 | |
381 | 381 | return $output; |
@@ -386,12 +386,12 @@ discard block |
||
386 | 386 | * @param array $elements |
387 | 387 | * @return int |
388 | 388 | */ |
389 | - public function get_number_of_root_elements( $elements ){ |
|
389 | + public function get_number_of_root_elements($elements) { |
|
390 | 390 | $num = 0; |
391 | 391 | $parent_field = $this->db_fields['parent']; |
392 | 392 | |
393 | - foreach ( $elements as $e) { |
|
394 | - if ( 0 == $e->$parent_field ) |
|
393 | + foreach ($elements as $e) { |
|
394 | + if (0 == $e->$parent_field) |
|
395 | 395 | $num++; |
396 | 396 | } |
397 | 397 | return $num; |
@@ -403,19 +403,19 @@ discard block |
||
403 | 403 | * @param object $e |
404 | 404 | * @param array $children_elements |
405 | 405 | */ |
406 | - public function unset_children( $e, &$children_elements ){ |
|
407 | - if ( ! $e || ! $children_elements ) { |
|
406 | + public function unset_children($e, &$children_elements) { |
|
407 | + if ( ! $e || ! $children_elements) { |
|
408 | 408 | return; |
409 | 409 | } |
410 | 410 | |
411 | 411 | $id_field = $this->db_fields['id']; |
412 | 412 | $id = $e->$id_field; |
413 | 413 | |
414 | - if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) ) |
|
415 | - foreach ( (array) $children_elements[$id] as $child ) |
|
416 | - $this->unset_children( $child, $children_elements ); |
|
414 | + if ( ! empty($children_elements[$id]) && is_array($children_elements[$id])) |
|
415 | + foreach ((array) $children_elements[$id] as $child) |
|
416 | + $this->unset_children($child, $children_elements); |
|
417 | 417 | |
418 | - unset( $children_elements[ $id ] ); |
|
418 | + unset($children_elements[$id]); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | } // Walker |
@@ -201,8 +201,9 @@ discard block |
||
201 | 201 | // flat display |
202 | 202 | if ( -1 == $max_depth ) { |
203 | 203 | $empty_array = array(); |
204 | - foreach ( $elements as $e ) |
|
205 | - $this->display_element( $e, $empty_array, 1, 0, $args, $output ); |
|
204 | + foreach ( $elements as $e ) { |
|
205 | + $this->display_element( $e, $empty_array, 1, 0, $args, $output ); |
|
206 | + } |
|
206 | 207 | return $output; |
207 | 208 | } |
208 | 209 | |
@@ -215,10 +216,11 @@ discard block |
||
215 | 216 | $top_level_elements = array(); |
216 | 217 | $children_elements = array(); |
217 | 218 | foreach ( $elements as $e) { |
218 | - if ( 0 == $e->$parent_field ) |
|
219 | - $top_level_elements[] = $e; |
|
220 | - else |
|
221 | - $children_elements[ $e->$parent_field ][] = $e; |
|
219 | + if ( 0 == $e->$parent_field ) { |
|
220 | + $top_level_elements[] = $e; |
|
221 | + } else { |
|
222 | + $children_elements[ $e->$parent_field ][] = $e; |
|
223 | + } |
|
222 | 224 | } |
223 | 225 | |
224 | 226 | /* |
@@ -233,15 +235,17 @@ discard block |
||
233 | 235 | $top_level_elements = array(); |
234 | 236 | $children_elements = array(); |
235 | 237 | foreach ( $elements as $e) { |
236 | - if ( $root->$parent_field == $e->$parent_field ) |
|
237 | - $top_level_elements[] = $e; |
|
238 | - else |
|
239 | - $children_elements[ $e->$parent_field ][] = $e; |
|
238 | + if ( $root->$parent_field == $e->$parent_field ) { |
|
239 | + $top_level_elements[] = $e; |
|
240 | + } else { |
|
241 | + $children_elements[ $e->$parent_field ][] = $e; |
|
242 | + } |
|
240 | 243 | } |
241 | 244 | } |
242 | 245 | |
243 | - foreach ( $top_level_elements as $e ) |
|
244 | - $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); |
|
246 | + foreach ( $top_level_elements as $e ) { |
|
247 | + $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); |
|
248 | + } |
|
245 | 249 | |
246 | 250 | /* |
247 | 251 | * If we are displaying all levels, and remaining children_elements is not empty, |
@@ -249,9 +253,10 @@ discard block |
||
249 | 253 | */ |
250 | 254 | if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) { |
251 | 255 | $empty_array = array(); |
252 | - foreach ( $children_elements as $orphans ) |
|
253 | - foreach( $orphans as $op ) |
|
256 | + foreach ( $children_elements as $orphans ) { |
|
257 | + foreach( $orphans as $op ) |
|
254 | 258 | $this->display_element( $op, $empty_array, 1, 0, $args, $output ); |
259 | + } |
|
255 | 260 | } |
256 | 261 | |
257 | 262 | return $output; |
@@ -286,21 +291,24 @@ discard block |
||
286 | 291 | $parent_field = $this->db_fields['parent']; |
287 | 292 | |
288 | 293 | $count = -1; |
289 | - if ( -1 == $max_depth ) |
|
290 | - $total_top = count( $elements ); |
|
294 | + if ( -1 == $max_depth ) { |
|
295 | + $total_top = count( $elements ); |
|
296 | + } |
|
291 | 297 | if ( $page_num < 1 || $per_page < 0 ) { |
292 | 298 | // No paging |
293 | 299 | $paging = false; |
294 | 300 | $start = 0; |
295 | - if ( -1 == $max_depth ) |
|
296 | - $end = $total_top; |
|
301 | + if ( -1 == $max_depth ) { |
|
302 | + $end = $total_top; |
|
303 | + } |
|
297 | 304 | $this->max_pages = 1; |
298 | 305 | } else { |
299 | 306 | $paging = true; |
300 | 307 | $start = ( (int)$page_num - 1 ) * (int)$per_page; |
301 | 308 | $end = $start + $per_page; |
302 | - if ( -1 == $max_depth ) |
|
303 | - $this->max_pages = ceil($total_top / $per_page); |
|
309 | + if ( -1 == $max_depth ) { |
|
310 | + $this->max_pages = ceil($total_top / $per_page); |
|
311 | + } |
|
304 | 312 | } |
305 | 313 | |
306 | 314 | // flat display |
@@ -315,10 +323,12 @@ discard block |
||
315 | 323 | $empty_array = array(); |
316 | 324 | foreach ( $elements as $e ) { |
317 | 325 | $count++; |
318 | - if ( $count < $start ) |
|
319 | - continue; |
|
320 | - if ( $count >= $end ) |
|
321 | - break; |
|
326 | + if ( $count < $start ) { |
|
327 | + continue; |
|
328 | + } |
|
329 | + if ( $count >= $end ) { |
|
330 | + break; |
|
331 | + } |
|
322 | 332 | $this->display_element( $e, $empty_array, 1, 0, $args, $output ); |
323 | 333 | } |
324 | 334 | return $output; |
@@ -332,17 +342,19 @@ discard block |
||
332 | 342 | $top_level_elements = array(); |
333 | 343 | $children_elements = array(); |
334 | 344 | foreach ( $elements as $e) { |
335 | - if ( 0 == $e->$parent_field ) |
|
336 | - $top_level_elements[] = $e; |
|
337 | - else |
|
338 | - $children_elements[ $e->$parent_field ][] = $e; |
|
345 | + if ( 0 == $e->$parent_field ) { |
|
346 | + $top_level_elements[] = $e; |
|
347 | + } else { |
|
348 | + $children_elements[ $e->$parent_field ][] = $e; |
|
349 | + } |
|
339 | 350 | } |
340 | 351 | |
341 | 352 | $total_top = count( $top_level_elements ); |
342 | - if ( $paging ) |
|
343 | - $this->max_pages = ceil($total_top / $per_page); |
|
344 | - else |
|
345 | - $end = $total_top; |
|
353 | + if ( $paging ) { |
|
354 | + $this->max_pages = ceil($total_top / $per_page); |
|
355 | + } else { |
|
356 | + $end = $total_top; |
|
357 | + } |
|
346 | 358 | |
347 | 359 | if ( !empty($args[0]['reverse_top_level']) ) { |
348 | 360 | $top_level_elements = array_reverse( $top_level_elements ); |
@@ -351,31 +363,36 @@ discard block |
||
351 | 363 | $end = $total_top - $oldstart; |
352 | 364 | } |
353 | 365 | if ( !empty($args[0]['reverse_children']) ) { |
354 | - foreach ( $children_elements as $parent => $children ) |
|
355 | - $children_elements[$parent] = array_reverse( $children ); |
|
366 | + foreach ( $children_elements as $parent => $children ) { |
|
367 | + $children_elements[$parent] = array_reverse( $children ); |
|
368 | + } |
|
356 | 369 | } |
357 | 370 | |
358 | 371 | foreach ( $top_level_elements as $e ) { |
359 | 372 | $count++; |
360 | 373 | |
361 | 374 | // For the last page, need to unset earlier children in order to keep track of orphans. |
362 | - if ( $end >= $total_top && $count < $start ) |
|
363 | - $this->unset_children( $e, $children_elements ); |
|
375 | + if ( $end >= $total_top && $count < $start ) { |
|
376 | + $this->unset_children( $e, $children_elements ); |
|
377 | + } |
|
364 | 378 | |
365 | - if ( $count < $start ) |
|
366 | - continue; |
|
379 | + if ( $count < $start ) { |
|
380 | + continue; |
|
381 | + } |
|
367 | 382 | |
368 | - if ( $count >= $end ) |
|
369 | - break; |
|
383 | + if ( $count >= $end ) { |
|
384 | + break; |
|
385 | + } |
|
370 | 386 | |
371 | 387 | $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); |
372 | 388 | } |
373 | 389 | |
374 | 390 | if ( $end >= $total_top && count( $children_elements ) > 0 ) { |
375 | 391 | $empty_array = array(); |
376 | - foreach ( $children_elements as $orphans ) |
|
377 | - foreach( $orphans as $op ) |
|
392 | + foreach ( $children_elements as $orphans ) { |
|
393 | + foreach( $orphans as $op ) |
|
378 | 394 | $this->display_element( $op, $empty_array, 1, 0, $args, $output ); |
395 | + } |
|
379 | 396 | } |
380 | 397 | |
381 | 398 | return $output; |
@@ -391,8 +408,9 @@ discard block |
||
391 | 408 | $parent_field = $this->db_fields['parent']; |
392 | 409 | |
393 | 410 | foreach ( $elements as $e) { |
394 | - if ( 0 == $e->$parent_field ) |
|
395 | - $num++; |
|
411 | + if ( 0 == $e->$parent_field ) { |
|
412 | + $num++; |
|
413 | + } |
|
396 | 414 | } |
397 | 415 | return $num; |
398 | 416 | } |
@@ -411,9 +429,10 @@ discard block |
||
411 | 429 | $id_field = $this->db_fields['id']; |
412 | 430 | $id = $e->$id_field; |
413 | 431 | |
414 | - if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) ) |
|
415 | - foreach ( (array) $children_elements[$id] as $child ) |
|
432 | + if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) ) { |
|
433 | + foreach ( (array) $children_elements[$id] as $child ) |
|
416 | 434 | $this->unset_children( $child, $children_elements ); |
435 | + } |
|
417 | 436 | |
418 | 437 | unset( $children_elements[ $id ] ); |
419 | 438 | } |