15. Xây dựng Title, Shortcode, Fields List, Date (ok)

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-list_ct.php

function column_title($item) {
    $page                = isset($_REQUEST['page']) ? $_REQUEST['page'] : 'wpf_search';
    static $nonce_edit   = null;
    static $nonce_delete = null;
    if (is_null($nonce_edit)) {
      $nonce_edit = wp_create_nonce($this->plugin_name . '_edit');
    }
    if (is_null($nonce_delete)) {
      $nonce_delete = wp_create_nonce($this->plugin_name . '_delete');
    }
    //Build row actions
    $actions = array(
      'edit'   => sprintf(
        '<a title="%1$s" href="%2$s" class="wpf_lightbox wpf_edit">%3$s</a>', sprintf(__('Edit Product Filter %s', 'wpf'), $item['name']), add_query_arg(array('action' => 'wpf_edit', 'nonce' => $nonce_edit, 'slug' => $item['slug']), admin_url('admin-ajax.php')), __('Edit', 'wpf')
      ),
      'export' => sprintf(
        '<a title="%1$s" href="%2$s" class="wpf_export">%3$s</a>', sprintf(__('Export Product Filter %s', 'wpf'), $item['name']), add_query_arg(array('page' => $page, 'action' => 'wpf_export', 'slug' => $item['slug']), admin_url('admin.php')), __('Export', 'wpf')
      ),
      'delete' => sprintf(
        '<a title="%1$s" href="%2$s" class="wpf_delete">%3$s</a>', sprintf(__('Delete Product Filter %s', 'wpf'), $item['name']), add_query_arg(array('action' => 'wpf_delete', 'nonce' => $nonce_delete, 'slug' => $item['slug']), admin_url('admin-ajax.php')), __('Delete', 'wpf')
      ),
    );
    return sprintf('%1$s %2$s', $item['name'], $this->row_actions($actions)
    );
  }

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-list_ct.php

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-list_ct.php

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-list_ct.php

Last updated

Was this helpful?