PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 2.4.8
Admin Columns v2.4.8
7.1.4 7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / column / media / actions.php
codepress-admin-columns / classes / column / media Last commit date
ID.php 10 years ago actions.php 10 years ago alternate-text.php 10 years ago attached-to.php 10 years ago available-sizes.php 10 years ago caption.php 10 years ago description.php 10 years ago dimensions.php 10 years ago exif-data.php 10 years ago file-name.php 10 years ago file-size.php 10 years ago full-path.php 10 years ago height.php 10 years ago mime-type.php 10 years ago width.php 10 years ago
actions.php
72 lines
1 <?php
2
3 /**
4 * CPAC_Column_Media_Actions
5 *
6 * @since 2.0
7 */
8 class CPAC_Column_Media_Actions extends CPAC_Column_Actions {
9
10 /**
11 * @see CPAC_Column_Actions::get_actions()
12 * @since 2.3.4
13 */
14 public function get_actions( $id ) {
15
16 global $wp_list_table;
17
18 $post = get_post( $id );
19 $att_title = _draft_or_post_title( $id );
20
21 $actions = array();
22
23 if ( $wp_list_table->detached ) {
24 if ( current_user_can( 'edit_post', $post->ID ) )
25 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
26 if ( current_user_can( 'delete_post', $post->ID ) )
27 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
28 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
29 } else {
30 $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
31 $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
32 }
33 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $att_title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
34 if ( current_user_can( 'edit_post', $post->ID ) )
35 $actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\''.$post->ID.'\' );return false;" class="hide-if-no-js">'.__( 'Attach' ).'</a>';
36 }
37 else {
38 if ( current_user_can( 'edit_post', $post->ID ) && !$wp_list_table->is_trash )
39 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
40 if ( current_user_can( 'delete_post', $post->ID ) ) {
41 if ( $wp_list_table->is_trash )
42 $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
43 elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
44 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
45 if ( $wp_list_table->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
46 $delete_ays = ( !$wp_list_table->is_trash && !MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
47 $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
48 }
49 }
50 if ( !$wp_list_table->is_trash ) {
51 $title =_draft_or_post_title( $post->post_parent );
52 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
53 }
54 }
55
56 /**
57 * Filter the action links for each attachment in the Media list table.
58 *
59 * @since 2.8.0
60 *
61 * @param array $actions An array of action links for each attachment.
62 * Default 'Edit', 'Delete Permanently', 'View'.
63 * @param WP_Post $post WP_Post object for the current attachment.
64 * @param bool $detached Whether the list table contains media not attached
65 * to any posts. Default true.
66 */
67 $actions = apply_filters( 'media_row_actions', $actions, $post, $wp_list_table->detached );
68
69 return $actions;
70 }
71 }
72