Forum Replies Created
-
AuthorPosts
-
September 26, 2022 at 3:32 PM in reply to: "Post field" doesn't work after update (custom fields of settings page) #38418
Migecko
ParticipantHello!
I have done all that, but the problem persists...
It's a site made with oxygen builder and an underscore.me theme (oxygen disables themes). I have tried to disable all plugins except Metabox and Metabox AIO, I have also enabled the Twenty Nineteen theme.
September 22, 2022 at 7:59 PM in reply to: "Post field" doesn't work after update (custom fields of settings page) #38390Migecko
ParticipantMore info...
In version 5.6.4:
line 44 of file metabox/js/select-advanced.js :
text: item.label,In version 5.6.7:
line 44 of file metabox/js/select-advanced.js :
text: _.unescape( item.label ),If I manually delete "_.unescape" it works again.
September 22, 2022 at 7:29 PM in reply to: "Post field" doesn't work after update (custom fields of settings page) #38389Migecko
ParticipantWith fresh install seems to work...
This is an extract of the console error from the updated site:
jQuery.Deferred exception: _ is not defined transform/options.ajax.processResults/items<@https://mydomain.com/wp-content/plugins/meta-box/js/select-advanced.js?ver=5.6.7:44:7 transform/options.ajax.processResults@https://mydomain.com/wp-content/plugins/meta-box/js/select-advanced.js?ver=5.6.7:41:37 e</n.prototype.query/e/e<@https://mydomain.com/wp-content/plugins/meta-box/js/select2/select2.min.js?ver=4.0.10:2:37844 e@https://mydomain.com/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.0.2:2:30038 Deferred/then/l/</t<@https://mydomain.com/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.0.2:2:30340 undefinedMigecko
ParticipantOMG... these fields are disabled in the screen options (at the top).
It works now, sorry for the inconvenience.
Migecko
ParticipantAnother clue for my problem.
Viewing the page code from the chrome code inspector, the CPT and its categories are in the accordion code, but hidden by CSS:
.hidden, .js .closed .inside, .js .hide-if-js, .js .wp-core-ui .hide-if-js, .js.wp-core-ui .hide-if-js, .no-js .hide-if-no-js, .no-js .wp-core-ui .hide-if-no-js, .no-js.wp-core-ui .hide-if-no-js {
display: none;
}Migecko
ParticipantHere you are (from Button "get php code" of the builder):
This is a CPT:
<?php add_action( 'init', 'your_prefix_register_post_type' ); function your_prefix_register_post_type() { $labels = [ 'name' => esc_html__( 'Deportes', 'your-textdomain' ), 'singular_name' => esc_html__( 'Deportes', 'your-textdomain' ), 'add_new' => esc_html__( 'Añadir nueva', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Nueva noticia', 'your-textdomain' ), 'edit_item' => esc_html__( 'Editar noticia', 'your-textdomain' ), 'new_item' => esc_html__( 'Nueva noticia', 'your-textdomain' ), 'view_item' => esc_html__( 'Ver noticia', 'your-textdomain' ), 'view_items' => esc_html__( 'View Deportes', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Deportes', 'your-textdomain' ), 'not_found' => esc_html__( 'No deportes found', 'your-textdomain' ), 'not_found_in_trash' => esc_html__( 'No deportes found in Trash', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Deportes:', 'your-textdomain' ), 'all_items' => esc_html__( 'Noticias', 'your-textdomain' ), 'archives' => esc_html__( 'Deportes Archives', 'your-textdomain' ), 'attributes' => esc_html__( 'Deportes Attributes', 'your-textdomain' ), 'insert_into_item' => esc_html__( 'Insert into deportes', 'your-textdomain' ), 'uploaded_to_this_item' => esc_html__( 'Uploaded to this deportes', 'your-textdomain' ), 'featured_image' => esc_html__( 'Featured image', 'your-textdomain' ), 'set_featured_image' => esc_html__( 'Imagen destacada', 'your-textdomain' ), 'remove_featured_image' => esc_html__( 'Borrar imagen destacada', 'your-textdomain' ), 'use_featured_image' => esc_html__( 'Usar como imagen destacada', 'your-textdomain' ), 'menu_name' => esc_html__( 'Deportes', 'your-textdomain' ), 'filter_items_list' => esc_html__( 'Filter deportes list', 'your-textdomain' ), 'filter_by_date' => esc_html__( '', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Deportes list navigation', 'your-textdomain' ), 'items_list' => esc_html__( 'Deportes list', 'your-textdomain' ), 'item_published' => esc_html__( 'Deportes published', 'your-textdomain' ), 'item_published_privately' => esc_html__( 'Deportes published privately', 'your-textdomain' ), 'item_reverted_to_draft' => esc_html__( 'Deportes reverted to draft', 'your-textdomain' ), 'item_scheduled' => esc_html__( 'Deportes scheduled', 'your-textdomain' ), 'item_updated' => esc_html__( 'Deportes updated', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Deportes', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'hierarchical' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'show_in_rest' => false, 'query_var' => true, 'can_export' => true, 'delete_with_user' => false, 'has_archive' => true, 'rest_base' => '', 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-site', 'capability_type' => 'post', 'supports' => ['title', 'editor', 'thumbnail', 'author'], 'taxonomies' => ['c-deportes', 'e-deportes'], 'rewrite' => [ 'with_front' => false, ], ]; register_post_type( 'deportes', $args ); }This is a taxonomy for the previous CPT:
<?php add_action( 'init', 'your_prefix_register_taxonomy' ); function your_prefix_register_taxonomy() { $labels = [ 'name' => esc_html__( 'Categorías', 'your-textdomain' ), 'singular_name' => esc_html__( 'Categoría', 'your-textdomain' ), 'menu_name' => esc_html__( 'Categorías', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Categorías', 'your-textdomain' ), 'popular_items' => esc_html__( 'Popular Categorías', 'your-textdomain' ), 'all_items' => esc_html__( 'All Categorías', 'your-textdomain' ), 'parent_item' => esc_html__( 'Parent Categoría', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Categoría', 'your-textdomain' ), 'edit_item' => esc_html__( 'Editar categoría', 'your-textdomain' ), 'view_item' => esc_html__( 'Ver categoría', 'your-textdomain' ), 'update_item' => esc_html__( 'Actualizar categoría', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Añadir nueva categoría', 'your-textdomain' ), 'new_item_name' => esc_html__( 'New categoría name', 'your-textdomain' ), 'separate_items_with_commas' => esc_html__( 'Separate categorías with commas', 'your-textdomain' ), 'add_or_remove_items' => esc_html__( 'Add or remove categorías', 'your-textdomain' ), 'choose_from_most_used' => esc_html__( 'Choose most used categorías', 'your-textdomain' ), 'not_found' => esc_html__( 'No categorías found', 'your-textdomain' ), 'no_terms' => esc_html__( 'No Categorías', 'your-textdomain' ), 'filter_by_item' => esc_html__( 'Filter by categoría', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Categorías list pagination', 'your-textdomain' ), 'items_list' => esc_html__( 'Categorías list', 'your-textdomain' ), 'most_used' => esc_html__( 'Most Used', 'your-textdomain' ), 'back_to_items' => esc_html__( 'Back to categorías', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Categorías', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'publicly_queryable' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_rest' => true, 'show_tagcloud' => true, 'show_in_quick_edit' => true, 'show_admin_column' => false, 'query_var' => true, 'sort' => false, 'meta_box_cb' => 'post_tags_meta_box', 'rest_base' => '', 'rewrite' => [ 'with_front' => false, 'hierarchical' => false, ], ]; register_taxonomy( 'c-deportes', ['deportes'], $args ); }Thanks!
Migecko
ParticipantHi, Long Nguyen!
Thanks. I've tried re-check "show in nav menus" and re-save permalinks, but it stills no available for selection in menus.
I don't understand it, because if I create a new CPT or taxonomy, appears correctly in menu selection.
Migecko
ParticipantSorry, wrong function. With rwmb_meta instead it's works.
Can delete this topic if you want.
-
AuthorPosts