Adding menu_order to CPT admin page

Yes, you need to write code to populate it. This is untested but should work. add_filter(‘manage_edit-cpt_roundtable_columns’, ‘init_roundtable_custom_columns’); function init_roundtable_custom_columns($columns) { return array( ‘cb’ => ‘<input type=”checkbox” />’, ‘title’ => __(‘Title’), ‘taxonomy-sessions’ => __(‘Session’), ‘menu_order’ => __(‘Order’), ‘date’ => __(‘Date’), ); } add_action(‘manage_cpt_roundtable_posts_custom_column’, ‘manage_roundtable_custom_columns’, 10, 2); function manage_roundtable_custom_columns($column, $post_id) { $the_post = get_post($id); switch ($column) { … Read more

How to add a column to the Trash page?

You can check the value of the post_status query variable and make sure that it’s set to trash: function wpse239286_trash_column( $columns ) { // Bail if we’re not looking at trash. $status = get_query_var( ‘post_status’ ); if ( ‘trash’ !== $status ) { return $columns; } return array_merge( $columns, array( ‘trash_column’ => __( ‘Trash Column’, … Read more

Remove order field from Page Attributes box

I went with jQuery to remove the elements. jQuery(document).ready(function() { jQuery(‘#pageparentdiv label[for=menu_order]’).parents(‘p’).eq(0).remove(); jQuery(‘#pageparentdiv input#menu_order’).remove(); });

How get Themes list via REST api?

You can write your own endpoint and use wp_get_themes to get a list of themes via that. Here is a simple one: add_action( ‘rest_api_init’, function () { //Path to rest endpoint register_rest_route( ‘theme_API/v1’, ‘/get_theme_list/’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘theme_list_function’ ) ); }); // Our function to get the themes function theme_list_function(){ // Get … Read more

How can I add my script to admin using script-loader.php?

I think you’e are only registering it with: $scripts->add( ‘user-profile-validator’, …) but not enqueueing it. Check e.g. how wp_register_script() is a wrapper for the WP_Scripts::add() method. Additionally add: wp_enqueue_script( ‘user-profile-validator’ ); in the relevant admin file to enqueue it or add it as a dependency for another enqueued script. Note that password-strength-meter is a dependency … Read more

How can I add ‘view mode’ to screen options for pages and cpts?

Currently the excerpt view is limited to non-hierarchical post types. We are able to filter the view mode in the Screen Options: with the view_mode_post_types filter, introduced within ticket #22222 in changeset #35357: /** * Filters the post types that have different view mode options. * * @since 4.4.0 * * @param array $view_mode_post_types Array … Read more