Exemplo n.º 1
0
 /**
  * Call this only if you are actually showing the page.
  */
 public function initialize()
 {
     $page_hook = wpcf_admin_add_submenu_page(array('menu_title' => $this->get_title(), 'function' => array($this, 'page_handler'), 'capability_filter' => 'wpcf_tfc_view'), wpcf_getget('page'));
     // I hate having to do this. Refactor!
     require_once WPCF_INC_ABSPATH . '/fields.php';
     wpcf_fields_contol_common_resources();
     add_action("load-{$page_hook}", array($this, 'add_screen_options'));
 }
Exemplo n.º 2
0
function wpcf_admin_menu_user_fields_control_hook_helper()
{
    do_action('wpcf_admin_page_init');
    //    add_action( 'admin_head', 'wpcf_admin_user_fields_control_js' );
    require_once WPCF_INC_ABSPATH . '/fields.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    require_once WPCF_INC_ABSPATH . '/fields-control.php';
    if (true && isset($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'user_fields_control_bulk') && (isset($_POST['action']) || isset($_POST['action2'])) && !empty($_POST['fields'])) {
        $action = $_POST['action'] == '-1' ? sanitize_text_field($_POST['action2']) : sanitize_text_field($_POST['action']);
        wpcf_admin_user_fields_control_bulk_actions($action);
    }
    /**
     * add common resources
     */
    wpcf_fields_contol_common_resources();
    /**
     * Table class.
     */
    wpcf_admin_page_add_options('ufc', __('Usermeta Fields', 'wpcf'));
    global $wpcf_control_table;
    $wpcf_control_table = new Types_Admin_Usermeta_Control_Table();
    $wpcf_control_table->prepare_items();
}
Exemplo n.º 3
0
function wpcf_admin_menu_custom_fields_control_hook_helper()
{
    do_action('wpcf_admin_page_init');
    require_once WPCF_INC_ABSPATH . '/fields.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    if (isset($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_control_bulk') && (isset($_POST['action']) || isset($_POST['action2'])) && !empty($_POST['fields'])) {
        $action = $_POST['action'] == '-1' ? sanitize_text_field($_POST['action2']) : sanitize_text_field($_POST['action']);
        wpcf_admin_custom_fields_control_bulk_actions($action);
    }
    /**
     * add common resources
     */
    wpcf_fields_contol_common_resources();
    wpcf_admin_page_add_options('cfc', __('Post Fields', 'wpcf'));
    global $wpcf_control_table;
    $wpcf_control_table = new Types_Admin_Custom_Fields_Control_Table();
    $wpcf_control_table->prepare_items();
}