Exemplo n.º 1
0
/**
 * Menu page hook.
 */
function wpcf_admin_menu_custom_fields_control_hook()
{
    do_action('wpcf_admin_page_init');
    add_action('admin_head', 'wpcf_admin_custom_fields_control_js');
    add_thickbox();
    wp_enqueue_script('wpcf-js', WPCF_RES_RELPATH . '/js/basic.js', array('jquery', 'jquery-ui-sortable', 'jquery-ui-draggable'), WPCF_VERSION);
    wp_enqueue_style('wpcf-custom-fields-control', WPCF_RES_RELPATH . '/css/basic.css', array(), WPCF_VERSION);
    require_once WPCF_INC_ABSPATH . '/fields.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    require_once WPCF_INC_ABSPATH . '/fields-control.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' ? $_POST['action2'] : $_POST['action'];
        wpcf_admin_custom_fields_control_bulk_actions($action);
    }
    global $wpcf_control_table;
    $wpcf_control_table = new WPCF_Custom_Fields_Control_Table(array('ajax' => true, 'singular' => __('Custom Field', 'wpcf'), 'plural' => __('Custom Fields', 'wpcf')));
    $wpcf_control_table->prepare_items();
}
Exemplo n.º 2
0
/**
 * Menu page hook.
 */
function wpcf_admin_menu_custom_fields_control_hook()
{
    do_action('wpcf_admin_page_init');
    add_action('admin_head', 'wpcf_admin_custom_fields_control_js');
    add_thickbox();
    require_once WPCF_INC_ABSPATH . '/fields.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    require_once WPCF_INC_ABSPATH . '/fields-control.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' ? $_POST['action2'] : $_POST['action'];
        wpcf_admin_custom_fields_control_bulk_actions($action);
    }
    global $wpcf_control_table;
    $wpcf_control_table = new WPCF_Custom_Fields_Control_Table(array('ajax' => true, 'singular' => __('Custom Field', 'wpcf'), 'plural' => __('Custom Fields', 'wpcf')));
    $wpcf_control_table->prepare_items();
}