smoothstep
Forum Replies Created
-
Forum: Plugins
In reply to: [Multisite Language Switcher] MSLS fails when editing postHere is the pull request, there are two suggestion, the first one is incomplete but I was unable to modify it, corrected with the second suggestion:
Forum: Plugins
In reply to: [Multisite Language Switcher] MSLS fails when editing postI have posted the update as a suggestion here:
https://github.com/smoothstepdesign/Multisite-Language-Switcher/commits/master/includes/MslsMetaBox.php?author=smoothstepdesignForum: Plugins
In reply to: [Multisite Language Switcher] MSLS fails when editing postPosted at GitHub as a proposed change.
Forum: Plugins
In reply to: [Multisite Language Switcher] MSLS fails when editing postYour listing query was getting all the post fields and then preparing the post object for each listed item requiring huge amount of RAM if many posts are present, after my optimization the query just gets and array the post IDs, and then gets the title for each post ID which is cached by internal WordPress cache.
I estimate the memory requirements have been reduced 10 times if not more, also substantial increase in rendering speed 😉
Forum: Plugins
In reply to: [Multisite Language Switcher] MSLS fails when editing postHi, managed to get it working with 2000+ posts
I have optimized render_select() function in MslsMetaBox.php file, now it requires much less memory, the listing loop has been upgraded to:
$my_query = new WP_Query( array( 'post_type' => $type, 'post_status' => get_post_stati( array( 'internal' => '' ) ), 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1, 'fields' => 'ids' ) ); if ( $my_query->have_posts() ) foreach ($my_query->posts as $my_id) { $options .= sprintf( '<option value="%s" %s>%s</option>', $my_id, selected( $my_id, $mydata->$language, false ), get_the_title($my_id) ); }Please include this upgrade to the next version, some credits would be appreciated as well 😉