When I change the order of the multi sets elements in the backend, the stars don’t change with them:
Housing Status 3.5
Transportation convenienc 4.5
Life convenience 5
Community environment 3.5
Community external environment 4
Which is not correct…
Plugin Contributor
dudo
(@dudo)
Hello, tank you for using Yasr!
Yes, this is possible, but it require to edit the code each time you update the plugin.
IS this ok?
Yes, that is fine. I will keep note of it before each update.
Which PHP file or code which the elements reside?
Plugin Contributor
dudo
(@dudo)
First, backup your database: do not do this if you can’t backup!!
open the table _yasrmulti_set_fields with phpmyadmin, you should have a situation similiar to this
id parent_set_id field_name field_id
0 1 Housing Status 0
1 1 Transportation convenienc 1
2 1 Life convenience 2
3 1 Community environment 3
4 1 Community external environment 4
You’ve to change the id value, e.g.
id parent_set_id field_name field_id
7 1 Housing Status 0
8 1 Transportation convenienc 1
9 1 Life convenience 2
5 1 Community environment 3
6 1 Community external environment 4
You’ve to do this only 1 time.
Then, open file lib/yasr-shortcodes.php and change on line 463 change this
$set_name_content=$wpdb->get_results($wpdb->prepare("SELECT field_name AS name, field_id AS id
FROM " . YASR_MULTI_SET_FIELDS_TABLE . "
WHERE parent_set_id=%d
ORDER BY field_id ASC", $setid));
weth this
$set_name_content=$wpdb->get_results($wpdb->prepare("SELECT field_name AS name, field_id
FROM " . YASR_MULTI_SET_FIELDS_TABLE . "
WHERE parent_set_id=%d
ORDER BY id ASC", $setid));
lib/yasr-shortcode-functions.php?
Is element #1 assigned to id 0?
if so, wouldn’t it be from
id
0
1
2
3
4
to:
3
4
0
1
2?
Do I have have to have phpmyadmin?
Could it be possible to make changes through just the backend /wp-admin under Plugins > Editor?
Plugin Contributor
dudo
(@dudo)
Is element #1 assigned to id 0?
if so, wouldn’t it be from
id
0
1
2
3
4
to:
3
4
0
1
2?
Is element #1 assigned to id 0?
if so, wouldn’t it be from
id
0
1
2
3
4
to:
3
4
0
1
2?
no
Do I have have to have phpmyadmin?
yes
Could it be possible to make changes through just the backend /wp-admin under Plugins > Editor?
You can edit the lib/yasr-shortcode-functions.php file here, but for acces to db you need phpmyadmin.
If you never used this, just don’t do this change
Isn’t there an easier way to just rearrange the rows of the tables <tr>?