• Well, I’m not expecting a response to this but here goes.

    Love the plugin, pity it hasn’t been updated recently BUT…

    …What I need help with is:

    What part of the Plugin do I edit to make sure the drop down menu in Insert Template shows my templates in alphabetical order (A-Z)?

    Do I edit tinymce-templates.php ? tinymce-templates.js ? or CSS ?

    Or is there a code I can use to enable this option ?

    Please check the screen cap HERE to see what I mean.

    • This topic was modified 1 year, 8 months ago by CineWars.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter CineWars

    (@max1138)

    Here’s the GitHub page.

    Thread Starter CineWars

    (@max1138)

    Okay, I managed to get alphabetical order by changing:

    {
    		$args = array(
    			'label' => __( 'Templates', 'tinymce_templates' ),
    			'labels' => array(
    				'singular_name' => __( 'Templates', 'tinymce_templates' ),
    				'add_new_item' => __( 'Add New Template', 'tinymce_templates' ),
    				'edit_item' => __( 'Edit Template', 'tinymce_templates' ),
    				'add_new' => __( 'Add New', 'tinymce_templates' ),
    				'new_item' => __( 'New Template', 'tinymce_templates' ),
    				'view_item' => __( 'View Template', 'tinymce_templates' ),
    				'not_found' => __( 'No templatess found.', 'tinymce_templates' ),
    				'not_found_in_trash' => __(
    					'No templates found in Trash.',
    					'tinymce_templates'
    				),
    				'search_items' => __( 'Search Templates', 'tinymce_templates' ),
    			),
    			'public' => false,
    			'menu_icon' => 'dashicons-edit',
    			'publicly_queryable' => false,
    			'exclude_from_search' => true,
    			'show_ui' => true,
    			'capability_type' => 'post',
    			'hierarchical' => true, << from false to true
    			'menu_position' => 100,
    			'rewrite' => false,
    			'show_in_nav_menus' => false,
    			'register_meta_box_cb' => array( $this, 'add_meta_box' ),
    			'supports' => array(
    				'title',
    				'editor',
    				'revisions',
    				'author',
    			)
    		);
    		register_post_type( $this->post_type, $args );
    	}

    BUT when editing for the backend editor drop down, changing from DESC to ASC makes no difference:

    public function get_templates()
    	{
    		$p = array(
    			'post_status' => 'publish',
    			'post_type'   => $this->post_type,
    			'orderby'     => 'date',
    			'order'       => 'DESC', <<<<<<<<
    			'numberposts' => -1,
    		);

    So, I’m stuck!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dropdown Menu in Alphabetical Order’ is closed to new replies.