wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
image_align_input_fields › WordPress Function
Da2.7.0
Deprecaton/a
› image_align_input_fields ( $post, $checked = '' )
Parametri: (2) |
|
Ritorna: |
|
Definito a: |
|
Codex: |
Retrieves HTML for the image alignment radio buttons with the specified one checked.
Funzioni correlate: image_link_input_fields, image_size_input_fields, get_plugin_files, comment_id_fields, get_post_field
Sorgenti
function image_align_input_fields( $post, $checked = '' ) { if ( empty( $checked ) ) { $checked = get_user_setting( 'align', 'none' ); } $alignments = array( 'none' => __( 'None' ), 'left' => __( 'Left' ), 'center' => __( 'Center' ), 'right' => __( 'Right' ), ); if ( ! array_key_exists( (string) $checked, $alignments ) ) { $checked = 'none'; } $output = array(); foreach ( $alignments as $name => $label ) { $name = esc_attr( $name ); $output[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'" . ( $checked == $name ? " checked='checked'" : '' ) . " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>"; } return implode( "\n", $output ); }