Changeset 12772
- Timestamp:
- 08/01/2023 10:11:00 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php
r12769 r12772 57 57 add_action( 'admin_notices', [ __CLASS__, 'add_notice_if_flagged_or_unflagged' ] ); 58 58 59 // Admin notice related to failed publication due to missing taxonomy values. 60 add_action( 'admin_notices', [ __CLASS__, 'add_notice_if_publish_failed_due_to_missing_taxonomies' ] ); 61 59 62 // Modify admin menu links for photo posts. 60 63 add_action( 'admin_menu', [ __CLASS__, 'modify_admin_menu_links' ] ); … … 70 73 71 74 /** 72 * Outputs admin notice s.75 * Outputs admin notice if submissions are currently disabled due to the killswitch. 73 76 */ 74 77 public static function add_notice_if_killswitch_enabled() { … … 88 91 89 92 /** 90 * Outputs admin notice s.93 * Outputs admin notice indicating if a photo post is flagged or has been unflagged. 91 94 */ 92 95 public static function add_notice_if_flagged_or_unflagged() { … … 145 148 ) 146 149 ); 150 } 151 152 /** 153 * Outputs admin notice if a photo post publication failed due to any custom 154 * taxonomy not having a value assigned. 155 */ 156 public static function add_notice_if_publish_failed_due_to_missing_taxonomies() { 157 global $post; 158 159 $meta_key = Posts::META_KEY_MISSING_TAXONOMIES; 160 161 if ( isset( $post->ID ) ) { 162 $missing_taxonomies = get_post_meta( $post->ID, $meta_key, true ); 163 164 if ( $missing_taxonomies ) { 165 echo '<div class="notice notice-error is-dismissible notice-missing-taxonomies"><p>'; 166 printf( 167 __( '<strong>Error:</strong> Photo was not published because the following taxonomies are missing terms: %s', 'wporg-photos' ), 168 '<strong>' . implode( '</strong>, <strong>', $missing_taxonomies ) . '</strong>' 169 ); 170 171 echo '</p></div>' . "\n"; 172 delete_post_meta( $post->ID, $meta_key ); 173 } 174 } 147 175 } 148 176
Note: See TracChangeset
for help on using the changeset viewer.