Ejemplo n.º 1
0
 /**
  * Init hooks
  */
 static function init()
 {
     self::$options = ['tab_one' => ['page_title' => __('The plugin name', PN_PLUGIN_DIR), 'page_description' => __('Manage post types and taxonomies.', PN_PLUGIN_DIR), 'fields' => ['field_name' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'text', 'option_name' => 'field_name', 'default' => false, 'options' => []], 'field_name_2' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'textarea', 'option_name' => 'field_name_2', 'default' => false, 'options' => []], 'field_name_3' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'checkbox', 'option_name' => 'field_name_3', 'default' => false, 'options' => []], 'field_name_4' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'select', 'option_name' => 'field_name_4', 'default' => false, 'options' => ['foo', 'bar']]]], 'tab_two' => ['page_title' => __('The plugin name', PN_PLUGIN_DIR), 'page_description' => __('Manage post types and taxonomies.', PN_PLUGIN_DIR), 'fields' => ['field_name' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'text', 'option_name' => 'field_name', 'default' => false, 'options' => []], 'field_name_2' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'textarea', 'option_name' => 'field_name_2', 'default' => false, 'options' => []], 'field_name_3' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'checkbox', 'option_name' => 'field_name_3', 'default' => false, 'options' => []], 'field_name_4' => ['label' => __('Label nice name', PN_PLUGIN_DIR), 'field_type' => 'select', 'option_name' => 'field_name_4', 'default' => false, 'options' => ['foo', 'bar']]]]];
     // Loads plugin text domain and scripts
     add_action('after_setup_theme', [__CLASS__, 'pn_theme_setup']);
     add_action('admin_enqueue_scripts', [__CLASS__, 'pn_scripts']);
     // Custom action hooks
     // Ajax action hooks
 }