223 | set_parentage( $parent_file ); 227 | 228 | ?> 229 | 230 |
231 | render_screen_meta(); 234 | 235 | if ( is_network_admin() ) { 236 | /** 237 | * Prints network admin screen notices. 238 | * 239 | * @since 3.1.0 240 | */ 241 | do_action( 'network_admin_notices' ); 242 | } elseif ( is_user_admin() ) { 243 | /** 244 | * Prints user admin screen notices. 245 | * 246 | * @since 3.1.0 247 | */ 248 | do_action( 'user_admin_notices' ); 249 | } else { 250 | /** 251 | * Prints admin screen notices. 252 | * 253 | * @since 3.1.0 254 | */ 255 | do_action( 'admin_notices' ); 256 | } 257 | 258 | /** 259 | * Prints generic admin screen notices. 260 | * 261 | * @since 3.1.0 262 | */ 263 | do_action( 'all_admin_notices' ); 264 | 265 | if ( $parent_file == 'options-general.php' ) 266 | require(ABSPATH . 'wp-admin/options-head.php'); 267 | -------------------------------------------------------------------------------- /sources/wp-admin/admin-post.php: -------------------------------------------------------------------------------- 1 | post_type ) 45 | wp_die( __( 'Invalid post type.' ) ); 46 | if ( ! current_user_can( 'edit_post', $id ) ) 47 | wp_die( __( 'Sorry, you are not allowed to edit this item.' ) ); 48 | 49 | switch ( $_REQUEST['fetch'] ) { 50 | case 3 : 51 | if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) 52 | echo ''; 53 | echo '' . _x( 'Edit', 'media item' ) . ''; 54 | 55 | // Title shouldn't ever be empty, but use filename just in case. 56 | $file = get_attached_file( $post->ID ); 57 | $title = $post->post_title ? $post->post_title : wp_basename( $file ); 58 | echo '
' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '
'; 59 | break; 60 | case 2 : 61 | add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); 62 | echo get_media_item($id, array( 'send' => false, 'delete' => true )); 63 | break; 64 | default: 65 | add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); 66 | echo get_media_item($id); 67 | break; 68 | } 69 | exit; 70 | } 71 | 72 | check_admin_referer('media-form'); 73 | 74 | $post_id = 0; 75 | if ( isset( $_REQUEST['post_id'] ) ) { 76 | $post_id = absint( $_REQUEST['post_id'] ); 77 | if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) 78 | $post_id = 0; 79 | } 80 | 81 | $id = media_handle_upload( 'async-upload', $post_id ); 82 | if ( is_wp_error($id) ) { 83 | echo '
84 | ' . __('Dismiss') . ' 85 | ' . sprintf(__('“%s” has failed to upload.'), esc_html($_FILES['async-upload']['name']) ) . '
' . 86 | esc_html($id->get_error_message()) . '
'; 87 | exit; 88 | } 89 | 90 | if ( $_REQUEST['short'] ) { 91 | // Short form response - attachment ID only. 92 | echo $id; 93 | } else { 94 | // Long form response - big chunk o html. 95 | $type = $_REQUEST['type']; 96 | 97 | /** 98 | * Filters the returned ID of an uploaded attachment. 99 | * 100 | * The dynamic portion of the hook name, `$type`, refers to the attachment type, 101 | * such as 'image', 'audio', 'video', 'file', etc. 102 | * 103 | * @since 2.5.0 104 | * 105 | * @param int $id Uploaded attachment ID. 106 | */ 107 | echo apply_filters( "async_upload_{$type}", $id ); 108 | } 109 | -------------------------------------------------------------------------------- /sources/wp-admin/credits.php: -------------------------------------------------------------------------------- 1 | 19 |
20 | 21 |

22 | 23 |

24 | 25 |
26 | 27 | 33 | 34 |
35 | '; 41 | /* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */ 42 | printf( __( 'WordPress is created by a worldwide team of passionate individuals. Get involved in WordPress.' ), 43 | 'https://wordpress.org/about/', 44 | __( 'https://make.wordpress.org/' ) 45 | ); 46 | echo '

'; 47 | echo '
'; 48 | echo '
'; 49 | include( ABSPATH . 'wp-admin/admin-footer.php' ); 50 | exit; 51 | } 52 | 53 | echo '

' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "

\n"; 54 | 55 | foreach ( $credits['groups'] as $group_slug => $group_data ) { 56 | if ( $group_data['name'] ) { 57 | if ( 'Translators' == $group_data['name'] ) { 58 | // Considered a special slug in the API response. (Also, will never be returned for en_US.) 59 | $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' ); 60 | } elseif ( isset( $group_data['placeholders'] ) ) { 61 | $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] ); 62 | } else { 63 | $title = translate( $group_data['name'] ); 64 | } 65 | 66 | echo '

' . esc_html( $title ) . "

\n"; 67 | } 68 | 69 | if ( ! empty( $group_data['shuffle'] ) ) 70 | shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt. 71 | 72 | switch ( $group_data['type'] ) { 73 | case 'list' : 74 | array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] ); 75 | echo '

' . wp_sprintf( '%l.', $group_data['data'] ) . "

\n\n"; 76 | break; 77 | case 'libraries' : 78 | array_walk( $group_data['data'], '_wp_credits_build_object_link' ); 79 | echo '

' . wp_sprintf( '%l.', $group_data['data'] ) . "

\n\n"; 80 | break; 81 | default: 82 | $compact = 'compact' == $group_data['type']; 83 | $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' ); 84 | echo '\n"; 99 | break; 100 | } 101 | } 102 | 103 | ?> 104 |

Get involved in WordPress.' ), 107 | __( 'https://make.wordpress.org/' ) 108 | ); 109 | ?>

110 | 111 |
112 |