• Hi,

    I have tried to find this in the forum, but have not achieved it. First thanks for a great plugin.

    We are going to build much of our eCommerce product descriptions with your plugin, and will generate a large amount of content blocks to support this strategy.

    To avoid chaos, we were wondering if it is possible to choose the sorting mechanism in the drop down on the insert short code / content block popup on pages/posts?

    Or do you have a suggestion for changing the sorting in the .php file itself?

    Best regards and keep up the good work!
    Alexander, Norway

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Johan van der Wijk

    (@vanderwijk)

    Hi Alexander,

    Currently the order of the custom posts in the drop down is by publish date (which is the default for get_posts).

    You can make this order alphabetical by changing line 51 of the popup.php file to this:

    $args = array( 'post_type' => 'content_block', 'suppress_filters' => 0, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' );

    Changing the plugin file is not recommended though, because this change will be undone by any updates to the plugin. As this feature is not very likely to be useful for other plugin users I don’t think I will modify the plugin. I might add a filter for this so if you have a code suggestion I will likely add this. See https://github.com/vanderwijk/custom-post-widget

    Thread Starter alexaagreen

    (@alexaagreen)

    Hi, thanks! Worked like a charm! I am happy to substitute the code my self.

    I would still argue, that you should replace the existing line of code with the one above due to app will support scalability of content blocks straight away. The drop down is quite useless with more than 20 content blocks when sorted by date, Just my opinion. But, overall, the plugin does magic!!! ??

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort by title in dropdown’ is closed to new replies.