Author: Inpsyde GmbH, toscho
Inheritance: implements Inpsyde\MultilingualPress\Common\Type\Setting
コード例 #1
0
 /**
  * @return void
  */
 public function reset_table()
 {
     check_admin_referer($this->page_data->get_nonce_action(), $this->page_data->get_nonce_name());
     $table_schema = new Mlp_Db_Languages_Schema($this->wpdb);
     $installer = new Mlp_Db_Installer($table_schema);
     $installer->uninstall();
     $installer->install();
     /**
     * Action after resetting the database-tables of MLP
     *
     *@param   Mlp_Db_Languages_Schema $table_schema
     */
     do_action('mlp_reset_table_done', $table_schema);
     $url = add_query_arg('msg', 'resettable', $_REQUEST['_wp_http_referer']);
     wp_safe_redirect($url);
     exit;
 }
コード例 #2
0
    /**
     * @return void
     */
    private function get_reset_table_link()
    {
        $request = remove_query_arg('msg', wp_unslash($_SERVER['REQUEST_URI']));
        $url = add_query_arg(['action' => $this->reset_action, $this->nonce->action() => (string) $this->nonce, '_wp_http_referer' => esc_attr($request)], (string) $this->setting->url());
        ?>
		<p>
			<a href="<?php 
        echo esc_url($url);
        ?>
" class="delete submitdelete" style="color:red">
				<?php 
        esc_html_e('Reset table to default values', 'multilingual-press');
        ?>
			</a>
		</p>
		<?php 
    }