Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: media.php
if ( isset( $meta['width'] ) ) {
[4500] Fix | Delete
$response['width'] = (int) $meta['width'];
[4501] Fix | Delete
}
[4502] Fix | Delete
if ( isset( $meta['height'] ) ) {
[4503] Fix | Delete
$response['height'] = (int) $meta['height'];
[4504] Fix | Delete
}
[4505] Fix | Delete
}
[4506] Fix | Delete
[4507] Fix | Delete
if ( $meta && ( 'audio' === $type || 'video' === $type ) ) {
[4508] Fix | Delete
if ( isset( $meta['length_formatted'] ) ) {
[4509] Fix | Delete
$response['fileLength'] = $meta['length_formatted'];
[4510] Fix | Delete
$response['fileLengthHumanReadable'] = human_readable_duration( $meta['length_formatted'] );
[4511] Fix | Delete
}
[4512] Fix | Delete
[4513] Fix | Delete
$response['meta'] = array();
[4514] Fix | Delete
foreach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {
[4515] Fix | Delete
$response['meta'][ $key ] = false;
[4516] Fix | Delete
[4517] Fix | Delete
if ( ! empty( $meta[ $key ] ) ) {
[4518] Fix | Delete
$response['meta'][ $key ] = $meta[ $key ];
[4519] Fix | Delete
}
[4520] Fix | Delete
}
[4521] Fix | Delete
[4522] Fix | Delete
$id = get_post_thumbnail_id( $attachment->ID );
[4523] Fix | Delete
if ( ! empty( $id ) ) {
[4524] Fix | Delete
list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'full' );
[4525] Fix | Delete
$response['image'] = compact( 'src', 'width', 'height' );
[4526] Fix | Delete
list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' );
[4527] Fix | Delete
$response['thumb'] = compact( 'src', 'width', 'height' );
[4528] Fix | Delete
} else {
[4529] Fix | Delete
$src = wp_mime_type_icon( $attachment->ID, '.svg' );
[4530] Fix | Delete
$width = 48;
[4531] Fix | Delete
$height = 64;
[4532] Fix | Delete
$response['image'] = compact( 'src', 'width', 'height' );
[4533] Fix | Delete
$response['thumb'] = compact( 'src', 'width', 'height' );
[4534] Fix | Delete
}
[4535] Fix | Delete
}
[4536] Fix | Delete
[4537] Fix | Delete
if ( function_exists( 'get_compat_media_markup' ) ) {
[4538] Fix | Delete
$response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) );
[4539] Fix | Delete
}
[4540] Fix | Delete
[4541] Fix | Delete
if ( function_exists( 'get_media_states' ) ) {
[4542] Fix | Delete
$media_states = get_media_states( $attachment );
[4543] Fix | Delete
if ( ! empty( $media_states ) ) {
[4544] Fix | Delete
$response['mediaStates'] = implode( ', ', $media_states );
[4545] Fix | Delete
}
[4546] Fix | Delete
}
[4547] Fix | Delete
[4548] Fix | Delete
/**
[4549] Fix | Delete
* Filters the attachment data prepared for JavaScript.
[4550] Fix | Delete
*
[4551] Fix | Delete
* @since 3.5.0
[4552] Fix | Delete
*
[4553] Fix | Delete
* @param array $response Array of prepared attachment data. See {@see wp_prepare_attachment_for_js()}.
[4554] Fix | Delete
* @param WP_Post $attachment Attachment object.
[4555] Fix | Delete
* @param array|false $meta Array of attachment meta data, or false if there is none.
[4556] Fix | Delete
*/
[4557] Fix | Delete
return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
[4558] Fix | Delete
}
[4559] Fix | Delete
[4560] Fix | Delete
/**
[4561] Fix | Delete
* Enqueues all scripts, styles, settings, and templates necessary to use
[4562] Fix | Delete
* all media JS APIs.
[4563] Fix | Delete
*
[4564] Fix | Delete
* @since 3.5.0
[4565] Fix | Delete
*
[4566] Fix | Delete
* @global int $content_width
[4567] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[4568] Fix | Delete
* @global WP_Locale $wp_locale WordPress date and time locale object.
[4569] Fix | Delete
*
[4570] Fix | Delete
* @param array $args {
[4571] Fix | Delete
* Arguments for enqueuing media scripts.
[4572] Fix | Delete
*
[4573] Fix | Delete
* @type int|WP_Post $post Post ID or post object.
[4574] Fix | Delete
* }
[4575] Fix | Delete
*/
[4576] Fix | Delete
function wp_enqueue_media( $args = array() ) {
[4577] Fix | Delete
// Enqueue me just once per page, please.
[4578] Fix | Delete
if ( did_action( 'wp_enqueue_media' ) ) {
[4579] Fix | Delete
return;
[4580] Fix | Delete
}
[4581] Fix | Delete
[4582] Fix | Delete
global $content_width, $wpdb, $wp_locale;
[4583] Fix | Delete
[4584] Fix | Delete
$defaults = array(
[4585] Fix | Delete
'post' => null,
[4586] Fix | Delete
);
[4587] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[4588] Fix | Delete
[4589] Fix | Delete
/*
[4590] Fix | Delete
* We're going to pass the old thickbox media tabs to `media_upload_tabs`
[4591] Fix | Delete
* to ensure plugins will work. We will then unset those tabs.
[4592] Fix | Delete
*/
[4593] Fix | Delete
$tabs = array(
[4594] Fix | Delete
// handler action suffix => tab label
[4595] Fix | Delete
'type' => '',
[4596] Fix | Delete
'type_url' => '',
[4597] Fix | Delete
'gallery' => '',
[4598] Fix | Delete
'library' => '',
[4599] Fix | Delete
);
[4600] Fix | Delete
[4601] Fix | Delete
/** This filter is documented in wp-admin/includes/media.php */
[4602] Fix | Delete
$tabs = apply_filters( 'media_upload_tabs', $tabs );
[4603] Fix | Delete
unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
[4604] Fix | Delete
[4605] Fix | Delete
$props = array(
[4606] Fix | Delete
'link' => get_option( 'image_default_link_type' ), // DB default is 'file'.
[4607] Fix | Delete
'align' => get_option( 'image_default_align' ), // Empty default.
[4608] Fix | Delete
'size' => get_option( 'image_default_size' ), // Empty default.
[4609] Fix | Delete
);
[4610] Fix | Delete
[4611] Fix | Delete
$exts = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() );
[4612] Fix | Delete
$mimes = get_allowed_mime_types();
[4613] Fix | Delete
$ext_mimes = array();
[4614] Fix | Delete
foreach ( $exts as $ext ) {
[4615] Fix | Delete
foreach ( $mimes as $ext_preg => $mime_match ) {
[4616] Fix | Delete
if ( preg_match( '#' . $ext . '#i', $ext_preg ) ) {
[4617] Fix | Delete
$ext_mimes[ $ext ] = $mime_match;
[4618] Fix | Delete
break;
[4619] Fix | Delete
}
[4620] Fix | Delete
}
[4621] Fix | Delete
}
[4622] Fix | Delete
[4623] Fix | Delete
/**
[4624] Fix | Delete
* Allows showing or hiding the "Create Audio Playlist" button in the media library.
[4625] Fix | Delete
*
[4626] Fix | Delete
* By default, the "Create Audio Playlist" button will always be shown in
[4627] Fix | Delete
* the media library. If this filter returns `null`, a query will be run
[4628] Fix | Delete
* to determine whether the media library contains any audio items. This
[4629] Fix | Delete
* was the default behavior prior to version 4.8.0, but this query is
[4630] Fix | Delete
* expensive for large media libraries.
[4631] Fix | Delete
*
[4632] Fix | Delete
* @since 4.7.4
[4633] Fix | Delete
* @since 4.8.0 The filter's default value is `true` rather than `null`.
[4634] Fix | Delete
*
[4635] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/31071
[4636] Fix | Delete
*
[4637] Fix | Delete
* @param bool|null $show Whether to show the button, or `null` to decide based
[4638] Fix | Delete
* on whether any audio files exist in the media library.
[4639] Fix | Delete
*/
[4640] Fix | Delete
$show_audio_playlist = apply_filters( 'media_library_show_audio_playlist', true );
[4641] Fix | Delete
if ( null === $show_audio_playlist ) {
[4642] Fix | Delete
$show_audio_playlist = $wpdb->get_var(
[4643] Fix | Delete
"SELECT ID
[4644] Fix | Delete
FROM $wpdb->posts
[4645] Fix | Delete
WHERE post_type = 'attachment'
[4646] Fix | Delete
AND post_mime_type LIKE 'audio%'
[4647] Fix | Delete
LIMIT 1"
[4648] Fix | Delete
);
[4649] Fix | Delete
}
[4650] Fix | Delete
[4651] Fix | Delete
/**
[4652] Fix | Delete
* Allows showing or hiding the "Create Video Playlist" button in the media library.
[4653] Fix | Delete
*
[4654] Fix | Delete
* By default, the "Create Video Playlist" button will always be shown in
[4655] Fix | Delete
* the media library. If this filter returns `null`, a query will be run
[4656] Fix | Delete
* to determine whether the media library contains any video items. This
[4657] Fix | Delete
* was the default behavior prior to version 4.8.0, but this query is
[4658] Fix | Delete
* expensive for large media libraries.
[4659] Fix | Delete
*
[4660] Fix | Delete
* @since 4.7.4
[4661] Fix | Delete
* @since 4.8.0 The filter's default value is `true` rather than `null`.
[4662] Fix | Delete
*
[4663] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/31071
[4664] Fix | Delete
*
[4665] Fix | Delete
* @param bool|null $show Whether to show the button, or `null` to decide based
[4666] Fix | Delete
* on whether any video files exist in the media library.
[4667] Fix | Delete
*/
[4668] Fix | Delete
$show_video_playlist = apply_filters( 'media_library_show_video_playlist', true );
[4669] Fix | Delete
if ( null === $show_video_playlist ) {
[4670] Fix | Delete
$show_video_playlist = $wpdb->get_var(
[4671] Fix | Delete
"SELECT ID
[4672] Fix | Delete
FROM $wpdb->posts
[4673] Fix | Delete
WHERE post_type = 'attachment'
[4674] Fix | Delete
AND post_mime_type LIKE 'video%'
[4675] Fix | Delete
LIMIT 1"
[4676] Fix | Delete
);
[4677] Fix | Delete
}
[4678] Fix | Delete
[4679] Fix | Delete
/**
[4680] Fix | Delete
* Allows overriding the list of months displayed in the media library.
[4681] Fix | Delete
*
[4682] Fix | Delete
* By default (if this filter does not return an array), a query will be
[4683] Fix | Delete
* run to determine the months that have media items. This query can be
[4684] Fix | Delete
* expensive for large media libraries, so it may be desirable for sites to
[4685] Fix | Delete
* override this behavior.
[4686] Fix | Delete
*
[4687] Fix | Delete
* @since 4.7.4
[4688] Fix | Delete
*
[4689] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/31071
[4690] Fix | Delete
*
[4691] Fix | Delete
* @param stdClass[]|null $months An array of objects with `month` and `year`
[4692] Fix | Delete
* properties, or `null` for default behavior.
[4693] Fix | Delete
*/
[4694] Fix | Delete
$months = apply_filters( 'media_library_months_with_files', null );
[4695] Fix | Delete
if ( ! is_array( $months ) ) {
[4696] Fix | Delete
$months = $wpdb->get_results(
[4697] Fix | Delete
$wpdb->prepare(
[4698] Fix | Delete
"SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
[4699] Fix | Delete
FROM $wpdb->posts
[4700] Fix | Delete
WHERE post_type = %s
[4701] Fix | Delete
ORDER BY post_date DESC",
[4702] Fix | Delete
'attachment'
[4703] Fix | Delete
)
[4704] Fix | Delete
);
[4705] Fix | Delete
}
[4706] Fix | Delete
foreach ( $months as $month_year ) {
[4707] Fix | Delete
$month_year->text = sprintf(
[4708] Fix | Delete
/* translators: 1: Month, 2: Year. */
[4709] Fix | Delete
__( '%1$s %2$d' ),
[4710] Fix | Delete
$wp_locale->get_month( $month_year->month ),
[4711] Fix | Delete
$month_year->year
[4712] Fix | Delete
);
[4713] Fix | Delete
}
[4714] Fix | Delete
[4715] Fix | Delete
/**
[4716] Fix | Delete
* Filters whether the Media Library grid has infinite scrolling. Default `false`.
[4717] Fix | Delete
*
[4718] Fix | Delete
* @since 5.8.0
[4719] Fix | Delete
*
[4720] Fix | Delete
* @param bool $infinite Whether the Media Library grid has infinite scrolling.
[4721] Fix | Delete
*/
[4722] Fix | Delete
$infinite_scrolling = apply_filters( 'media_library_infinite_scrolling', false );
[4723] Fix | Delete
[4724] Fix | Delete
$settings = array(
[4725] Fix | Delete
'tabs' => $tabs,
[4726] Fix | Delete
'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url( 'media-upload.php' ) ),
[4727] Fix | Delete
'mimeTypes' => wp_list_pluck( get_post_mime_types(), 0 ),
[4728] Fix | Delete
/** This filter is documented in wp-admin/includes/media.php */
[4729] Fix | Delete
'captions' => ! apply_filters( 'disable_captions', '' ),
[4730] Fix | Delete
'nonce' => array(
[4731] Fix | Delete
'sendToEditor' => wp_create_nonce( 'media-send-to-editor' ),
[4732] Fix | Delete
'setAttachmentThumbnail' => wp_create_nonce( 'set-attachment-thumbnail' ),
[4733] Fix | Delete
),
[4734] Fix | Delete
'post' => array(
[4735] Fix | Delete
'id' => 0,
[4736] Fix | Delete
),
[4737] Fix | Delete
'defaultProps' => $props,
[4738] Fix | Delete
'attachmentCounts' => array(
[4739] Fix | Delete
'audio' => ( $show_audio_playlist ) ? 1 : 0,
[4740] Fix | Delete
'video' => ( $show_video_playlist ) ? 1 : 0,
[4741] Fix | Delete
),
[4742] Fix | Delete
'oEmbedProxyUrl' => rest_url( 'oembed/1.0/proxy' ),
[4743] Fix | Delete
'embedExts' => $exts,
[4744] Fix | Delete
'embedMimes' => $ext_mimes,
[4745] Fix | Delete
'contentWidth' => $content_width,
[4746] Fix | Delete
'months' => $months,
[4747] Fix | Delete
'mediaTrash' => MEDIA_TRASH ? 1 : 0,
[4748] Fix | Delete
'infiniteScrolling' => ( $infinite_scrolling ) ? 1 : 0,
[4749] Fix | Delete
);
[4750] Fix | Delete
[4751] Fix | Delete
$post = null;
[4752] Fix | Delete
if ( isset( $args['post'] ) ) {
[4753] Fix | Delete
$post = get_post( $args['post'] );
[4754] Fix | Delete
$settings['post'] = array(
[4755] Fix | Delete
'id' => $post->ID,
[4756] Fix | Delete
'nonce' => wp_create_nonce( 'update-post_' . $post->ID ),
[4757] Fix | Delete
);
[4758] Fix | Delete
[4759] Fix | Delete
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' );
[4760] Fix | Delete
if ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) {
[4761] Fix | Delete
if ( wp_attachment_is( 'audio', $post ) ) {
[4762] Fix | Delete
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
[4763] Fix | Delete
} elseif ( wp_attachment_is( 'video', $post ) ) {
[4764] Fix | Delete
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
[4765] Fix | Delete
}
[4766] Fix | Delete
}
[4767] Fix | Delete
[4768] Fix | Delete
if ( $thumbnail_support ) {
[4769] Fix | Delete
$featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true );
[4770] Fix | Delete
$settings['post']['featuredImageId'] = $featured_image_id ? $featured_image_id : -1;
[4771] Fix | Delete
}
[4772] Fix | Delete
}
[4773] Fix | Delete
[4774] Fix | Delete
if ( $post ) {
[4775] Fix | Delete
$post_type_object = get_post_type_object( $post->post_type );
[4776] Fix | Delete
} else {
[4777] Fix | Delete
$post_type_object = get_post_type_object( 'post' );
[4778] Fix | Delete
}
[4779] Fix | Delete
[4780] Fix | Delete
$strings = array(
[4781] Fix | Delete
// Generic.
[4782] Fix | Delete
'mediaFrameDefaultTitle' => __( 'Media' ),
[4783] Fix | Delete
'url' => __( 'URL' ),
[4784] Fix | Delete
'addMedia' => __( 'Add media' ),
[4785] Fix | Delete
'search' => __( 'Search' ),
[4786] Fix | Delete
'select' => __( 'Select' ),
[4787] Fix | Delete
'cancel' => __( 'Cancel' ),
[4788] Fix | Delete
'update' => __( 'Update' ),
[4789] Fix | Delete
'replace' => __( 'Replace' ),
[4790] Fix | Delete
'remove' => __( 'Remove' ),
[4791] Fix | Delete
'back' => __( 'Back' ),
[4792] Fix | Delete
/*
[4793] Fix | Delete
* translators: This is a would-be plural string used in the media manager.
[4794] Fix | Delete
* If there is not a word you can use in your language to avoid issues with the
[4795] Fix | Delete
* lack of plural support here, turn it into "selected: %d" then translate it.
[4796] Fix | Delete
*/
[4797] Fix | Delete
'selected' => __( '%d selected' ),
[4798] Fix | Delete
'dragInfo' => __( 'Drag and drop to reorder media files.' ),
[4799] Fix | Delete
[4800] Fix | Delete
// Upload.
[4801] Fix | Delete
'uploadFilesTitle' => __( 'Upload files' ),
[4802] Fix | Delete
'uploadImagesTitle' => __( 'Upload images' ),
[4803] Fix | Delete
[4804] Fix | Delete
// Library.
[4805] Fix | Delete
'mediaLibraryTitle' => __( 'Media Library' ),
[4806] Fix | Delete
'insertMediaTitle' => __( 'Add media' ),
[4807] Fix | Delete
'createNewGallery' => __( 'Create a new gallery' ),
[4808] Fix | Delete
'createNewPlaylist' => __( 'Create a new playlist' ),
[4809] Fix | Delete
'createNewVideoPlaylist' => __( 'Create a new video playlist' ),
[4810] Fix | Delete
'returnToLibrary' => __( '← Go to library' ),
[4811] Fix | Delete
'allMediaItems' => __( 'All media items' ),
[4812] Fix | Delete
'allDates' => __( 'All dates' ),
[4813] Fix | Delete
'noItemsFound' => __( 'No items found.' ),
[4814] Fix | Delete
'insertIntoPost' => $post_type_object->labels->insert_into_item,
[4815] Fix | Delete
'unattached' => _x( 'Unattached', 'media items' ),
[4816] Fix | Delete
'mine' => _x( 'Mine', 'media items' ),
[4817] Fix | Delete
'trash' => _x( 'Trash', 'noun' ),
[4818] Fix | Delete
'uploadedToThisPost' => $post_type_object->labels->uploaded_to_this_item,
[4819] Fix | Delete
'warnDelete' => __( "You are about to permanently delete this item from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
[4820] Fix | Delete
'warnBulkDelete' => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
[4821] Fix | Delete
'warnBulkTrash' => __( "You are about to trash these items.\n 'Cancel' to stop, 'OK' to delete." ),
[4822] Fix | Delete
'bulkSelect' => __( 'Bulk select' ),
[4823] Fix | Delete
'trashSelected' => __( 'Move to Trash' ),
[4824] Fix | Delete
'restoreSelected' => __( 'Restore from Trash' ),
[4825] Fix | Delete
'deletePermanently' => __( 'Delete permanently' ),
[4826] Fix | Delete
'errorDeleting' => __( 'Error in deleting the attachment.' ),
[4827] Fix | Delete
'apply' => __( 'Apply' ),
[4828] Fix | Delete
'filterByDate' => __( 'Filter by date' ),
[4829] Fix | Delete
'filterByType' => __( 'Filter by type' ),
[4830] Fix | Delete
'searchLabel' => __( 'Search media' ),
[4831] Fix | Delete
'searchMediaLabel' => __( 'Search media' ), // Backward compatibility pre-5.3.
[4832] Fix | Delete
'searchMediaPlaceholder' => __( 'Search media items...' ), // Placeholder (no ellipsis), backward compatibility pre-5.3.
[4833] Fix | Delete
/* translators: %d: Number of attachments found in a search. */
[4834] Fix | Delete
'mediaFound' => __( 'Number of media items found: %d' ),
[4835] Fix | Delete
'noMedia' => __( 'No media items found.' ),
[4836] Fix | Delete
'noMediaTryNewSearch' => __( 'No media items found. Try a different search.' ),
[4837] Fix | Delete
[4838] Fix | Delete
// Library Details.
[4839] Fix | Delete
'attachmentDetails' => __( 'Attachment details' ),
[4840] Fix | Delete
[4841] Fix | Delete
// From URL.
[4842] Fix | Delete
'insertFromUrlTitle' => __( 'Insert from URL' ),
[4843] Fix | Delete
[4844] Fix | Delete
// Featured Images.
[4845] Fix | Delete
'setFeaturedImageTitle' => $post_type_object->labels->featured_image,
[4846] Fix | Delete
'setFeaturedImage' => $post_type_object->labels->set_featured_image,
[4847] Fix | Delete
[4848] Fix | Delete
// Gallery.
[4849] Fix | Delete
'createGalleryTitle' => __( 'Create gallery' ),
[4850] Fix | Delete
'editGalleryTitle' => __( 'Edit gallery' ),
[4851] Fix | Delete
'cancelGalleryTitle' => __( '← Cancel gallery' ),
[4852] Fix | Delete
'insertGallery' => __( 'Insert gallery' ),
[4853] Fix | Delete
'updateGallery' => __( 'Update gallery' ),
[4854] Fix | Delete
'addToGallery' => __( 'Add to gallery' ),
[4855] Fix | Delete
'addToGalleryTitle' => __( 'Add to gallery' ),
[4856] Fix | Delete
'reverseOrder' => __( 'Reverse order' ),
[4857] Fix | Delete
[4858] Fix | Delete
// Edit Image.
[4859] Fix | Delete
'imageDetailsTitle' => __( 'Image details' ),
[4860] Fix | Delete
'imageReplaceTitle' => __( 'Replace image' ),
[4861] Fix | Delete
'imageDetailsCancel' => __( 'Cancel edit' ),
[4862] Fix | Delete
'editImage' => __( 'Edit image' ),
[4863] Fix | Delete
[4864] Fix | Delete
// Crop Image.
[4865] Fix | Delete
'chooseImage' => __( 'Choose image' ),
[4866] Fix | Delete
'selectAndCrop' => __( 'Select and crop' ),
[4867] Fix | Delete
'skipCropping' => __( 'Skip cropping' ),
[4868] Fix | Delete
'cropImage' => __( 'Crop image' ),
[4869] Fix | Delete
'cropYourImage' => __( 'Crop your image' ),
[4870] Fix | Delete
'cropping' => __( 'Cropping…' ),
[4871] Fix | Delete
/* translators: 1: Suggested width number, 2: Suggested height number. */
[4872] Fix | Delete
'suggestedDimensions' => __( 'Suggested image dimensions: %1$s by %2$s pixels.' ),
[4873] Fix | Delete
'cropError' => __( 'There has been an error cropping your image.' ),
[4874] Fix | Delete
[4875] Fix | Delete
// Edit Audio.
[4876] Fix | Delete
'audioDetailsTitle' => __( 'Audio details' ),
[4877] Fix | Delete
'audioReplaceTitle' => __( 'Replace audio' ),
[4878] Fix | Delete
'audioAddSourceTitle' => __( 'Add audio source' ),
[4879] Fix | Delete
'audioDetailsCancel' => __( 'Cancel edit' ),
[4880] Fix | Delete
[4881] Fix | Delete
// Edit Video.
[4882] Fix | Delete
'videoDetailsTitle' => __( 'Video details' ),
[4883] Fix | Delete
'videoReplaceTitle' => __( 'Replace video' ),
[4884] Fix | Delete
'videoAddSourceTitle' => __( 'Add video source' ),
[4885] Fix | Delete
'videoDetailsCancel' => __( 'Cancel edit' ),
[4886] Fix | Delete
'videoSelectPosterImageTitle' => __( 'Select poster image' ),
[4887] Fix | Delete
'videoAddTrackTitle' => __( 'Add subtitles' ),
[4888] Fix | Delete
[4889] Fix | Delete
// Playlist.
[4890] Fix | Delete
'playlistDragInfo' => __( 'Drag and drop to reorder tracks.' ),
[4891] Fix | Delete
'createPlaylistTitle' => __( 'Create audio playlist' ),
[4892] Fix | Delete
'editPlaylistTitle' => __( 'Edit audio playlist' ),
[4893] Fix | Delete
'cancelPlaylistTitle' => __( '← Cancel audio playlist' ),
[4894] Fix | Delete
'insertPlaylist' => __( 'Insert audio playlist' ),
[4895] Fix | Delete
'updatePlaylist' => __( 'Update audio playlist' ),
[4896] Fix | Delete
'addToPlaylist' => __( 'Add to audio playlist' ),
[4897] Fix | Delete
'addToPlaylistTitle' => __( 'Add to Audio Playlist' ),
[4898] Fix | Delete
[4899] Fix | Delete
// Video Playlist.
[4900] Fix | Delete
'videoPlaylistDragInfo' => __( 'Drag and drop to reorder videos.' ),
[4901] Fix | Delete
'createVideoPlaylistTitle' => __( 'Create video playlist' ),
[4902] Fix | Delete
'editVideoPlaylistTitle' => __( 'Edit video playlist' ),
[4903] Fix | Delete
'cancelVideoPlaylistTitle' => __( '← Cancel video playlist' ),
[4904] Fix | Delete
'insertVideoPlaylist' => __( 'Insert video playlist' ),
[4905] Fix | Delete
'updateVideoPlaylist' => __( 'Update video playlist' ),
[4906] Fix | Delete
'addToVideoPlaylist' => __( 'Add to video playlist' ),
[4907] Fix | Delete
'addToVideoPlaylistTitle' => __( 'Add to video Playlist' ),
[4908] Fix | Delete
[4909] Fix | Delete
// Headings.
[4910] Fix | Delete
'filterAttachments' => __( 'Filter media' ),
[4911] Fix | Delete
'attachmentsList' => __( 'Media list' ),
[4912] Fix | Delete
);
[4913] Fix | Delete
[4914] Fix | Delete
/**
[4915] Fix | Delete
* Filters the media view settings.
[4916] Fix | Delete
*
[4917] Fix | Delete
* @since 3.5.0
[4918] Fix | Delete
*
[4919] Fix | Delete
* @param array $settings List of media view settings.
[4920] Fix | Delete
* @param WP_Post $post Post object.
[4921] Fix | Delete
*/
[4922] Fix | Delete
$settings = apply_filters( 'media_view_settings', $settings, $post );
[4923] Fix | Delete
[4924] Fix | Delete
/**
[4925] Fix | Delete
* Filters the media view strings.
[4926] Fix | Delete
*
[4927] Fix | Delete
* @since 3.5.0
[4928] Fix | Delete
*
[4929] Fix | Delete
* @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
[4930] Fix | Delete
* @param WP_Post $post Post object.
[4931] Fix | Delete
*/
[4932] Fix | Delete
$strings = apply_filters( 'media_view_strings', $strings, $post );
[4933] Fix | Delete
[4934] Fix | Delete
$strings['settings'] = $settings;
[4935] Fix | Delete
[4936] Fix | Delete
/*
[4937] Fix | Delete
* Ensure we enqueue media-editor first, that way media-views
[4938] Fix | Delete
* is registered internally before we try to localize it. See #24724.
[4939] Fix | Delete
*/
[4940] Fix | Delete
wp_enqueue_script( 'media-editor' );
[4941] Fix | Delete
wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );
[4942] Fix | Delete
[4943] Fix | Delete
wp_enqueue_script( 'media-audiovideo' );
[4944] Fix | Delete
wp_enqueue_style( 'media-views' );
[4945] Fix | Delete
if ( is_admin() ) {
[4946] Fix | Delete
wp_enqueue_script( 'mce-view' );
[4947] Fix | Delete
wp_enqueue_script( 'image-edit' );
[4948] Fix | Delete
}
[4949] Fix | Delete
wp_enqueue_style( 'imgareaselect' );
[4950] Fix | Delete
wp_plupload_default_settings();
[4951] Fix | Delete
[4952] Fix | Delete
require_once ABSPATH . WPINC . '/media-template.php';
[4953] Fix | Delete
add_action( 'admin_footer', 'wp_print_media_templates' );
[4954] Fix | Delete
add_action( 'wp_footer', 'wp_print_media_templates' );
[4955] Fix | Delete
add_action( 'customize_controls_print_footer_scripts', 'wp_print_media_templates' );
[4956] Fix | Delete
[4957] Fix | Delete
/**
[4958] Fix | Delete
* Fires at the conclusion of wp_enqueue_media().
[4959] Fix | Delete
*
[4960] Fix | Delete
* @since 3.5.0
[4961] Fix | Delete
*/
[4962] Fix | Delete
do_action( 'wp_enqueue_media' );
[4963] Fix | Delete
}
[4964] Fix | Delete
[4965] Fix | Delete
/**
[4966] Fix | Delete
* Retrieves media attached to the passed post.
[4967] Fix | Delete
*
[4968] Fix | Delete
* @since 3.6.0
[4969] Fix | Delete
*
[4970] Fix | Delete
* @param string $type Mime type.
[4971] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
[4972] Fix | Delete
* @return WP_Post[] Array of media attached to the given post.
[4973] Fix | Delete
*/
[4974] Fix | Delete
function get_attached_media( $type, $post = 0 ) {
[4975] Fix | Delete
$post = get_post( $post );
[4976] Fix | Delete
[4977] Fix | Delete
if ( ! $post ) {
[4978] Fix | Delete
return array();
[4979] Fix | Delete
}
[4980] Fix | Delete
[4981] Fix | Delete
$args = array(
[4982] Fix | Delete
'post_parent' => $post->ID,
[4983] Fix | Delete
'post_type' => 'attachment',
[4984] Fix | Delete
'post_mime_type' => $type,
[4985] Fix | Delete
'posts_per_page' => -1,
[4986] Fix | Delete
'orderby' => 'menu_order',
[4987] Fix | Delete
'order' => 'ASC',
[4988] Fix | Delete
);
[4989] Fix | Delete
[4990] Fix | Delete
/**
[4991] Fix | Delete
* Filters arguments used to retrieve media attached to the given post.
[4992] Fix | Delete
*
[4993] Fix | Delete
* @since 3.6.0
[4994] Fix | Delete
*
[4995] Fix | Delete
* @param array $args Post query arguments.
[4996] Fix | Delete
* @param string $type Mime type of the desired media.
[4997] Fix | Delete
* @param WP_Post $post Post object.
[4998] Fix | Delete
*/
[4999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function