Changeset 2954735
- Timestamp:
- 08/17/2023 07:44:09 AM (2 years ago)
- Location:
- custom-post-types
- Files:
-
- 43 added
- 1 deleted
- 9 edited
-
tags/4.0.9 (added)
-
tags/4.0.9/assets (added)
-
tags/4.0.9/assets/css (added)
-
tags/4.0.9/assets/css/backend.css (added)
-
tags/4.0.9/assets/icon-256x256.png (added)
-
tags/4.0.9/assets/icon.svg (added)
-
tags/4.0.9/assets/js (added)
-
tags/4.0.9/assets/js/backend.js (added)
-
tags/4.0.9/custom-post-types.php (added)
-
tags/4.0.9/includes (added)
-
tags/4.0.9/includes/classes (added)
-
tags/4.0.9/includes/classes/AdminNotices.php (added)
-
tags/4.0.9/includes/classes/AdminPages.php (added)
-
tags/4.0.9/includes/classes/Api.php (added)
-
tags/4.0.9/includes/classes/Core.php (added)
-
tags/4.0.9/includes/classes/FieldGroups.php (added)
-
tags/4.0.9/includes/classes/PostTypes.php (added)
-
tags/4.0.9/includes/classes/Taxonomies.php (added)
-
tags/4.0.9/includes/classes/Utils.php (added)
-
tags/4.0.9/includes/fields (added)
-
tags/4.0.9/includes/fields/checkbox.php (added)
-
tags/4.0.9/includes/fields/color.php (added)
-
tags/4.0.9/includes/fields/date.php (added)
-
tags/4.0.9/includes/fields/email.php (added)
-
tags/4.0.9/includes/fields/file.php (added)
-
tags/4.0.9/includes/fields/html.php (added)
-
tags/4.0.9/includes/fields/number.php (added)
-
tags/4.0.9/includes/fields/post_rel.php (added)
-
tags/4.0.9/includes/fields/pro-only.php (added)
-
tags/4.0.9/includes/fields/radio.php (added)
-
tags/4.0.9/includes/fields/repeater.php (added)
-
tags/4.0.9/includes/fields/select.php (added)
-
tags/4.0.9/includes/fields/tax_rel.php (added)
-
tags/4.0.9/includes/fields/tel.php (added)
-
tags/4.0.9/includes/fields/text.php (added)
-
tags/4.0.9/includes/fields/textarea.php (added)
-
tags/4.0.9/includes/fields/time.php (added)
-
tags/4.0.9/includes/fields/tinymce.php (added)
-
tags/4.0.9/includes/views (added)
-
tags/4.0.9/includes/views/tools.php (added)
-
tags/4.0.9/languages (added)
-
tags/4.0.9/languages/custom-post-types.pot (added)
-
tags/4.0.9/readme.txt (added)
-
trunk/custom-post-types.php (modified) (2 diffs)
-
trunk/includes/classes/AdminPages.php (modified) (5 diffs)
-
trunk/includes/classes/Core.php (modified) (9 diffs)
-
trunk/includes/classes/FieldGroups.php (modified) (2 diffs)
-
trunk/includes/classes/PostTypes.php (modified) (3 diffs)
-
trunk/includes/classes/Taxonomies.php (modified) (2 diffs)
-
trunk/includes/classes/Utils.php (modified) (2 diffs)
-
trunk/languages/custom-post-types.mo (deleted)
-
trunk/languages/custom-post-types.pot (modified) (10 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-types/trunk/custom-post-types.php
r2948437 r2954735 8 8 Text Domain: custom-post-types 9 9 Domain Path: /languages/ 10 Version: 4.0. 810 Version: 4.0.9 11 11 */ 12 12 … … 45 45 } 46 46 47 $custom_post_types = new Core();47 Core::getInstance(); 48 48 49 49 do_action('custom_post_types_plugin_loaded'); -
custom-post-types/trunk/includes/classes/AdminPages.php
r2944690 r2954735 20 20 $pages = (array)apply_filters(Utils::getHookName('register_admin_pages'), $pagesByUi); 21 21 22 $pagesByCore = Utils::getUiAdminPagesArgs(); 23 24 $pages = array_merge($pagesByCore, $pages); 25 22 26 if (empty($pages)) return; 23 27 24 foreach ($pages as $ page) {28 foreach ($pages as $i => $page) { 25 29 $id = !empty($page['id']) && is_string($page['id']) ? $page['id'] : false; 26 30 $parent = !empty($page['parent']) && is_string($page['parent']) ? $page['parent'] : false; … … 31 35 $capability = !empty($page['admin_only']) ? 'administrator' : 'edit_posts'; 32 36 37 $errorInfo = Utils::getRegistrationErrorNoticeInfo($page, 'page'); 38 33 39 if (!$id || !$title) { 34 $errorInfo = Utils::getRegistrationErrorNoticeInfo($page, 'page');35 36 40 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 37 41 $args[] = [ … … 45 49 return $args; 46 50 }); 51 unset($pages[$i]); 52 continue; 53 } 54 55 if(in_array($id, Utils::getAdminPagesBlacklist())){ 56 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 57 $args[] = [ 58 'id' => $errorInfo['id'], 59 'title' => Utils::getNoticesTitle(), 60 'message' => __('Admin page reserved or already registered, try a different "id".', 'custom-post-types') . $errorInfo['details'], 61 'type' => 'error', 62 'dismissible' => 3, 63 'buttons' => false, 64 ]; 65 return $args; 66 }); 67 unset($pages[$i]); 47 68 continue; 48 69 } … … 59 80 60 81 if (!$registeredAdminPage) { 61 $errorInfo = Utils::getRegistrationErrorNoticeInfo($page, 'page');62 63 82 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 64 83 $args[] = [ … … 72 91 return $args; 73 92 }); 93 unset($pages[$i]); 74 94 } 75 95 } -
custom-post-types/trunk/includes/classes/Core.php
r2948437 r2954735 10 10 { 11 11 /** 12 * @var 13 */ 14 private static $instance; 15 16 /** 12 17 * @var PostTypes 13 18 */ … … 34 39 private $adminNotices; 35 40 36 p ublicfunction __construct()41 private function __construct() 37 42 { 38 43 // UI … … 53 58 54 59 /** 60 * @return Core 61 */ 62 public static function getInstance() 63 { 64 // Check is $_instance has been set 65 if(self::$instance instanceof Core) 66 { 67 // Returns the instance 68 return self::$instance; 69 } 70 // Creates sets object to instance 71 self::$instance = new Core(); 72 } 73 74 /** 55 75 * @return PostTypes 56 76 */ … … 122 142 private function registerUiPostTypes() 123 143 { 124 // Register ui post types 125 add_filter(Utils::getHookName('register_post_types'), function ($args) { 126 $default_args = [ 127 'public' => false, 128 'publicly_queryable' => false, 129 'show_ui' => true, 130 'show_in_menu' => true, 131 'show_in_rest' => false, 132 'query_var' => false, 133 'rewrite' => false, 134 'capabilities' => [ 135 'edit_post' => 'update_core', 136 'read_post' => 'update_core', 137 'delete_post' => 'update_core', 138 'edit_posts' => 'update_core', 139 'edit_others_posts' => 'update_core', 140 'delete_posts' => 'update_core', 141 'publish_posts' => 'update_core', 142 'read_private_posts' => 'update_core' 143 ], 144 'has_archive' => false, 145 'hierarchical' => false, 146 'menu_position' => null, 147 'supports' => [''], 148 'menu_icon' => 'dashicons-index-card', 149 'can_export' => false, 150 ]; 151 // Create/edit new post type 152 $args[] = [ 153 'id' => Utils::getInfo('ui_prefix'), 154 'singular' => __('Post type', 'custom-post-types'), 155 'plural' => __('Post types', 'custom-post-types'), 156 'labels' => [ 157 'name' => _x('Custom post types', 'Dashboard menu', 'custom-post-types'), 158 'singular_name' => __('Post type', 'custom-post-types'), 159 'menu_name' => __('Extend / Manage', 'custom-post-types'), 160 'name_admin_bar' => __('Post type', 'custom-post-types'), 161 'add_new' => __('Add post type', 'custom-post-types'), 162 'add_new_item' => __('Add new post type', 'custom-post-types'), 163 'new_item' => __('New post type', 'custom-post-types'), 164 'edit_item' => __('Edit post type', 'custom-post-types'), 165 'view_item' => __('View post type', 'custom-post-types'), 166 'item_updated' => __('Post type updated', 'custom-post-types'), 167 'all_items' => _x('Post types', 'Dashboard menu', 'custom-post-types'), 168 'search_items' => __('Search post type', 'custom-post-types'), 169 'not_found' => __('No post type available.', 'custom-post-types'), 170 'not_found_in_trash' => __('No post type in the trash.', 'custom-post-types') 171 ], 172 'args' => array_replace_recursive($default_args, [ 173 'description' => __('Create and manage custom post types.', 'custom-post-types'), 174 ]), 175 'columns' => [ 176 'title' => [ 177 'label' => __('Plural', 'custom-post-types'), 178 ], 179 'item_key' => [ 180 'label' => __('Key', 'custom-post-types'), 181 'callback' => function ($post_id) { 182 echo get_post_meta($post_id, 'id', true); 183 } 184 ], 185 'item_count' => [ 186 'label' => __('Count', 'custom-post-types'), 187 'callback' => function ($post_id) { 188 $key = get_post_meta($post_id, 'id', true); 189 if (empty($key) || !(isset(wp_count_posts($key)->publish) ? wp_count_posts($key)->publish : false)) { 190 echo "0"; 191 return; 192 } 193 printf( 194 '<a href="%s" title="%s">%s</a>', 195 admin_url('edit.php?post_type=' . $key), 196 __('View', 'custom-post-types'), 197 wp_count_posts($key)->publish 198 ); 199 } 200 ], 201 'date' => [], 202 ] 203 ]; 204 // Create/edit new tax 205 $args[] = [ 206 'id' => Utils::getInfo('ui_prefix') . '_tax', 207 'singular' => __('Taxonomy', 'custom-post-types'), 208 'plural' => __('Taxonomies', 'custom-post-types'), 209 'labels' => [ 210 'name' => __('Custom taxonomies', 'custom-post-types'), 211 'singular_name' => __('Taxonomy', 'custom-post-types'), 212 'menu_name' => __('Taxonomy', 'custom-post-types'), 213 'name_admin_bar' => __('Taxonomy', 'custom-post-types'), 214 'add_new' => __('Add taxonomy', 'custom-post-types'), 215 'add_new_item' => __('Add new taxonomy', 'custom-post-types'), 216 'new_item' => __('New taxonomy', 'custom-post-types'), 217 'edit_item' => __('Edit taxonomy', 'custom-post-types'), 218 'view_item' => __('View taxonomy', 'custom-post-types'), 219 'item_updated' => __('Taxonomy updated', 'custom-post-types'), 220 'all_items' => __('Taxonomies', 'custom-post-types'), 221 'search_items' => __('Search taxonomy', 'custom-post-types'), 222 'not_found' => __('No taxonomy available.', 'custom-post-types'), 223 'not_found_in_trash' => __('No taxonomy in the trash.', 'custom-post-types') 224 ], 225 'args' => array_replace_recursive($default_args, [ 226 'description' => __('Create and manage custom taxonomies.', 'custom-post-types'), 227 'show_in_menu' => 'edit.php?post_type=' . Utils::getInfo('ui_prefix') 228 ]), 229 'columns' => [ 230 'title' => [ 231 'label' => __('Plural', 'custom-post-types'), 232 ], 233 'item_key' => [ 234 'label' => __('Key', 'custom-post-types'), 235 'callback' => function ($post_id) { 236 echo get_post_meta($post_id, 'id', true); 237 } 238 ], 239 'item_count' => [ 240 'label' => __('Count', 'custom-post-types'), 241 'callback' => function ($post_id) { 242 $key = get_post_meta($post_id, 'id', true); 243 if (empty($key) || is_wp_error(wp_count_terms(['taxonomy' => $key]))) { 244 echo "0"; 245 return; 246 } 247 printf( 248 '<a href="%s" title="%s">%s</a>', 249 admin_url('edit-tags.php?taxonomy=' . $key), 250 __('View', 'custom-post-types'), 251 wp_count_terms(['taxonomy' => $key]) 252 ); 253 } 254 ], 255 'used_by' => [ 256 'label' => __('Assignment', 'custom-post-types'), 257 'callback' => function ($post_id) { 258 $supports = get_post_meta($post_id, 'supports', true); 259 if (empty($supports)) return; 260 $output = []; 261 foreach ($supports as $post_type) { 262 if (!get_post_type_object($post_type)) continue; 263 $output[] = sprintf( 264 '<a href="%s" title="%s">%s</a>', 265 admin_url('edit.php?post_type=' . $post_type), 266 __('View', 'custom-post-types'), 267 get_post_type_object($post_type)->labels->name 268 ); 269 } 270 echo implode(', ', $output); 271 } 272 ], 273 'date' => [], 274 ] 275 ]; 276 // Create/edit new fieldsgroup 277 $args[] = [ 278 'id' => Utils::getInfo('ui_prefix') . '_field', 279 'singular' => __('Field group', 'custom-post-types'), 280 'plural' => __('Field groups', 'custom-post-types'), 281 'labels' => [ 282 'name' => __('Custom field groups', 'custom-post-types'), 283 'singular_name' => __('Field group', 'custom-post-types'), 284 'menu_name' => __('Field group', 'custom-post-types'), 285 'name_admin_bar' => __('Field group', 'custom-post-types'), 286 'add_new' => __('Add field group', 'custom-post-types'), 287 'add_new_item' => __('Add new field group', 'custom-post-types'), 288 'new_item' => __('New field group', 'custom-post-types'), 289 'edit_item' => __('Edit field group', 'custom-post-types'), 290 'view_item' => __('View field group', 'custom-post-types'), 291 'item_updated' => __('Field group updated', 'custom-post-types'), 292 'all_items' => __('Field groups', 'custom-post-types'), 293 'search_items' => __('Search field group', 'custom-post-types'), 294 'not_found' => __('No field group available.', 'custom-post-types'), 295 'not_found_in_trash' => __('No field group in the trash.', 'custom-post-types') 296 ], 297 'args' => array_replace_recursive($default_args, [ 298 'description' => __('Create and manage custom field groups.', 'custom-post-types'), 299 'show_in_menu' => 'edit.php?post_type=' . Utils::getInfo('ui_prefix'), 300 'supports' => ['title'] 301 ]), 302 'columns' => [ 303 'title' => [ 304 'label' => __('Name', 'custom-post-types'), 305 ], 306 'item_count' => [ 307 'label' => __('Fields', 'custom-post-types') . ' (' . __('Key', 'custom-post-types') . ')', 308 'callback' => function ($post_id) { 309 $fields = get_post_meta($post_id, 'fields', true); 310 if (empty($fields)) return; 311 $fields_labels_array = array_map( 312 function ($field) { 313 return $field['label'] . ' (' . $field['key'] . ')'; 314 }, 315 $fields 316 ); 317 echo implode(', ', $fields_labels_array); 318 } 319 ], 320 'item_position' => [ 321 'label' => __('Position', 'custom-post-types'), 322 'callback' => function ($post_id) { 323 $available = [ 324 '' => __('NORMAL', 'custom-post-types'), 325 'normal' => __('NORMAL', 'custom-post-types'), 326 'side' => __('SIDEBAR', 'custom-post-types'), 327 'advanced' => __('ADVANCED', 'custom-post-types'), 328 ]; 329 echo $available[get_post_meta($post_id, 'position', true)]; 330 } 331 ], 332 'used_by' => [ 333 'label' => __('Assignment', 'custom-post-types'), 334 'callback' => function ($post_id) { 335 $supports = get_post_meta($post_id, 'supports', true); 336 if (empty($supports)) return; 337 $output = []; 338 foreach ($supports as $post_type) { 339 $content_type = 'cpt'; 340 $content = $post_type; 341 342 if (strpos($post_type, '/') !== false) { 343 $content_type = explode('/', $post_type)[0]; 344 $content = explode('/', $post_type)[1]; 345 } 346 347 switch ($content_type) { 348 case 'cpt': 349 if (get_post_type_object($content)) { 350 $output[] = sprintf( 351 '<a href="%s" title="%s">%s</a>', 352 admin_url('edit.php?post_type=' . $content), 353 __('View', 'custom-post-types'), 354 get_post_type_object($content)->labels->name 355 ); 356 } 357 break; 358 case 'tax': 359 if (get_taxonomy($content)) { 360 $output[] = sprintf( 361 '<a href="%s" title="%s">%s</a>', 362 admin_url('edit-tags.php?taxonomy=' . $content), 363 __('View', 'custom-post-types'), 364 get_taxonomy($content)->labels->name 365 ); 366 } 367 break; 368 case 'extra': 369 if ($content == 'users') { 370 $output[] = sprintf( 371 '<a href="%s" title="%s">%s</a>', 372 admin_url('users.php'), 373 __('View', 'custom-post-types'), 374 __('Users') 375 ); 376 } 377 break; 378 case 'options': 379 if (isset(Utils::getSettingsPagesOptions()[$content])) { 380 $pageUrl = !empty(Utils::getSettingsPagesOptions()[$content]['url']) ? admin_url(Utils::getSettingsPagesOptions()[$content]['url']) : menu_page_url($content, false); 381 $output[] = sprintf( 382 '<a href="%s" title="%s">%s</a>', 383 $pageUrl, 384 __('View', 'custom-post-types'), 385 Utils::getSettingsPagesOptions()[$content]['title'] 386 ); 387 } 388 break; 389 } 390 } 391 echo implode(', ', $output); 392 } 393 ], 394 'date' => [], 395 ] 396 ]; 397 return $args; 398 }); 144 // CustomPostTypes\includes\classes\Utils::getUiPostTypesArgs 399 145 400 146 // Remove quick edit links … … 490 236 private function registerUiPages() 491 237 { 238 // CustomPostTypes\includes\classes\Utils::getUiAdminPagesArgs 239 492 240 // Remove new post type menu 493 241 add_action('admin_menu', function () { … … 496 244 497 245 Utils::registerProPages(); 498 499 // Add settings page500 add_filter(Utils::getHookName('register_admin_pages'), function ($args) {501 ob_start();502 require_once(Utils::getInfo('path') . 'includes/views/tools.php');503 $template = ob_get_clean();504 505 $args[] = [506 'id' => 'tools',507 'parent' => 'edit.php?post_type=' . Utils::getInfo('ui_prefix'),508 'order' => null,509 'menu_icon' => null,510 'title' => __('Tools & Infos', 'custom-post-types'),511 'content' => $template,512 'admin_only' => true513 ];514 return $args;515 });516 246 } 517 247 … … 575 305 576 306 $installationTime = get_option(Utils::getOptionName('installation_time'), null); 307 577 308 if ($installationTime && strtotime("+7 day", $installationTime) < time()) { 578 309 // After 7 days notice … … 584 315 'dismissible' => true, 585 316 'buttons' => $buttons, 317 ]; 318 } 319 320 if ($installationTime && strtotime("+30 day", $installationTime) < time()) { 321 // After 30 days notice 322 $args[] = [ 323 'id' => 'welcome_notice_400_1', 324 'title' => Utils::getNoticesTitle(), 325 'message' => __('Wow! More than 30 days of using this amazing plugin. Your support is really important.', 'custom-post-types'), 326 'type' => 'success', 327 'dismissible' => true, 328 'buttons' => $buttons, 329 ]; 330 } 331 332 if ( 333 !Utils::isProVersionActive() && 334 $installationTime && strtotime("+3 day", $installationTime) < time() 335 ) { 336 $buttons2 = array_reverse($buttons); 337 unset($buttons2[2]); 338 $buttons2[0]['cta'] = true; 339 // PRO 340 $args[] = [ 341 'id' => 'welcome_notice_pro', 342 'title' => Utils::getNoticesTitle(), 343 'message' => '<p style="font-size: 1.3em;">' . __("It's time to PRO, <u>go to the next level</u>:", 'custom-post-types') . '</p><p style="font-size: 1.3em; font-weight: bold;">⚡ Custom templates<br>⚡ Custom admin pages<br>⚡ Custom admin notices<br>⚡ +6 fields types<br>⚡ Export/Import settings</p><p style="font-size: 1.3em;">' . __("now you are ready, one small step, one big change!", 'custom-post-types') . '</p>', 344 'type' => 'success', 345 'dismissible' => true, 346 'buttons' => $buttons2, 586 347 ]; 587 348 } … … 783 544 $this->getFieldGroups()->initRegisteredGroups(); 784 545 $this->getAdminPages()->initRegisteredPages(); 546 }); 547 add_action('admin_init', function () { 785 548 $this->getAdminNotices()->initRegisteredNotices(); 786 549 }); -
custom-post-types/trunk/includes/classes/FieldGroups.php
r2948437 r2954735 955 955 [ //id 956 956 'key' => 'id', 957 'label' => __(' Key', 'custom-post-types'),958 'info' => __('Taxonomy key.', 'custom-post-types'),957 'label' => __('ID', 'custom-post-types'), 958 'info' => __('Taxonomy ID.', 'custom-post-types'), 959 959 'required' => true, 960 960 'type' => 'text', … … 1282 1282 [ //id 1283 1283 'key' => 'id', 1284 'label' => __(' Key', 'custom-post-types'),1285 'info' => __('Post type key.', 'custom-post-types'),1284 'label' => __('ID', 'custom-post-types'), 1285 'info' => __('Post type ID.', 'custom-post-types'), 1286 1286 'required' => true, 1287 1287 'type' => 'text', -
custom-post-types/trunk/includes/classes/PostTypes.php
r2944690 r2954735 140 140 unset($registeredPostTypes); 141 141 142 return (array)apply_filters(Utils::getHookName('register_post_types'), $postTypesByUi); 142 $postTypesByCore = Utils::getUiPostTypesArgs(); 143 144 $postTypesByPlugin = (array)apply_filters(Utils::getHookName('register_post_types'), $postTypesByUi); 145 146 return array_merge($postTypesByCore, $postTypesByPlugin); 143 147 } 144 148 … … 225 229 $labels = !empty($postType['labels']) && is_array($postType['labels']) ? $postType['labels'] : []; 226 230 231 $errorInfo = Utils::getRegistrationErrorNoticeInfo($postType); 232 227 233 if (!$id || !$singular || !$plural) { 228 $errorInfo = Utils::getRegistrationErrorNoticeInfo($postType);229 230 234 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 231 235 $args[] = [ … … 243 247 } 244 248 249 if(in_array($id, Utils::getPostTypeBlacklist())){ 250 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 251 $args[] = [ 252 'id' => $errorInfo['id'], 253 'title' => Utils::getNoticesTitle(), 254 'message' => __('Post type reserved or already registered, try a different "id".', 'custom-post-types') . $errorInfo['details'], 255 'type' => 'error', 256 'dismissible' => 3, 257 'buttons' => false, 258 ]; 259 return $args; 260 }); 261 unset($postTypes[$i]); 262 continue; 263 } 264 245 265 $columns = !empty($postType['columns']) && is_array($postType['columns']) ? $postType['columns'] : false; 246 266 if ($columns) { -
custom-post-types/trunk/includes/classes/Taxonomies.php
r2944690 r2954735 181 181 $labels = !empty($taxonomy['labels']) && is_array($taxonomy['labels']) ? $taxonomy['labels'] : []; 182 182 183 $errorInfo = Utils::getRegistrationErrorNoticeInfo($taxonomy, 'tax'); 184 183 185 if (!$id || !$singular || !$plural) { 184 $errorInfo = Utils::getRegistrationErrorNoticeInfo($taxonomy, 'tax');185 186 186 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 187 187 $args[] = [ … … 199 199 } 200 200 201 if(in_array($id, Utils::getTaxonomiesBlacklist())){ 202 add_filter(Utils::getHookName('register_notices'), function ($args) use ($errorInfo) { 203 $args[] = [ 204 'id' => $errorInfo['id'], 205 'title' => Utils::getNoticesTitle(), 206 'message' => __('Taxonomy reserved or already registered, try a different "id".', 'custom-post-types') . $errorInfo['details'], 207 'type' => 'error', 208 'dismissible' => 3, 209 'buttons' => false, 210 ]; 211 return $args; 212 }); 213 unset($taxonomies[$i]); 214 continue; 215 } 216 201 217 $adminOnly = isset($args['admin_only']) ? $args['admin_only'] : false; 202 218 -
custom-post-types/trunk/includes/classes/Utils.php
r2948437 r2954735 65 65 { 66 66 $registered_post_types = get_post_types(['_builtin' => false], 'objects'); 67 $exclude = [ 68 self::getInfo('ui_prefix'), 69 self::getInfo('ui_prefix') . "_tax", 70 self::getInfo('ui_prefix') . "_field", 71 self::getInfo('ui_prefix') . "_template", 72 self::getInfo('ui_prefix') . "_page", 73 self::getInfo('ui_prefix') . "_notice" 74 ]; 67 $exclude = self::getUiPostTypes(); 75 68 $post_types = [ 76 69 'post' => __('Posts'), … … 500 493 ]; 501 494 } 495 496 /** 497 * @return array 498 */ 499 public static function getUiPostTypes(){ 500 return [ 501 self::getInfo('ui_prefix'), 502 self::getInfo('ui_prefix') . "_tax", 503 self::getInfo('ui_prefix') . "_field", 504 self::getInfo('ui_prefix') . "_template", 505 self::getInfo('ui_prefix') . "_page", 506 self::getInfo('ui_prefix') . "_notice" 507 ]; 508 } 509 510 /** 511 * @return string[] 512 */ 513 public static function getPostTypeBlacklist(){ 514 $registered = array_keys(get_post_types()); 515 return $registered; 516 } 517 518 /** 519 * @return array 520 */ 521 public static function getUiPostTypesArgs() { 522 $args = []; 523 524 $default_args = [ 525 'public' => false, 526 'publicly_queryable' => false, 527 'show_ui' => true, 528 'show_in_menu' => true, 529 'show_in_rest' => false, 530 'query_var' => false, 531 'rewrite' => false, 532 'capabilities' => [ 533 'edit_post' => 'update_core', 534 'read_post' => 'update_core', 535 'delete_post' => 'update_core', 536 'edit_posts' => 'update_core', 537 'edit_others_posts' => 'update_core', 538 'delete_posts' => 'update_core', 539 'publish_posts' => 'update_core', 540 'read_private_posts' => 'update_core' 541 ], 542 'has_archive' => false, 543 'hierarchical' => false, 544 'menu_position' => null, 545 'supports' => [''], 546 'menu_icon' => 'dashicons-index-card', 547 'can_export' => false, 548 ]; 549 // Create/edit new post type 550 $args[] = [ 551 'id' => self::getInfo('ui_prefix'), 552 'singular' => __('Post type', 'custom-post-types'), 553 'plural' => __('Post types', 'custom-post-types'), 554 'labels' => [ 555 'name' => _x('Custom post types', 'Dashboard menu', 'custom-post-types'), 556 'singular_name' => __('Post type', 'custom-post-types'), 557 'menu_name' => __('Extend / Manage', 'custom-post-types'), 558 'name_admin_bar' => __('Post type', 'custom-post-types'), 559 'add_new' => __('Add post type', 'custom-post-types'), 560 'add_new_item' => __('Add new post type', 'custom-post-types'), 561 'new_item' => __('New post type', 'custom-post-types'), 562 'edit_item' => __('Edit post type', 'custom-post-types'), 563 'view_item' => __('View post type', 'custom-post-types'), 564 'item_updated' => __('Post type updated', 'custom-post-types'), 565 'all_items' => _x('Post types', 'Dashboard menu', 'custom-post-types'), 566 'search_items' => __('Search post type', 'custom-post-types'), 567 'not_found' => __('No post type available.', 'custom-post-types'), 568 'not_found_in_trash' => __('No post type in the trash.', 'custom-post-types') 569 ], 570 'args' => array_replace_recursive($default_args, [ 571 'description' => __('Create and manage custom post types.', 'custom-post-types'), 572 ]), 573 'columns' => [ 574 'title' => [ 575 'label' => __('Plural', 'custom-post-types'), 576 ], 577 'item_key' => [ 578 'label' => __('ID', 'custom-post-types'), 579 'callback' => function ($post_id) { 580 echo get_post_meta($post_id, 'id', true); 581 } 582 ], 583 'item_count' => [ 584 'label' => __('Count', 'custom-post-types'), 585 'callback' => function ($post_id) { 586 $key = get_post_meta($post_id, 'id', true); 587 if (empty($key) || !(isset(wp_count_posts($key)->publish) ? wp_count_posts($key)->publish : false)) { 588 echo "0"; 589 return; 590 } 591 printf( 592 '<a href="%s" title="%s">%s</a>', 593 admin_url('edit.php?post_type=' . $key), 594 __('View', 'custom-post-types'), 595 wp_count_posts($key)->publish 596 ); 597 } 598 ], 599 'date' => [], 600 ] 601 ]; 602 // Create/edit new tax 603 $args[] = [ 604 'id' => self::getInfo('ui_prefix') . '_tax', 605 'singular' => __('Taxonomy', 'custom-post-types'), 606 'plural' => __('Taxonomies', 'custom-post-types'), 607 'labels' => [ 608 'name' => __('Custom taxonomies', 'custom-post-types'), 609 'singular_name' => __('Taxonomy', 'custom-post-types'), 610 'menu_name' => __('Taxonomy', 'custom-post-types'), 611 'name_admin_bar' => __('Taxonomy', 'custom-post-types'), 612 'add_new' => __('Add taxonomy', 'custom-post-types'), 613 'add_new_item' => __('Add new taxonomy', 'custom-post-types'), 614 'new_item' => __('New taxonomy', 'custom-post-types'), 615 'edit_item' => __('Edit taxonomy', 'custom-post-types'), 616 'view_item' => __('View taxonomy', 'custom-post-types'), 617 'item_updated' => __('Taxonomy updated', 'custom-post-types'), 618 'all_items' => __('Taxonomies', 'custom-post-types'), 619 'search_items' => __('Search taxonomy', 'custom-post-types'), 620 'not_found' => __('No taxonomy available.', 'custom-post-types'), 621 'not_found_in_trash' => __('No taxonomy in the trash.', 'custom-post-types') 622 ], 623 'args' => array_replace_recursive($default_args, [ 624 'description' => __('Create and manage custom taxonomies.', 'custom-post-types'), 625 'show_in_menu' => 'edit.php?post_type=' . self::getInfo('ui_prefix') 626 ]), 627 'columns' => [ 628 'title' => [ 629 'label' => __('Plural', 'custom-post-types'), 630 ], 631 'item_key' => [ 632 'label' => __('ID', 'custom-post-types'), 633 'callback' => function ($post_id) { 634 echo get_post_meta($post_id, 'id', true); 635 } 636 ], 637 'item_count' => [ 638 'label' => __('Count', 'custom-post-types'), 639 'callback' => function ($post_id) { 640 $key = get_post_meta($post_id, 'id', true); 641 if (empty($key) || is_wp_error(wp_count_terms(['taxonomy' => $key]))) { 642 echo "0"; 643 return; 644 } 645 printf( 646 '<a href="%s" title="%s">%s</a>', 647 admin_url('edit-tags.php?taxonomy=' . $key), 648 __('View', 'custom-post-types'), 649 wp_count_terms(['taxonomy' => $key]) 650 ); 651 } 652 ], 653 'used_by' => [ 654 'label' => __('Assignment', 'custom-post-types'), 655 'callback' => function ($post_id) { 656 $supports = get_post_meta($post_id, 'supports', true); 657 if (empty($supports)) return; 658 $output = []; 659 foreach ($supports as $post_type) { 660 if (!get_post_type_object($post_type)) continue; 661 $output[] = sprintf( 662 '<a href="%s" title="%s">%s</a>', 663 admin_url('edit.php?post_type=' . $post_type), 664 __('View', 'custom-post-types'), 665 get_post_type_object($post_type)->labels->name 666 ); 667 } 668 echo implode(', ', $output); 669 } 670 ], 671 'date' => [], 672 ] 673 ]; 674 // Create/edit new fieldsgroup 675 $args[] = [ 676 'id' => self::getInfo('ui_prefix') . '_field', 677 'singular' => __('Field group', 'custom-post-types'), 678 'plural' => __('Field groups', 'custom-post-types'), 679 'labels' => [ 680 'name' => __('Custom field groups', 'custom-post-types'), 681 'singular_name' => __('Field group', 'custom-post-types'), 682 'menu_name' => __('Field group', 'custom-post-types'), 683 'name_admin_bar' => __('Field group', 'custom-post-types'), 684 'add_new' => __('Add field group', 'custom-post-types'), 685 'add_new_item' => __('Add new field group', 'custom-post-types'), 686 'new_item' => __('New field group', 'custom-post-types'), 687 'edit_item' => __('Edit field group', 'custom-post-types'), 688 'view_item' => __('View field group', 'custom-post-types'), 689 'item_updated' => __('Field group updated', 'custom-post-types'), 690 'all_items' => __('Field groups', 'custom-post-types'), 691 'search_items' => __('Search field group', 'custom-post-types'), 692 'not_found' => __('No field group available.', 'custom-post-types'), 693 'not_found_in_trash' => __('No field group in the trash.', 'custom-post-types') 694 ], 695 'args' => array_replace_recursive($default_args, [ 696 'description' => __('Create and manage custom field groups.', 'custom-post-types'), 697 'show_in_menu' => 'edit.php?post_type=' . self::getInfo('ui_prefix'), 698 'supports' => ['title'] 699 ]), 700 'columns' => [ 701 'title' => [ 702 'label' => __('Name', 'custom-post-types'), 703 ], 704 'item_count' => [ 705 'label' => __('Fields', 'custom-post-types') . ' (' . __('Key', 'custom-post-types') . ')', 706 'callback' => function ($post_id) { 707 $fields = get_post_meta($post_id, 'fields', true); 708 if (empty($fields)) return; 709 $fields_labels_array = array_map( 710 function ($field) { 711 return $field['label'] . ' (' . $field['key'] . ')'; 712 }, 713 $fields 714 ); 715 echo implode(', ', $fields_labels_array); 716 } 717 ], 718 'item_position' => [ 719 'label' => __('Position', 'custom-post-types'), 720 'callback' => function ($post_id) { 721 $available = [ 722 '' => __('NORMAL', 'custom-post-types'), 723 'normal' => __('NORMAL', 'custom-post-types'), 724 'side' => __('SIDEBAR', 'custom-post-types'), 725 'advanced' => __('ADVANCED', 'custom-post-types'), 726 ]; 727 echo $available[get_post_meta($post_id, 'position', true)]; 728 } 729 ], 730 'used_by' => [ 731 'label' => __('Assignment', 'custom-post-types'), 732 'callback' => function ($post_id) { 733 $supports = get_post_meta($post_id, 'supports', true); 734 if (empty($supports)) return; 735 $output = []; 736 foreach ($supports as $post_type) { 737 $content_type = 'cpt'; 738 $content = $post_type; 739 740 if (strpos($post_type, '/') !== false) { 741 $content_type = explode('/', $post_type)[0]; 742 $content = explode('/', $post_type)[1]; 743 } 744 745 switch ($content_type) { 746 case 'cpt': 747 if (get_post_type_object($content)) { 748 $output[] = sprintf( 749 '<a href="%s" title="%s">%s</a>', 750 admin_url('edit.php?post_type=' . $content), 751 __('View', 'custom-post-types'), 752 get_post_type_object($content)->labels->name 753 ); 754 } 755 break; 756 case 'tax': 757 if (get_taxonomy($content)) { 758 $output[] = sprintf( 759 '<a href="%s" title="%s">%s</a>', 760 admin_url('edit-tags.php?taxonomy=' . $content), 761 __('View', 'custom-post-types'), 762 get_taxonomy($content)->labels->name 763 ); 764 } 765 break; 766 case 'extra': 767 if ($content == 'users') { 768 $output[] = sprintf( 769 '<a href="%s" title="%s">%s</a>', 770 admin_url('users.php'), 771 __('View', 'custom-post-types'), 772 __('Users') 773 ); 774 } 775 break; 776 case 'options': 777 if (isset(self::getSettingsPagesOptions()[$content])) { 778 $pageUrl = !empty(self::getSettingsPagesOptions()[$content]['url']) ? admin_url(self::getSettingsPagesOptions()[$content]['url']) : menu_page_url($content, false); 779 $output[] = sprintf( 780 '<a href="%s" title="%s">%s</a>', 781 $pageUrl, 782 __('View', 'custom-post-types'), 783 self::getSettingsPagesOptions()[$content]['title'] 784 ); 785 } 786 break; 787 } 788 } 789 echo implode(', ', $output); 790 } 791 ], 792 'date' => [], 793 ] 794 ]; 795 return $args; 796 } 797 798 /** 799 * @return array 800 */ 801 public static function getUiAdminPagesArgs() { 802 $args = []; 803 804 ob_start(); 805 require_once(self::getInfo('path') . 'includes/views/tools.php'); 806 $template = ob_get_clean(); 807 808 $args[] = [ 809 'id' => 'tools', 810 'parent' => 'edit.php?post_type=' . self::getInfo('ui_prefix'), 811 'order' => null, 812 'menu_icon' => null, 813 'title' => __('Tools & Infos', 'custom-post-types'), 814 'content' => $template, 815 'admin_only' => true 816 ]; 817 return $args; 818 } 819 820 /** 821 * @return string[] 822 */ 823 public static function getTaxonomiesBlacklist(){ 824 $registered = array_keys(get_taxonomies()); 825 return $registered; 826 } 827 828 /** 829 * @return string[] 830 */ 831 public static function getAdminPagesBlacklist(){ 832 global $menu, $submenu; 833 $registered = [ 834 'custom-post-types', 835 'custom-post-types-pro', 836 ]; 837 foreach ($menu as $registeredMenu) { 838 if( 839 empty($registeredMenu[2]) || // error 840 strpos($registeredMenu[2], '.php') !== false || // core page 841 (!empty($registeredMenu[4]) && $registeredMenu[4] == 'wp-menu-separator') // menu separator 842 ){ 843 continue; 844 } 845 $registered[] = $registeredMenu[2]; 846 } 847 foreach ($submenu as $registeredSubmenu) { 848 foreach ($registeredSubmenu as $singleMenu) { 849 if( 850 empty($singleMenu[2]) || // error 851 strpos($singleMenu[2], '.php') !== false // core page 852 ){ 853 continue; 854 } 855 $registered[] = $singleMenu[2]; 856 } 857 } 858 return $registered; 859 } 502 860 } -
custom-post-types/trunk/languages/custom-post-types.pot
r2948437 r2954735 3 3 msgstr "" 4 4 "Project-Id-Version: Custom post types\n" 5 "POT-Creation-Date: 2023-08- 07 10:22+0200\n"5 "POT-Creation-Date: 2023-08-16 17:00+0200\n" 6 6 "PO-Revision-Date: 2023-08-07 10:20+0200\n" 7 7 "Last-Translator: \n" … … 34 34 msgstr "" 35 35 36 #: includes/classes/AdminPages.php:4 036 #: includes/classes/AdminPages.php:44 37 37 msgid "Admin page registration was not successful (\"id\" and \"title\" args are required)." 38 38 msgstr "" 39 39 40 #: includes/classes/AdminPages.php:67 40 #: includes/classes/AdminPages.php:60 41 msgid "Admin page reserved or already registered, try a different \"id\"." 42 msgstr "" 43 44 #: includes/classes/AdminPages.php:86 41 45 msgid "Admin page registration was not successful." 42 46 msgstr "" 43 47 44 #: includes/classes/Core.php:154 includes/classes/Core.php:158 45 #: includes/classes/Core.php:160 includes/fields/post_rel.php:73 46 msgid "Post type" 47 msgstr "" 48 49 #: includes/classes/Core.php:155 includes/classes/Utils.php:179 50 msgid "Post types" 51 msgstr "" 52 53 #: includes/classes/Core.php:159 54 msgid "Extend / Manage" 48 #: includes/classes/Core.php:158 includes/classes/Core.php:159 49 #: includes/classes/Utils.php:564 50 msgid "Post type updated" 51 msgstr "" 52 53 #: includes/classes/Core.php:160 54 msgid "Post type published" 55 55 msgstr "" 56 56 57 57 #: includes/classes/Core.php:161 58 msgid " Add post type"58 msgid "Post type saved" 59 59 msgstr "" 60 60 61 61 #: includes/classes/Core.php:162 62 msgid " Add new post type"62 msgid "Post type submitted" 63 63 msgstr "" 64 64 65 65 #: includes/classes/Core.php:163 66 msgid " New post type"66 msgid "Post type scheduled" 67 67 msgstr "" 68 68 69 69 #: includes/classes/Core.php:164 70 msgid "Edit post type" 71 msgstr "" 72 73 #: includes/classes/Core.php:165 74 msgid "View post type" 75 msgstr "" 76 77 #: includes/classes/Core.php:166 includes/classes/Core.php:412 78 #: includes/classes/Core.php:413 79 msgid "Post type updated" 80 msgstr "" 81 82 #: includes/classes/Core.php:168 83 msgid "Search post type" 70 msgid "Post type draft updated" 71 msgstr "" 72 73 #: includes/classes/Core.php:167 includes/classes/Core.php:168 74 #: includes/classes/Utils.php:617 75 msgid "Taxonomy updated" 84 76 msgstr "" 85 77 86 78 #: includes/classes/Core.php:169 87 msgid " No post type available."79 msgid "Taxonomy published" 88 80 msgstr "" 89 81 90 82 #: includes/classes/Core.php:170 91 msgid "No post type in the trash." 83 msgid "Taxonomy saved" 84 msgstr "" 85 86 #: includes/classes/Core.php:171 87 msgid "Taxonomy submitted" 88 msgstr "" 89 90 #: includes/classes/Core.php:172 91 msgid "Taxonomy scheduled" 92 92 msgstr "" 93 93 94 94 #: includes/classes/Core.php:173 95 msgid "Create and manage custom post types." 96 msgstr "" 97 98 #: includes/classes/Core.php:177 includes/classes/Core.php:231 99 #: includes/classes/FieldGroups.php:941 includes/classes/FieldGroups.php:1268 100 msgid "Plural" 101 msgstr "" 102 103 #: includes/classes/Core.php:180 includes/classes/Core.php:234 104 #: includes/classes/Core.php:307 includes/classes/FieldGroups.php:646 105 #: includes/classes/FieldGroups.php:957 includes/classes/FieldGroups.php:1284 106 msgid "Key" 107 msgstr "" 108 109 #: includes/classes/Core.php:186 includes/classes/Core.php:240 110 msgid "Count" 111 msgstr "" 112 113 #: includes/classes/Core.php:196 includes/classes/Core.php:250 114 #: includes/classes/Core.php:266 includes/classes/Core.php:353 115 #: includes/classes/Core.php:363 includes/classes/Core.php:373 116 #: includes/classes/Core.php:384 117 msgid "View" 118 msgstr "" 119 120 #: includes/classes/Core.php:207 includes/classes/Core.php:211 121 #: includes/classes/Core.php:212 includes/classes/Core.php:213 122 #: includes/fields/tax_rel.php:73 123 msgid "Taxonomy" 124 msgstr "" 125 126 #: includes/classes/Core.php:208 includes/classes/Core.php:220 127 #: includes/classes/Utils.php:185 128 msgid "Taxonomies" 129 msgstr "" 130 131 #: includes/classes/Core.php:210 132 msgid "Custom taxonomies" 133 msgstr "" 134 135 #: includes/classes/Core.php:214 136 msgid "Add taxonomy" 137 msgstr "" 138 139 #: includes/classes/Core.php:215 140 msgid "Add new taxonomy" 141 msgstr "" 142 143 #: includes/classes/Core.php:216 144 msgid "New taxonomy" 145 msgstr "" 146 147 #: includes/classes/Core.php:217 148 msgid "Edit taxonomy" 149 msgstr "" 150 151 #: includes/classes/Core.php:218 152 msgid "View taxonomy" 153 msgstr "" 154 155 #: includes/classes/Core.php:219 includes/classes/Core.php:421 156 #: includes/classes/Core.php:422 157 msgid "Taxonomy updated" 158 msgstr "" 159 160 #: includes/classes/Core.php:221 161 msgid "Search taxonomy" 162 msgstr "" 163 164 #: includes/classes/Core.php:222 165 msgid "No taxonomy available." 166 msgstr "" 167 168 #: includes/classes/Core.php:223 169 msgid "No taxonomy in the trash." 170 msgstr "" 171 172 #: includes/classes/Core.php:226 173 msgid "Create and manage custom taxonomies." 174 msgstr "" 175 176 #: includes/classes/Core.php:256 includes/classes/Core.php:333 177 #: includes/classes/FieldGroups.php:844 includes/classes/FieldGroups.php:989 178 msgid "Assignment" 179 msgstr "" 180 181 #: includes/classes/Core.php:279 includes/classes/Core.php:283 182 #: includes/classes/Core.php:284 includes/classes/Core.php:285 183 msgid "Field group" 184 msgstr "" 185 186 #: includes/classes/Core.php:280 includes/classes/Core.php:292 187 msgid "Field groups" 188 msgstr "" 189 190 #: includes/classes/Core.php:282 191 msgid "Custom field groups" 192 msgstr "" 193 194 #: includes/classes/Core.php:286 195 msgid "Add field group" 196 msgstr "" 197 198 #: includes/classes/Core.php:287 199 msgid "Add new field group" 200 msgstr "" 201 202 #: includes/classes/Core.php:288 203 msgid "New field group" 204 msgstr "" 205 206 #: includes/classes/Core.php:289 207 msgid "Edit field group" 208 msgstr "" 209 210 #: includes/classes/Core.php:290 211 msgid "View field group" 212 msgstr "" 213 214 #: includes/classes/Core.php:291 includes/classes/Core.php:430 215 #: includes/classes/Core.php:431 95 msgid "Taxonomy draft updated" 96 msgstr "" 97 98 #: includes/classes/Core.php:176 includes/classes/Core.php:177 99 #: includes/classes/Utils.php:689 216 100 msgid "Field group updated" 217 101 msgstr "" 218 102 219 #: includes/classes/Core.php:293 220 msgid "Search field group" 221 msgstr "" 222 223 #: includes/classes/Core.php:294 224 msgid "No field group available." 225 msgstr "" 226 227 #: includes/classes/Core.php:295 228 msgid "No field group in the trash." 229 msgstr "" 230 231 #: includes/classes/Core.php:298 232 msgid "Create and manage custom field groups." 233 msgstr "" 234 235 #: includes/classes/Core.php:304 236 msgid "Name" 237 msgstr "" 238 239 #: includes/classes/Core.php:307 240 msgid "Fields" 241 msgstr "" 242 243 #: includes/classes/Core.php:321 includes/classes/FieldGroups.php:806 244 msgid "Position" 245 msgstr "" 246 247 #: includes/classes/Core.php:324 includes/classes/Core.php:325 248 #: includes/classes/FieldGroups.php:811 includes/classes/FieldGroups.php:814 249 msgid "NORMAL" 250 msgstr "" 251 252 #: includes/classes/Core.php:326 includes/classes/FieldGroups.php:815 253 msgid "SIDEBAR" 254 msgstr "" 255 256 #: includes/classes/Core.php:327 includes/classes/FieldGroups.php:816 257 msgid "ADVANCED" 258 msgstr "" 259 260 #: includes/classes/Core.php:374 includes/classes/Utils.php:196 261 msgid "Users" 262 msgstr "" 263 264 #: includes/classes/Core.php:414 265 msgid "Post type published" 266 msgstr "" 267 268 #: includes/classes/Core.php:415 269 msgid "Post type saved" 270 msgstr "" 271 272 #: includes/classes/Core.php:416 273 msgid "Post type submitted" 274 msgstr "" 275 276 #: includes/classes/Core.php:417 277 msgid "Post type scheduled" 278 msgstr "" 279 280 #: includes/classes/Core.php:418 281 msgid "Post type draft updated" 282 msgstr "" 283 284 #: includes/classes/Core.php:423 285 msgid "Taxonomy published" 286 msgstr "" 287 288 #: includes/classes/Core.php:424 289 msgid "Taxonomy saved" 290 msgstr "" 291 292 #: includes/classes/Core.php:425 293 msgid "Taxonomy submitted" 294 msgstr "" 295 296 #: includes/classes/Core.php:426 297 msgid "Taxonomy scheduled" 298 msgstr "" 299 300 #: includes/classes/Core.php:427 301 msgid "Taxonomy draft updated" 302 msgstr "" 303 304 #: includes/classes/Core.php:432 103 #: includes/classes/Core.php:178 305 104 msgid "Field group published" 306 105 msgstr "" 307 106 308 #: includes/classes/Core.php: 433107 #: includes/classes/Core.php:179 309 108 msgid "Field group saved" 310 109 msgstr "" 311 110 312 #: includes/classes/Core.php: 434111 #: includes/classes/Core.php:180 313 112 msgid "Field group submitted" 314 113 msgstr "" 315 114 316 #: includes/classes/Core.php: 435115 #: includes/classes/Core.php:181 317 116 msgid "Field group scheduled" 318 117 msgstr "" 319 118 320 #: includes/classes/Core.php: 436119 #: includes/classes/Core.php:182 321 120 msgid "Field group draft updated" 322 121 msgstr "" 323 122 324 #: includes/classes/Core.php: 439 includes/classes/Core.php:440123 #: includes/classes/Core.php:185 includes/classes/Core.php:186 325 124 msgid "Template updated" 326 125 msgstr "" 327 126 328 #: includes/classes/Core.php: 441127 #: includes/classes/Core.php:187 329 128 msgid "Template published" 330 129 msgstr "" 331 130 332 #: includes/classes/Core.php: 442131 #: includes/classes/Core.php:188 333 132 msgid "Template saved" 334 133 msgstr "" 335 134 336 #: includes/classes/Core.php: 443135 #: includes/classes/Core.php:189 337 136 msgid "Template submitted" 338 137 msgstr "" 339 138 340 #: includes/classes/Core.php: 444139 #: includes/classes/Core.php:190 341 140 msgid "Template scheduled" 342 141 msgstr "" 343 142 344 #: includes/classes/Core.php: 445143 #: includes/classes/Core.php:191 345 144 msgid "Template draft updated" 346 145 msgstr "" 347 146 348 #: includes/classes/Core.php: 448 includes/classes/Core.php:449147 #: includes/classes/Core.php:194 includes/classes/Core.php:195 349 148 msgid "Admin page updated" 350 149 msgstr "" 351 150 352 #: includes/classes/Core.php: 450151 #: includes/classes/Core.php:196 353 152 msgid "Admin page published" 354 153 msgstr "" 355 154 356 #: includes/classes/Core.php: 451155 #: includes/classes/Core.php:197 357 156 msgid "Admin page saved" 358 157 msgstr "" 359 158 360 #: includes/classes/Core.php: 452159 #: includes/classes/Core.php:198 361 160 msgid "Admin page submitted" 362 161 msgstr "" 363 162 364 #: includes/classes/Core.php: 453163 #: includes/classes/Core.php:199 365 164 msgid "Admin page scheduled" 366 165 msgstr "" 367 166 368 #: includes/classes/Core.php: 454167 #: includes/classes/Core.php:200 369 168 msgid "Admin page draft updated" 370 169 msgstr "" 371 170 372 #: includes/classes/Core.php:510 373 msgid "Tools & Infos" 374 msgstr "" 375 376 #: includes/classes/Core.php:542 includes/views/tools.php:88 171 #: includes/classes/Core.php:272 includes/views/tools.php:88 377 172 msgid "Write a Review" 378 173 msgstr "" 379 174 380 #: includes/classes/Core.php: 548 includes/views/tools.php:83175 #: includes/classes/Core.php:278 includes/views/tools.php:83 381 176 msgid "Make a Donation" 382 177 msgstr "" 383 178 384 #: includes/classes/Core.php: 555 includes/classes/Utils.php:405179 #: includes/classes/Core.php:285 includes/classes/Utils.php:398 385 180 #: includes/views/tools.php:77 386 181 msgid "Get PRO version" 387 182 msgstr "" 388 183 389 #: includes/classes/Core.php: 564184 #: includes/classes/Core.php:294 390 185 msgid "Thanks for using this plugin! Do you want to help us grow to add new features?" 391 186 msgstr "" 392 187 393 #: includes/classes/Core.php: 564188 #: includes/classes/Core.php:294 394 189 #, php-format 395 190 msgid "The new version %s introduces a lot of new features and improves the core of the plugin.<br>For any problems you can download the previous version %s from the official page of the plugin from WordPress.org (Advanced View > Previous version)." 396 191 msgstr "" 397 192 398 #: includes/classes/Core.php: 582193 #: includes/classes/Core.php:312 399 194 msgid "Wow! More than 7 days of using this amazing plugin. Your support is really important." 400 195 msgstr "" 401 196 402 #: includes/classes/Core.php: 621197 #: includes/classes/Core.php:351 403 198 msgid "Support" 404 199 msgstr "" 405 200 406 #: includes/classes/Core.php: 627201 #: includes/classes/Core.php:357 407 202 msgid "Get PRO" 408 203 msgstr "" 409 204 410 #: includes/classes/Core.php: 651 includes/classes/Core.php:665411 #: includes/classes/Core.php: 685 includes/classes/Core.php:702205 #: includes/classes/Core.php:381 includes/classes/Core.php:395 206 #: includes/classes/Core.php:415 includes/classes/Core.php:432 412 207 msgid "Missing field \"key\"." 413 208 msgstr "" 414 209 415 #: includes/classes/Core.php: 688210 #: includes/classes/Core.php:418 416 211 msgid "Missing field \"term-id\"." 417 212 msgstr "" 418 213 419 #: includes/classes/Core.php: 705214 #: includes/classes/Core.php:435 420 215 msgid "Missing field \"option-id\"." 421 216 msgstr "" … … 443 238 #: includes/classes/FieldGroups.php:632 444 239 msgid "Label" 240 msgstr "" 241 242 #: includes/classes/FieldGroups.php:646 includes/classes/Utils.php:705 243 msgid "Key" 445 244 msgstr "" 446 245 … … 541 340 msgstr "" 542 341 342 #: includes/classes/FieldGroups.php:806 includes/classes/Utils.php:719 343 msgid "Position" 344 msgstr "" 345 543 346 #: includes/classes/FieldGroups.php:807 544 347 msgid "If set to \"NORMAL\" it will be shown at the bottom of the central column, if \"SIDEBAR\" it will be shown in the sidebar." 545 348 msgstr "" 546 349 350 #: includes/classes/FieldGroups.php:811 includes/classes/FieldGroups.php:814 351 #: includes/classes/Utils.php:722 includes/classes/Utils.php:723 352 msgid "NORMAL" 353 msgstr "" 354 355 #: includes/classes/FieldGroups.php:815 includes/classes/Utils.php:724 356 msgid "SIDEBAR" 357 msgstr "" 358 359 #: includes/classes/FieldGroups.php:816 includes/classes/Utils.php:725 360 msgid "ADVANCED" 361 msgstr "" 362 547 363 #: includes/classes/FieldGroups.php:828 548 364 msgid "Order" … … 555 371 #: includes/classes/FieldGroups.php:833 556 372 msgid "ex: 10" 373 msgstr "" 374 375 #: includes/classes/FieldGroups.php:844 includes/classes/FieldGroups.php:989 376 #: includes/classes/Utils.php:654 includes/classes/Utils.php:731 377 msgid "Assignment" 557 378 msgstr "" 558 379 … … 595 416 msgstr "" 596 417 418 #: includes/classes/FieldGroups.php:941 includes/classes/FieldGroups.php:1268 419 #: includes/classes/Utils.php:575 includes/classes/Utils.php:629 420 msgid "Plural" 421 msgstr "" 422 597 423 #: includes/classes/FieldGroups.php:942 includes/classes/FieldGroups.php:1269 598 424 msgid "Plural name." … … 603 429 msgstr "" 604 430 431 #: includes/classes/FieldGroups.php:957 includes/classes/FieldGroups.php:1284 432 #: includes/classes/Utils.php:578 includes/classes/Utils.php:632 433 msgid "ID" 434 msgstr "" 435 605 436 #: includes/classes/FieldGroups.php:958 606 msgid "Taxonomy key."437 msgid "Taxonomy ID." 607 438 msgstr "" 608 439 … … 766 597 767 598 #: includes/classes/FieldGroups.php:1285 768 msgid "Post type key."599 msgid "Post type ID." 769 600 msgstr "" 770 601 … … 1081 912 msgstr "" 1082 913 1083 #: includes/classes/PostTypes.php:23 4914 #: includes/classes/PostTypes.php:238 1084 915 msgid "Post type registration was not successful (\"id\" \"singular\" and \"plural\" args are required)." 1085 916 msgstr "" 1086 917 1087 #: includes/classes/PostTypes.php:268 918 #: includes/classes/PostTypes.php:254 919 msgid "Post type reserved or already registered, try a different \"id\"." 920 msgstr "" 921 922 #: includes/classes/PostTypes.php:288 1088 923 msgid "Post type registration was not successful." 1089 924 msgstr "" … … 1137 972 msgstr "" 1138 973 1139 #: includes/classes/Taxonomies.php:219 974 #: includes/classes/Taxonomies.php:206 975 msgid "Taxonomy reserved or already registered, try a different \"id\"." 976 msgstr "" 977 978 #: includes/classes/Taxonomies.php:235 1140 979 msgid "Taxonomy registration was not successful." 1141 980 msgstr "" 1142 981 1143 #: includes/classes/Utils.php: 76includes/fields/post_rel.php:78982 #: includes/classes/Utils.php:69 includes/fields/post_rel.php:78 1144 983 msgid "Posts" 1145 984 msgstr "" 1146 985 1147 #: includes/classes/Utils.php:7 7986 #: includes/classes/Utils.php:70 1148 987 msgid "Pages" 1149 988 msgstr "" 1150 989 1151 #: includes/classes/Utils.php: 94includes/fields/tax_rel.php:78990 #: includes/classes/Utils.php:87 includes/fields/tax_rel.php:78 1152 991 msgid "Categories" 1153 992 msgstr "" 1154 993 1155 #: includes/classes/Utils.php: 95994 #: includes/classes/Utils.php:88 1156 995 msgid "Tags" 1157 996 msgstr "" 1158 997 1159 #: includes/classes/Utils.php:1 10 includes/classes/Utils.php:1111160 #: includes/classes/Utils.php:1 12 includes/classes/Utils.php:1131161 #: includes/classes/Utils.php:1 14998 #: includes/classes/Utils.php:103 includes/classes/Utils.php:104 999 #: includes/classes/Utils.php:105 includes/classes/Utils.php:106 1000 #: includes/classes/Utils.php:107 1162 1001 msgid "Settings" 1163 1002 msgstr "" 1164 1003 1165 #: includes/classes/Utils.php:1 111004 #: includes/classes/Utils.php:104 1166 1005 msgid "Writing" 1167 1006 msgstr "" 1168 1007 1169 #: includes/classes/Utils.php:1 121008 #: includes/classes/Utils.php:105 1170 1009 msgid "Reading" 1171 1010 msgstr "" 1172 1011 1173 #: includes/classes/Utils.php:1 131012 #: includes/classes/Utils.php:106 1174 1013 msgid "Discussion" 1175 1014 msgstr "" 1176 1015 1177 #: includes/classes/Utils.php:1 141016 #: includes/classes/Utils.php:107 1178 1017 msgid "Media" 1179 1018 msgstr "" 1180 1019 1181 #: includes/classes/Utils.php:191 includes/classes/Utils.php:430 1020 #: includes/classes/Utils.php:172 includes/classes/Utils.php:553 1021 msgid "Post types" 1022 msgstr "" 1023 1024 #: includes/classes/Utils.php:178 includes/classes/Utils.php:606 1025 #: includes/classes/Utils.php:618 1026 msgid "Taxonomies" 1027 msgstr "" 1028 1029 #: includes/classes/Utils.php:184 includes/classes/Utils.php:423 1182 1030 msgid "Admin pages" 1183 1031 msgstr "" 1184 1032 1185 #: includes/classes/Utils.php:1 951033 #: includes/classes/Utils.php:188 1186 1034 msgid "Extra" 1187 1035 msgstr "" 1188 1036 1189 #: includes/classes/Utils.php:279 1037 #: includes/classes/Utils.php:189 includes/classes/Utils.php:772 1038 msgid "Users" 1039 msgstr "" 1040 1041 #: includes/classes/Utils.php:272 1190 1042 msgid "Post title" 1191 1043 msgstr "" 1192 1044 1193 #: includes/classes/Utils.php:2 801045 #: includes/classes/Utils.php:273 1194 1046 msgid "Post content" 1195 1047 msgstr "" 1196 1048 1197 #: includes/classes/Utils.php:2 811049 #: includes/classes/Utils.php:274 1198 1050 msgid "Post excerpt" 1199 1051 msgstr "" 1200 1052 1201 #: includes/classes/Utils.php:2 821053 #: includes/classes/Utils.php:275 1202 1054 msgid "Post image" 1203 1055 msgstr "" 1204 1056 1205 #: includes/classes/Utils.php:2 831057 #: includes/classes/Utils.php:276 1206 1058 msgid "Post author" 1207 1059 msgstr "" 1208 1060 1209 #: includes/classes/Utils.php:2 841061 #: includes/classes/Utils.php:277 1210 1062 msgid "Post date" 1211 1063 msgstr "" 1212 1064 1213 #: includes/classes/Utils.php:2 851065 #: includes/classes/Utils.php:278 1214 1066 msgid "Post modified date" 1215 1067 msgstr "" 1216 1068 1217 #: includes/classes/Utils.php:29 81069 #: includes/classes/Utils.php:291 1218 1070 msgid "Term name" 1219 1071 msgstr "" 1220 1072 1221 #: includes/classes/Utils.php:29 91073 #: includes/classes/Utils.php:292 1222 1074 msgid "Term description" 1223 1075 msgstr "" 1224 1076 1225 #: includes/classes/Utils.php:36 8 includes/classes/Utils.php:3771077 #: includes/classes/Utils.php:361 includes/classes/Utils.php:370 1226 1078 msgid "Click to copy" 1227 1079 msgstr "" 1228 1080 1229 #: includes/classes/Utils.php:3 82 includes/classes/Utils.php:3831081 #: includes/classes/Utils.php:375 includes/classes/Utils.php:376 1230 1082 msgid "No shortcodes available" 1231 1083 msgstr "" 1232 1084 1233 #: includes/classes/Utils.php: 4001085 #: includes/classes/Utils.php:393 1234 1086 msgid "This feature requires the <u>PRO version</u> and a valid license key." 1235 1087 msgstr "" 1236 1088 1237 #: includes/classes/Utils.php:4 211089 #: includes/classes/Utils.php:414 1238 1090 msgid "Templates" 1239 1091 msgstr "" 1240 1092 1241 #: includes/classes/Utils.php:43 91093 #: includes/classes/Utils.php:432 1242 1094 msgid "Admin notices" 1243 1095 msgstr "" 1244 1096 1245 #: includes/classes/Utils.php:4 661097 #: includes/classes/Utils.php:459 1246 1098 msgid "<strong>Custom post types</strong> notice:" 1247 1099 msgstr "" 1248 1100 1249 #: includes/classes/Utils.php:4 841101 #: includes/classes/Utils.php:477 1250 1102 msgid "See registration args" 1103 msgstr "" 1104 1105 #: includes/classes/Utils.php:552 includes/classes/Utils.php:556 1106 #: includes/classes/Utils.php:558 includes/fields/post_rel.php:73 1107 msgid "Post type" 1108 msgstr "" 1109 1110 #: includes/classes/Utils.php:557 1111 msgid "Extend / Manage" 1112 msgstr "" 1113 1114 #: includes/classes/Utils.php:559 1115 msgid "Add post type" 1116 msgstr "" 1117 1118 #: includes/classes/Utils.php:560 1119 msgid "Add new post type" 1120 msgstr "" 1121 1122 #: includes/classes/Utils.php:561 1123 msgid "New post type" 1124 msgstr "" 1125 1126 #: includes/classes/Utils.php:562 1127 msgid "Edit post type" 1128 msgstr "" 1129 1130 #: includes/classes/Utils.php:563 1131 msgid "View post type" 1132 msgstr "" 1133 1134 #: includes/classes/Utils.php:566 1135 msgid "Search post type" 1136 msgstr "" 1137 1138 #: includes/classes/Utils.php:567 1139 msgid "No post type available." 1140 msgstr "" 1141 1142 #: includes/classes/Utils.php:568 1143 msgid "No post type in the trash." 1144 msgstr "" 1145 1146 #: includes/classes/Utils.php:571 1147 msgid "Create and manage custom post types." 1148 msgstr "" 1149 1150 #: includes/classes/Utils.php:584 includes/classes/Utils.php:638 1151 msgid "Count" 1152 msgstr "" 1153 1154 #: includes/classes/Utils.php:594 includes/classes/Utils.php:648 1155 #: includes/classes/Utils.php:664 includes/classes/Utils.php:751 1156 #: includes/classes/Utils.php:761 includes/classes/Utils.php:771 1157 #: includes/classes/Utils.php:782 1158 msgid "View" 1159 msgstr "" 1160 1161 #: includes/classes/Utils.php:605 includes/classes/Utils.php:609 1162 #: includes/classes/Utils.php:610 includes/classes/Utils.php:611 1163 #: includes/fields/tax_rel.php:73 1164 msgid "Taxonomy" 1165 msgstr "" 1166 1167 #: includes/classes/Utils.php:608 1168 msgid "Custom taxonomies" 1169 msgstr "" 1170 1171 #: includes/classes/Utils.php:612 1172 msgid "Add taxonomy" 1173 msgstr "" 1174 1175 #: includes/classes/Utils.php:613 1176 msgid "Add new taxonomy" 1177 msgstr "" 1178 1179 #: includes/classes/Utils.php:614 1180 msgid "New taxonomy" 1181 msgstr "" 1182 1183 #: includes/classes/Utils.php:615 1184 msgid "Edit taxonomy" 1185 msgstr "" 1186 1187 #: includes/classes/Utils.php:616 1188 msgid "View taxonomy" 1189 msgstr "" 1190 1191 #: includes/classes/Utils.php:619 1192 msgid "Search taxonomy" 1193 msgstr "" 1194 1195 #: includes/classes/Utils.php:620 1196 msgid "No taxonomy available." 1197 msgstr "" 1198 1199 #: includes/classes/Utils.php:621 1200 msgid "No taxonomy in the trash." 1201 msgstr "" 1202 1203 #: includes/classes/Utils.php:624 1204 msgid "Create and manage custom taxonomies." 1205 msgstr "" 1206 1207 #: includes/classes/Utils.php:677 includes/classes/Utils.php:681 1208 #: includes/classes/Utils.php:682 includes/classes/Utils.php:683 1209 msgid "Field group" 1210 msgstr "" 1211 1212 #: includes/classes/Utils.php:678 includes/classes/Utils.php:690 1213 msgid "Field groups" 1214 msgstr "" 1215 1216 #: includes/classes/Utils.php:680 1217 msgid "Custom field groups" 1218 msgstr "" 1219 1220 #: includes/classes/Utils.php:684 1221 msgid "Add field group" 1222 msgstr "" 1223 1224 #: includes/classes/Utils.php:685 1225 msgid "Add new field group" 1226 msgstr "" 1227 1228 #: includes/classes/Utils.php:686 1229 msgid "New field group" 1230 msgstr "" 1231 1232 #: includes/classes/Utils.php:687 1233 msgid "Edit field group" 1234 msgstr "" 1235 1236 #: includes/classes/Utils.php:688 1237 msgid "View field group" 1238 msgstr "" 1239 1240 #: includes/classes/Utils.php:691 1241 msgid "Search field group" 1242 msgstr "" 1243 1244 #: includes/classes/Utils.php:692 1245 msgid "No field group available." 1246 msgstr "" 1247 1248 #: includes/classes/Utils.php:693 1249 msgid "No field group in the trash." 1250 msgstr "" 1251 1252 #: includes/classes/Utils.php:696 1253 msgid "Create and manage custom field groups." 1254 msgstr "" 1255 1256 #: includes/classes/Utils.php:702 1257 msgid "Name" 1258 msgstr "" 1259 1260 #: includes/classes/Utils.php:705 1261 msgid "Fields" 1262 msgstr "" 1263 1264 #: includes/classes/Utils.php:813 1265 msgid "Tools & Infos" 1251 1266 msgstr "" 1252 1267 -
custom-post-types/trunk/readme.txt
r2948437 r2954735 4 4 Donate link: https://totalpress.org/donate?utm_source=wordpress_org&utm_medium=plugin_page&utm_campaign=custom_post_types 5 5 Requires at least: 4.0 6 Tested up to: 6. 27 Stable tag: 4.0. 86 Tested up to: 6.3 7 Stable tag: 4.0.9 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 206 206 == Changelog == 207 207 208 = 4.0.8 = 209 *2023-08-07* 208 = 4.0.9 - 2023-08-16 = 209 * Introducing of blacklist for prevent the override of core contents; 210 * Edit "Key" label to "ID"; 211 * Introducing Core instance; 212 213 = 4.0.8 - 2023-08-07 = 210 214 * Restore extra/users field groups; 211 215 * Improve quality of code; … … 213 217 * Add translation template; 214 218 215 = 4.0.7 = 216 *2023-07-30* 219 = 4.0.7 - 2023-07-30 = 217 220 * Activation/deactivation actions 218 221 219 = 4.0.6 = 220 *2023-07-28* 222 = 4.0.6 - 2023-07-28 = 221 223 * Performance improvments 222 224 223 = 4.0.5 = 224 *2023-06-30* 225 = 4.0.5 - 2023-06-30 = 225 226 * Check if attachment.sizes.thumbnail.url exists on file field (@dealespaloit) 226 227 227 = 4.0.4 = 228 *2023-06-12* 228 = 4.0.4 - 2023-06-12 = 229 229 * Fix file field styles inside repeater field (@dealespaloit) 230 230 * Prevent multiple type filter on field output
Note: See TracChangeset
for help on using the changeset viewer.