Changeset 28481
- Timestamp:
- 05/18/2014 09:30:43 PM (11 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/custom-background.php
r27469 r28481 23 23 * @access private 24 24 */ 25 var$admin_header_callback;25 private $admin_header_callback; 26 26 27 27 /** … … 32 32 * @access private 33 33 */ 34 var$admin_image_div_callback;34 private $admin_image_div_callback; 35 35 36 36 /** … … 41 41 * @access private 42 42 */ 43 var$page = '';43 private $page = ''; 44 44 45 45 /** … … 51 51 * @return Custom_Background 52 52 */ 53 function __construct($admin_header_callback = '', $admin_image_div_callback = '') {53 public function __construct($admin_header_callback = '', $admin_image_div_callback = '') { 54 54 $this->admin_header_callback = $admin_header_callback; 55 55 $this->admin_image_div_callback = $admin_image_div_callback; … … 60 60 61 61 /** 62 * Make private properties readable for backwards compatibility 63 * 64 * @since 4.0.0 65 * @param string $name 66 * @return mixed 67 */ 68 public function __get( $name ) { 69 return $this->$name; 70 } 71 72 /** 62 73 * Set up the hooks for the Custom Background admin page. 63 74 * 64 75 * @since 3.0.0 65 76 */ 66 function init() {77 public function init() { 67 78 if ( ! current_user_can('edit_theme_options') ) 68 79 return; … … 83 94 * @since 3.0.0 84 95 */ 85 function admin_load() {96 public function admin_load() { 86 97 get_current_screen()->add_help_tab( array( 87 98 'id' => 'overview', … … 110 121 * @since 3.0.0 111 122 */ 112 function take_action() {123 public function take_action() { 113 124 114 125 if ( empty($_POST) ) … … 177 188 * @since 3.0.0 178 189 */ 179 function admin_page() {190 public function admin_page() { 180 191 ?> 181 192 <div class="wrap" id="custom-background"> … … 344 355 * @since 3.0.0 345 356 */ 346 function handle_upload() {357 public function handle_upload() { 347 358 348 359 if ( empty($_FILES) ) … … 398 409 * @since 3.4.0 399 410 */ 400 function attachment_fields_to_edit( $form_fields ) {411 public function attachment_fields_to_edit( $form_fields ) { 401 412 return $form_fields; 402 413 } … … 407 418 * @since 3.4.0 408 419 */ 409 function filter_upload_tabs( $tabs ) {420 public function filter_upload_tabs( $tabs ) { 410 421 return $tabs; 411 422 } -
trunk/src/wp-admin/custom-header.php
r28384 r28481 23 23 * @access private 24 24 */ 25 var$admin_header_callback;25 private $admin_header_callback; 26 26 27 27 /** … … 32 32 * @access private 33 33 */ 34 var$admin_image_div_callback;34 private $admin_image_div_callback; 35 35 36 36 /** … … 41 41 * @access private 42 42 */ 43 var$default_headers = array();43 private $default_headers = array(); 44 44 45 45 /** … … 50 50 * @access private 51 51 */ 52 var$uploaded_headers = array();52 private $uploaded_headers = array(); 53 53 54 54 /** … … 59 59 * @access private 60 60 */ 61 var$page = '';61 private $page = ''; 62 62 63 63 /** … … 69 69 * @return Custom_Image_Header 70 70 */ 71 function __construct($admin_header_callback, $admin_image_div_callback = '') {71 public function __construct($admin_header_callback, $admin_image_div_callback = '') { 72 72 $this->admin_header_callback = $admin_header_callback; 73 73 $this->admin_image_div_callback = $admin_image_div_callback; … … 82 82 83 83 /** 84 * Make private properties readable for backwards compatibility 85 * 86 * @since 4.0.0 87 * @param string $name 88 * @return mixed 89 */ 90 public function __get( $name ) { 91 return $this->$name; 92 } 93 94 /** 84 95 * Set up the hooks for the Custom Header admin page. 85 96 * 86 97 * @since 2.1.0 87 98 */ 88 function init() {99 public function init() { 89 100 if ( ! current_user_can('edit_theme_options') ) 90 101 return; … … 107 118 * @since 3.0.0 108 119 */ 109 function help() {120 public function help() { 110 121 get_current_screen()->add_help_tab( array( 111 122 'id' => 'overview', … … 149 160 * @return int Current step 150 161 */ 151 function step() {162 public function step() { 152 163 if ( ! isset( $_GET['step'] ) ) 153 164 return 1; … … 168 179 * @since 2.1.0 169 180 */ 170 function js_includes() {181 public function js_includes() { 171 182 $step = $this->step(); 172 183 … … 186 197 * @since 2.7.0 187 198 */ 188 function css_includes() {199 public function css_includes() { 189 200 $step = $this->step(); 190 201 … … 200 211 * @since 2.6.0 201 212 */ 202 function take_action() {213 public function take_action() { 203 214 if ( ! current_user_can('edit_theme_options') ) 204 215 return; … … 246 257 * @since 3.0.0 247 258 */ 248 function process_default_headers() {259 public function process_default_headers() { 249 260 global $_wp_default_headers; 250 261 … … 276 287 * @since 3.0.0 277 288 */ 278 function show_header_selector( $type = 'default' ) {289 public function show_header_selector( $type = 'default' ) { 279 290 if ( 'default' == $type ) { 280 291 $headers = $this->default_headers; … … 313 324 * @since 2.1.0 314 325 */ 315 function js() {326 public function js() { 316 327 $step = $this->step(); 317 328 if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) … … 326 337 * @since 2.6.0 327 338 */ 328 function js_1() {339 public function js_1() { 329 340 $default_color = ''; 330 341 if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) { … … 342 353 header_text_fields; 343 354 344 function pickColor(color) {355 public function pickColor(color) { 345 356 $('#name').css('color', color); 346 357 $('#desc').css('color', color); … … 348 359 } 349 360 350 function toggle_text() {361 public function toggle_text() { 351 362 var checked = $('#display-header-text').prop('checked'), 352 363 text_color; … … 390 401 * @since 2.6.0 391 402 */ 392 function js_2() { ?>403 public function js_2() { ?> 393 404 <script type="text/javascript"> 394 405 /* <![CDATA[ */ 395 function onEndCrop( coords ) {406 public function onEndCrop( coords ) { 396 407 jQuery( '#x1' ).val(coords.x); 397 408 jQuery( '#y1' ).val(coords.y); … … 442 453 } 443 454 ?> 444 onInit: function () {455 onInit: public function () { 445 456 jQuery('#width').val(xinit); 446 457 jQuery('#height').val(yinit); … … 464 475 * @since 2.1.0 465 476 */ 466 function step_1() {477 public function step_1() { 467 478 $this->process_default_headers(); 468 479 ?> … … 682 693 * @since 2.1.0 683 694 */ 684 function step_2() {695 public function step_2() { 685 696 check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload'); 686 697 if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) … … 796 807 * @since 3.4.0 797 808 */ 798 function step_2_manage_upload() {809 public function step_2_manage_upload() { 799 810 $overrides = array('test_form' => false); 800 811 … … 833 844 * @since 2.1.0 834 845 */ 835 function step_3() {846 public function step_3() { 836 847 check_admin_referer( 'custom-header-crop-image' ); 837 848 … … 909 920 * @since 2.1.0 910 921 */ 911 function finished() {922 public function finished() { 912 923 $this->updated = true; 913 924 $this->step_1(); … … 919 930 * @since 2.1.0 920 931 */ 921 function admin_page() {932 public function admin_page() { 922 933 if ( ! current_user_can('edit_theme_options') ) 923 934 wp_die(__('You do not have permission to customize headers.')); … … 936 947 * @since 3.4.0 937 948 */ 938 function attachment_fields_to_edit( $form_fields ) {949 public function attachment_fields_to_edit( $form_fields ) { 939 950 return $form_fields; 940 951 } … … 945 956 * @since 3.4.0 946 957 */ 947 function filter_upload_tabs( $tabs ) {958 public function filter_upload_tabs( $tabs ) { 948 959 return $tabs; 949 960 } … … 1148 1159 * new object. Returns JSON-encoded object details. 1149 1160 */ 1150 function ajax_header_crop() {1161 public function ajax_header_crop() { 1151 1162 check_ajax_referer( 'image_editor-' . $_POST['id'], 'nonce' ); 1152 1163 … … 1205 1216 * Media Manager, even if s/he doesn't save that change. 1206 1217 */ 1207 function ajax_header_add() {1218 public function ajax_header_add() { 1208 1219 check_ajax_referer( 'header-add', 'nonce' ); 1209 1220 … … 1231 1242 * choice in the Customizer's Header tool. 1232 1243 */ 1233 function ajax_header_remove() {1244 public function ajax_header_remove() { 1234 1245 check_ajax_referer( 'header-remove', 'nonce' ); 1235 1246 … … 1250 1261 } 1251 1262 1252 function customize_set_last_used( $wp_customize ) {1263 public function customize_set_last_used( $wp_customize ) { 1253 1264 $data = $wp_customize->get_setting( 'header_image_data' )->post_value(); 1254 1265
Note: See TracChangeset
for help on using the changeset viewer.