本文整理汇总了PHP中WP_List_Table::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_List_Table::__construct方法的具体用法?PHP WP_List_Table::__construct怎么用?PHP WP_List_Table::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_List_Table
的用法示例。
在下文中一共展示了WP_List_Table::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @access public
* @since 8.3
*
* @uses cnTerm::getBy()
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @param array $args An associative array of arguments.
*/
public function __construct($args = array())
{
$defaults = array('type' => '');
$args = wp_parse_args($args, $defaults);
$this->type = $args['type'];
parent::__construct(array('plural' => 'email', 'singular' => 'email', 'ajax' => FALSE));
}
示例2: SendPress
/** ************************************************************************
* REQUIRED. Set up a constructor that references the parent constructor. We
* use the parent reference to set some default configs.
***************************************************************************/
function __construct()
{
global $status, $page;
$this->_sendpress = new SendPress();
//Set parent defaults
parent::__construct(array('singular' => 'qemail', 'plural' => 'qemails', 'ajax' => false));
}
示例3: array
function __construct()
{
global $status, $page;
$this->example_data = PROFILEPRESS_sql::sql_wp_list_table_registration_builder();
parent::__construct(array('singular' => __('registration', 'profilepress'), 'plural' => __('registrations', 'profilepress'), 'ajax' => false));
add_action('admin_head', array(&$this, 'admin_header'));
}
示例4: __construct
/**
* Get things started
*
* @since 1.1
* @see WP_List_Table::__construct()
*/
public function __construct()
{
global $status, $page;
// Set parent defaults
parent::__construct(array('singular' => __('API Key', 'give'), 'plural' => __('API Keys', 'give'), 'ajax' => false));
$this->query();
}
示例5: __construct
/**
* Get things started
*
* @since 1.4
* @see WP_List_Table::__construct()
*/
public function __construct()
{
global $status, $page;
// Set parent defaults
parent::__construct(array('singular' => edd_get_label_singular(), 'plural' => edd_get_label_plural(), 'ajax' => false));
add_action('edd_log_view_actions', array($this, 'downloads_filter'));
}
示例6: __construct
/**
* Primary class constructor.
*
* @since 2.0.0
*/
public function __construct()
{
// Bring globals into scope for parent.
global $status, $page;
// Allow compat fields to be whitelisted.
$this->compat_fields = array_merge($this->compat_fields, array('base', 'optin_id', 'optin', 'meta', 'total', 'base_url'));
$this->compat_methods = array_merge($this->compat_methods, array('optins_data', 'get_settings_actions'));
// Load the base class object.
$this->base = Optin_Monster::get_instance();
// Set the optin ID, object and meta properties.
$this->optin_id = isset($_GET['om_optin_id']) ? $_GET['om_optin_id'] : $_POST['id'];
$this->optin = get_post($this->optin_id);
$this->meta = get_post_meta($this->optin_id, '_om_meta', true);
// Utilize the parent constructor to build the main class properties.
parent::__construct(array('singular' => 'optin', 'plural' => 'optins', 'ajax' => false));
// Set some of the class properties.
$this->total = $this->base->get_split_tests($this->optin_id) ? count($this->base->get_split_tests($this->optin_id)) : 0;
$this->base_url = add_query_arg('page', 'optin-monster-settings', admin_url('admin.php'));
// Process any bulk actions.
$this->process_bulk_actions();
// Load the track datastore interface.
if (!class_exists('Optin_Monster_Track_Datastore')) {
require plugin_dir_path($this->base->file) . 'includes/global/track-datastore.php';
}
}
示例7: __construct
/**
* Constructor, we override the parent to pass our own arguments
* We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.
*
* @param CUAR_Plugin $plugin
* @param array $args
* @param $base_url
* @param string $item_wrapper_class Class to wrap the WP_Post objects (leave empty to use only WP_Post)
*/
public function __construct($plugin, $args, $base_url, $item_wrapper_class = '')
{
parent::__construct($args);
$this->plugin = $plugin;
$this->base_url = $base_url;
$this->item_wrapper_class = $item_wrapper_class;
}
示例8: __construct
/**
* Create and instance of this list table.
*
* @since 1.0
*/
public function __construct()
{
parent::__construct(array('singular' => 'subscription', 'plural' => 'subscriptions', 'ajax' => false));
$this->process_actions();
// Check if the table caused a fatal error and if so, set flags to disable certain features
add_action('shutdown', array(&$this, 'handle_fatal_errors'));
}
示例9: __construct
public function __construct($args)
{
parent::__construct(array('screen' => 'fw-ext-update-extensions-update'));
$this->_extensions = $args['extensions'];
$this->_table_columns = array('cb' => '<input type="checkbox" />', 'details' => fw_html_tag('a', array('href' => '#', 'onclick' => "jQuery(this).closest('tr').find('input[type=\"checkbox\"]:first').trigger('click'); return false;"), __('Select All', 'fw')));
$this->_table_columns_count = count($this->_table_columns);
}
示例10: array
/**
* The constructor function for our class.
* Adds hooks, initializes variables, setups class.
*/
function __construct()
{
global $status, $page;
$screen = get_current_screen();
/* Determine the status */
$status = 'all';
$statuses = array('active', 'inactive', 'recently_activated', 'admin', 'frontend');
if (isset($_REQUEST['status']) && in_array($_REQUEST['status'], $statuses)) {
$status = $_REQUEST['status'];
}
/* Add the search query to the URL */
if (isset($_REQUEST['s'])) {
$_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']));
}
/* Add a snippets per page screen option */
$page = $this->get_pagenum();
add_screen_option('per_page', array('label' => __('Snippets per page', 'code-snippets'), 'default' => 10, 'option' => 'snippets_per_page'));
/* Set the table columns hidden in Screen Options by default */
add_filter("get_user_option_manage{$screen->id}columnshidden", array($this, 'get_default_hidden_columns'), 15);
/* Strip once-off query args from the URL */
$_SERVER['REQUEST_URI'] = remove_query_arg(array('activate', 'activate-multi', 'deactivate', 'deactivate-multi', 'delete', 'delete-multi'));
/* Add filters to format the snippet description in the same way the post content is formatted */
$filters = array('wptexturize', 'convert_smilies', 'convert_chars', 'wpautop', 'shortcode_unautop', 'capital_P_dangit');
foreach ($filters as $filter) {
add_filter('code_snippets/list_table/print_snippet_description', $filter);
}
/* Setup the class */
parent::__construct(array('singular' => 'snippet', 'plural' => 'snippets', 'ajax' => true));
}
示例11: isset
/** ************************************************************************
* REQUIRED. Set up a constructor that references the parent constructor. We
* use the parent reference to set some default configs.
***************************************************************************/
function __construct()
{
global $status, $page;
//Set parent defaults
parent::__construct(array('singular' => 'notification', 'plural' => 'notifications', 'ajax' => false));
$this->form_id = isset($_REQUEST['form_id']) ? absint($_REQUEST['form_id']) : '';
}
示例12:
/** ************************************************************************
* REQUIRED. Set up a constructor that references the parent constructor. We
* use the parent reference to set some default configs.
***************************************************************************/
function __construct()
{
global $status, $page;
global $wpdb;
//Set parent defaults
parent::__construct(array('singular' => 'user', 'plural' => 'users', 'ajax' => false));
}
示例13:
/**
* Get things started
*
* @access private
* @since 1.0
* @return void
*/
function __construct()
{
global $status, $page;
// Set parent defaults
parent::__construct(array('singular' => __('Subscriber', 'edd-recurring'), 'plural' => __('Subscribers', 'edd-recurring'), 'ajax' => false));
$this->subscribers = $this->query();
}
示例14:
/**
* @param string $field_group
* @param string $post_type
* @param string $table_title
*/
function __construct($field_group, $post_type, $table_title = NULL)
{
global $status, $page;
if ($field_group == 'resume') {
$field_group = 'resume_fields';
}
$this->set_field_group($field_group);
$this->set_post_type($post_type);
$this->set_field_group_slug($this->fields()->get_field_group_slug($field_group));
$this->set_field_group_slug_parent($this->fields()->get_field_group_slug($field_group, TRUE));
$stripped_slug = $this->fields()->get_field_group_stripped_slug($field_group);
$edit_page = 'edit_' . $stripped_slug . '_fields';
$this->set_page($edit_page);
$this->set_fields_page('edit.php?post_type=' . $post_type . '&page=' . $edit_page);
$this->set_table_title(ucfirst($stripped_slug) . __(' Field', 'wp-job-manager-field-editor'));
if ($table_title) {
$this->set_table_title($table_title);
}
if (!$post_type) {
$this->set_post_type($this->fields()->field_group_to_post_type($field_group));
}
ob_start();
parent::__construct(array('singular' => $this->get_table_title(TRUE), 'plural' => $this->get_table_title(), 'ajax' => true, 'screen' => ''));
ob_end_clean();
// Prevent PHP warnings from being output when WP_DEBUG is enabled
}
示例15:
function __construct()
{
if (!empty($_REQUEST['s'])) {
$this->is_search = true;
}
parent::__construct(array('plural' => __('Co-Authors', 'co-authors-plus'), 'singular' => __('Co-Author', 'co-authors-plus')));
}