Mlp_Term_Translation_Presenter::get_key_base PHP Method

get_key_base() public method

Term key base for given site.
public get_key_base ( integer $site_id ) : string
$site_id integer Blog ID.
return string
    public function get_key_base($site_id)
    {
        return "{$this->key_base}[{$site_id}]";
    }

Usage Example

    /**
     * @return bool
     */
    public function print_table()
    {
        if (empty($this->related_sites)) {
            return FALSE;
        }
        print $this->presenter->get_nonce_field();
        $this->print_style();
        ?>

		<table class="mlp_term_selections">
			<?php 
        foreach ($this->related_sites as $site_id => $language) {
            $key = $this->presenter->get_key_base($site_id);
            $label_id = $this->get_label_id($key);
            $terms = $this->presenter->get_terms_for_site($site_id);
            ?>
				<tr>
					<th>
						<label for="<?php 
            print $label_id;
            ?>
"><?php 
            print $language;
            ?>
</label>
					</th>
					<td>
						<?php 
            if (empty($terms)) {
                print $this->get_no_terms_found_message($site_id);
            } else {
                ?>
							<select name="<?php 
                print $key;
                ?>
"
									id="<?php 
                print $label_id;
                ?>
">
								<option value="0" class="mlp_empty_option"><?php 
                esc_html_e('No translation', 'multilingualpress');
                ?>
</option>
								<?php 
                $this->print_term_options($site_id, $terms);
                ?>
							</select>
						<?php 
            }
            ?>
					</td>
				</tr>
				<?php 
        }
        ?>
		</table>
		<?php 
        return TRUE;
    }
All Usage Examples Of Mlp_Term_Translation_Presenter::get_key_base