Making WordPress.org


Ignore:
Timestamp:
02/25/2016 09:17:16 PM (10 years ago)
Author:
ocean90
Message:

Rosetta Roles: Store selected projects in a collection and sync them with a hidden input field.

Prevents losing checked projects when the list gets filtered.

See #1590.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php

    r2550 r2618  
    55 * Description: WordPress interface for managing roles.
    66 * Author: ocean90
    7  * Version: 1.1
     7 * Version: 1.2
    88 */
    99
     
    209209                #>
    210210                <label>
    211                     <input type="checkbox" class="input-checkbox" name="projects[]" value="{{data.id}}"
     211                    <input type="checkbox" class="input-checkbox"
    212212                    <#
    213213                    if ( data.checked ) {
     
    435435                $all_projects = array_map( 'intval', $all_projects );
    436436
    437                 $projects = (array) $_REQUEST['projects'];
     437                $projects = explode( ',', $_REQUEST['projects'] );
    438438                if ( in_array( 'all', $projects, true ) ) {
    439439                    $this->update_translation_editor( $user_details, array( 'all' ) );
Note: See TracChangeset for help on using the changeset viewer.