wp/wp-admin/includes/options.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    47 			}
    47 			}
    48 
    48 
    49 			$siteName.text( title );
    49 			$siteName.text( title );
    50 		});
    50 		});
    51 
    51 
    52 		$("input[name='date_format']").click(function(){
    52 		$( 'input[name="date_format"]' ).click( function() {
    53 			if ( "date_format_custom_radio" != $(this).attr("id") )
    53 			if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )
    54 				$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    54 				$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    55 		});
    55 		});
       
    56 
    56 		$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    57 		$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    57 			$( '#date_format_custom_radio' ).prop( 'checked', true );
    58 			$( '#date_format_custom_radio' ).prop( 'checked', true );
    58 		});
    59 		});
    59 
    60 
    60 		$("input[name='time_format']").click(function(){
    61 		$( 'input[name="time_format"]' ).click( function() {
    61 			if ( "time_format_custom_radio" != $(this).attr("id") )
    62 			if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )
    62 				$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    63 				$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    63 		});
    64 		});
    64 
    65 
    65 		$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
    66 		$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
    66 			$( '#time_format_custom_radio' ).prop( 'checked', true );
    67 			$( '#time_format_custom_radio' ).prop( 'checked', true );
    78 				// If custom date is not empty.
    79 				// If custom date is not empty.
    79 				if ( format.val() ) {
    80 				if ( format.val() ) {
    80 					spinner.addClass( 'is-active' );
    81 					spinner.addClass( 'is-active' );
    81 
    82 
    82 					$.post( ajaxurl, {
    83 					$.post( ajaxurl, {
    83 						action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format',
    84 						action: 'date_format_custom' === format.attr( 'name' ) ? 'date_format' : 'time_format',
    84 						date 	: format.val()
    85 						date 	: format.val()
    85 					}, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
    86 					}, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
    86 				}
    87 				}
    87 			}, 500 ) );
    88 			}, 500 ) );
    88 		} );
    89 		} );
   127  *
   128  *
   128  * @since 3.5.0
   129  * @since 3.5.0
   129  */
   130  */
   130 function options_reading_blog_charset() {
   131 function options_reading_blog_charset() {
   131 	echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
   132 	echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
   132 	echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
   133 	echo '<p class="description">' . __( 'The <a href="https://wordpress.org/support/article/glossary/#character-set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
   133 }
   134 }