示例#1
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     // load the current project row and settings from that row
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->current_project_settings = false;
         } else {
             $this->current_project_settings = maybe_unserialize($this->project_object->projectsettings);
         }
         parent::setup($action, $data);
         // query the last post
         $result = $this->DB->selectorderby($this->CSV2POST->get_project_main_table($csv2post_settings['currentproject']), 'c2p_postid != 0', 'c2p_applied', 'c2p_postid', 1);
         if ($result) {
             $this->lastpost = get_post($result[0]->c2p_postid);
         } else {
             $this->add_meta_box('lastpost-nopostscreated', __('No Posts Created', 'csv2post'), array($this, 'parent'), 'normal', 'default', array('formid' => 'nopostscreated'));
         }
     } else {
         $this->add_meta_box('lastpost-nocurrentproject', __('No Current Project', 'csv2post'), array($this->UI, 'metabox_nocurrentproject'), 'normal', 'default', array('formid' => 'nocurrentproject'));
     }
 }
示例#2
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     // extended by CSV2POST_Forms
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     parent::setup($action, $data);
     // using array register many meta boxes
     foreach (self::meta_box_array() as $key => $metabox) {
         // the $metabox array includes required capability to view the meta box
         if (isset($metabox[7]) && current_user_can($metabox[7])) {
             $this->add_meta_box($metabox[0], $metabox[1], $metabox[2], $metabox[3], $metabox[4], $metabox[5]);
         }
     }
 }
 /**
  * Install __construct persistently registers database tables and is the
  * first point to monitoring installation state 
  */
 public function __construct()
 {
     // load class used at all times
     // $this->DB = new CSV2POST_DB(); commeted 14092014
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = new CSV2POST_PHP();
     // on activation run install_plugin() method which then runs more methods i.e. create_tables();
     register_activation_hook(WTG_CSV2POST_ABSPATH . 'csv-2-post.php', array($this, 'install_plugin'));
     // on deactivation run disabled_plugin() - not a full uninstall
     register_deactivation_hook(WTG_CSV2POST_ABSPATH . 'csv-2-post.php', array($this, 'deactivate_plugin'));
     // register c2plog table
     add_action('init', array($this, 'register_c2plog_table'));
     add_action('switch_blog', array($this, 'register_c2plog_table'));
     $this->register_c2plog_table();
     // register tables manually as the hook may have been missed
     // register c2pprojects tables
     add_action('init', array($this, 'register_c2pprojects_table'));
     add_action('switch_blog', array($this, 'register_c2pprojects_table'));
     $this->register_c2pprojects_table();
     // register tables manually as the hook may have been missed
     add_action('init', array($this, 'register_c2psources_table'));
     add_action('switch_blog', array($this, 'register_c2psources_table'));
     $this->register_c2psources_table();
     // register tables manually as the hook may have been missed
 }
示例#4
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // set current project values
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->current_project_settings = false;
         } else {
             $this->current_project_settings = maybe_unserialize($this->project_object->projectsettings);
         }
     }
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     parent::setup($action, $data);
     // create a data table ( use "head" to position before any meta boxes and outside of meta box related divs)
     $this->add_text_box('head', array($this, 'datatables'), 'normal');
     // using array register many meta boxes
     foreach (self::meta_box_array() as $key => $metabox) {
         // the $metabox array includes required capability to view the meta box
         if (isset($metabox[7]) && current_user_can($metabox[7])) {
             $this->add_meta_box($metabox[0], $metabox[1], $metabox[2], $metabox[3], $metabox[4], $metabox[5]);
         }
     }
 }
示例#5
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     // load the current project row and settings from that row
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->current_project_settings = false;
         } else {
             $this->current_project_settings = maybe_unserialize($this->project_object->projectsettings);
         }
         parent::setup($action, $data);
         // using array register many meta boxes
         foreach (self::meta_box_array() as $key => $metabox) {
             // the $metabox array includes required capability to view the meta box
             if (isset($metabox[7]) && current_user_can($metabox[7])) {
                 $this->add_meta_box($metabox[0], $metabox[1], $metabox[2], $metabox[3], $metabox[4], $metabox[5]);
             }
         }
     } else {
         $this->add_meta_box('import-nocurrentproject', __('No Current Project', 'csv2post'), array($this->UI, 'metabox_nocurrentproject'), 'normal', 'default', array('formid' => 'nocurrentproject'));
     }
 }
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // set current project values
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->current_project_settings = false;
         } else {
             $this->current_project_settings = maybe_unserialize($this->project_object->projectsettings);
         }
     }
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     parent::setup($action, $data);
     $this->add_text_box('head1', array($this, 'intro'), 'normal');
     // create a data table ( use "head" to position before any meta boxes and outside of meta box related divs)
     $this->add_text_box('head2', array($this, 'checklist'), 'normal');
 }
 public function nextversion_clean()
 {
     global $csv2post_filesversion;
     $installed_version = CSV2POST::get_installed_version();
     $installed_version_cleaned = str_replace('.', '', $installed_version);
     return $installed_version_cleaned + 1;
 }
 public function __construct()
 {
     // create class objects
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->WPCore = CSV2POST::load_class('CSV2POST_WPCore', 'class-wpcore.php', 'classes');
     // get form validation array
     $this->form_val_arr = get_option('csv2post_formvalidation');
     // re-populate class var with the localized value
     $this->first_switch_label = __('Enabled', 'csv2post');
     $this->second_switch_label = __('Disabled', 'csv2post');
 }
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 8.1.3
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, array $data)
 {
     global $csv2post_settings;
     // create constant for view name
     if (!defined("WTG_CSV2POST_VIEWNAME")) {
         define("WTG_CSV2POST_VIEWNAME", $this->view_name);
     }
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     // extended by CSV2POST_Forms
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->FORMS = CSV2POST::load_class('CSV2POST_FORMS', 'class-forms.php', 'classes');
     // add view introduction
     $this->add_text_box('viewintroduction', array($this, 'viewintroduction'), 'normal');
     // load the current project row and settings from that row
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->current_project_settings = false;
         } else {
             $this->current_project_settings = maybe_unserialize($this->project_object->projectsettings);
         }
         parent::setup($action, $data);
         // only output meta boxes
         if ($this->purpose == 'normal') {
             self::metaboxes();
         } elseif ($this->purpose == 'dashboard') {
             //self::dashboard();
         } elseif ($this->purpose == 'customdashboard') {
             return self::meta_box_array();
         } else {
             // do nothing - can call metaboxes() manually and place them
         }
     } else {
         $this->add_meta_box('tools-nocurrentproject', __('No Current Project', 'csv2post'), array($this->UI, 'metabox_nocurrentproject'), 'normal', 'default', array('formid' => 'nocurrentproject'));
     }
 }
 public function __construct()
 {
     global $csv2post_settings;
     // create class objects
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     # plugin specific functions
     $this->DB = $this->CSV2POST->load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     # database interaction
     $this->PHP = $this->CSV2POST->load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     # php library by Ryan R. Bayne
     $this->WPCore = $this->CSV2POST->load_class('CSV2POST_WPCore', 'class-wpcore.php', 'classes');
     $this->UI = $this->CSV2POST->load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     # interface, mainly notices
     // set current project values
     if (isset($csv2post_settings['currentproject']) && $csv2post_settings['currentproject'] !== false) {
         $this->project_object = $this->CSV2POST->get_project($csv2post_settings['currentproject']);
         if (!$this->project_object) {
             $this->pro_set = false;
         } else {
             $this->pro_set = maybe_unserialize($this->project_object->projectsettings);
         }
     }
 }
示例#11
0
 /**
  * post box function for testing
  * 
  * @author Ryan Bayne
  * @package CSV 2 POST
  * @since 8.1.3
  * @version 1.1
  */
 public function postbox_main_dashboardwidgetsettings($data, $box)
 {
     global $csv2post_settings;
     $this->UI->postbox_content_header($box['title'], $box['args']['formid'], __('This panel is new and is advanced.   
     Please seek my advice before using it.
     You must be sure and confident that it operates in the way you expect.
     It will add widgets to your dashboard. 
     The capability menu allows you to set a global role/capability requirements for the group of wigets from any giving page. 
     The capability options in the "Page Capability Settings" panel are regarding access to the admin page specifically.', 'csv2post'), false);
     $this->FORMS->form_start($box['args']['formid'], $box['args']['formid'], $box['title']);
     echo '<table class="form-table">';
     // now loop through views, building settings per box (display or not, permitted role/capability
     $CSV2POST_TabMenu = CSV2POST::load_class('C2P_TabMenu', 'class-pluginmenu.php', 'classes');
     $menu_array = $CSV2POST_TabMenu->menu_array();
     foreach ($menu_array as $key => $section_array) {
         /*
             'groupname' => string 'main' (length=4)
             'slug' => string 'csv2post_generalsettings' (length=24)
             'menu' => string 'General Settings' (length=16)
             'pluginmenu' => string 'General Settings' (length=16)
             'name' => string 'generalsettings' (length=15)
             'title' => string 'General Settings' (length=16)
             'parent' => string 'main' (length=4)
         */
         // get dashboard activation status for the current page
         $current_for_page = '123nocurrentvalue';
         if (isset($csv2post_settings['widgetsettings'][$section_array['name'] . 'dashboardwidgetsswitch'])) {
             $current_for_page = $csv2post_settings['widgetsettings'][$section_array['name'] . 'dashboardwidgetsswitch'];
         }
         // display switch for current page
         $this->UI->option_switch($section_array['menu'], $section_array['name'] . 'dashboardwidgetsswitch', $section_array['name'] . 'dashboardwidgetsswitch', $current_for_page, 'Enabled', 'Disabled', 'disabled');
         // get current pages minimum dashboard widget capability
         $current_capability = '123nocapability';
         if (isset($csv2post_settings['widgetsettings'][$section_array['name'] . 'widgetscapability'])) {
             $current_capability = $csv2post_settings['widgetsettings'][$section_array['name'] . 'widgetscapability'];
         }
         // capabilities menu for each page (rather than individual boxes, the boxes will have capabilities applied in code)
         $this->UI->option_menu_capabilities(__('Capability Required', 'csv2post'), $section_array['name'] . 'widgetscapability', $section_array['name'] . 'widgetscapability', $current_capability);
     }
     echo '</table>';
     $this->UI->postbox_content_footer();
 }
 /**
  * Get time() for the beginning and end of a giving month within a giving year.
  * 
  * @uses date( 't' ) to get the number of days in the giving month and year
  * 
  * @param mixed $month
  * @param mixed $year
  * @param mixed $return
  * @param mixed $format
  */
 public function months_time_range($month, $year, $return = 'array', $format = 'time')
 {
     $array = array();
     // create a date range that spans a month whatever the months total days
     $array['start'] = mktime(0, 0, 0, $month, 1, $year);
     if ($format == 'date') {
         $array['start'] = CSV2POST::datewp(0, $array['start']);
     }
     // t = number of days in giving month   -  set timestamp only to point to correct month "1" does not matter
     $array['end'] = $end_time = mktime(23, 59, 59, $month, date('t', strtotime($month . '/1/' . $year)), $year);
     if ($format == 'date') {
         $array['end'] = CSV2POST::datewp(0, $array['end']);
     }
     if ($return == 'start') {
         return $array['start'];
     } elseif ($return == 'end') {
         return $array['end'];
     } else {
         return $array;
     }
 }
 /**
  * Saves the plugins global dashboard widget settings i.e. which to display, what to display, which roles to allow access
  * 
  * @author Ryan R. Bayne
  * @package CSV 2 POST
  * @since 8.1.33
  * @version 1.1
  */
 public function dashboardwidgetsettings()
 {
     global $csv2post_settings;
     // loop through pages
     $CSV2POST_TabMenu = CSV2POST::load_class('C2P_TabMenu', 'class-pluginmenu.php', 'classes');
     $menu_array = $CSV2POST_TabMenu->menu_array();
     foreach ($menu_array as $key => $section_array) {
         if (isset($_POST[$section_array['name'] . 'dashboardwidgetsswitch'])) {
             $csv2post_settings['widgetsettings'][$section_array['name'] . 'dashboardwidgetsswitch'] = $_POST[$section_array['name'] . 'dashboardwidgetsswitch'];
         }
         if (isset($_POST[$section_array['name'] . 'widgetscapability'])) {
             $csv2post_settings['widgetsettings'][$section_array['name'] . 'widgetscapability'] = $_POST[$section_array['name'] . 'widgetscapability'];
         }
     }
     $this->CSV2POST->update_settings($csv2post_settings);
     $this->UI->create_notice(__('Your dashboard widget settings have been saved. Please check your dashboard to ensure it is configured as required per role.', 'csv2post'), 'success', 'Small', __('Settings Saved', 'csv2post'));
 }
示例#14
0
 public function __construct()
 {
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     # php library by Ryan R. Bayne
 }
示例#15
0
 /**
  * This function is called when on WP core dashboard and it adds widgets to the dashboard using
  * the meta box functions in this class.
  * 
  * @author Ryan R. Bayne
  * @package CSV 2 POST
  * @since 8.1.33
  * @version 1.1
  */
 public function dashboard_widgets($meta_box_array)
 {
     global $csv2post_settings;
     // if dashboard widgets switch not enabled we do nothing, this check should really be done earlier also
     if (!isset($csv2post_settings['widgetsettings']['dashboardwidgetsswitch']) || $csv2post_settings['widgetsettings']['dashboardwidgetsswitch'] !== 'enabled') {
         return;
     }
     // create class objects for use in the dashboard functions, they aren't loaded on dashboard in this classes construct
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     $this->UI = CSV2POST::load_class('CSV2POST_UI', 'class-ui.php', 'classes');
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
     $this->PHP = CSV2POST::load_class('CSV2POST_PHP', 'class-phplibrary.php', 'classes');
     $this->TabMenu = CSV2POST::load_class('C2P_TabMenu', 'class-pluginmenu.php', 'classes');
     // loop through array of meta boxes, which doubles as our array of dashboard widgets
     foreach ($meta_box_array as $key => $metabox) {
         // ensure the meta box is permitted to be setup as a dashboard widget (first line of security)
         if (isset($metabox[6]) && $metabox[6] === true) {
             // now ensure the user as required capability to view the meta box
             if (isset($metabox[7]) && current_user_can($metabox[7])) {
                 wp_add_dashboard_widget($metabox[0] . 'dashboardwidget', $metabox[1], array($this, 'postbox_' . $this->view_name . '_' . $metabox[5]['formid']), false, $metabox[5]);
             }
         }
     }
 }
示例#16
0
if (!defined("WTG_CSV2POST_NAME")) {
    define("WTG_CSV2POST_NAME", 'CSV 2 POST');
}
if (!defined("WTG_CSV2POST__FILE__")) {
    define("WTG_CSV2POST__FILE__", __FILE__);
}
if (!defined("WTG_CSV2POST_BASENAME")) {
    define("WTG_CSV2POST_BASENAME", plugin_basename(WTG_CSV2POST__FILE__));
}
if (!defined("WTG_CSV2POST_ABSPATH")) {
    define("WTG_CSV2POST_ABSPATH", plugin_dir_path(__FILE__));
}
//C:\AppServ\www\wordpress-testing\wtgplugintemplate\wp-content\plugins\wtgplugintemplate/
if (!defined("WTG_CSV2POST_PHPVERSIONMINIMUM")) {
    define("WTG_CSV2POST_PHPVERSIONMINIMUM", '5.3.0');
}
// The minimum php version that will allow the plugin to work
if (!defined("WTG_CSV2POST_IMAGES_URL")) {
    define("WTG_CSV2POST_IMAGES_URL", plugins_url('images/', __FILE__));
}
// require main class
require_once WTG_CSV2POST_ABSPATH . 'classes/class-csv2post.php';
// call key methods for this package, remove each method that is not required when building a new plugin
$CSV2POST = new CSV2POST();
$CSV2POST->custom_post_types();
// localization
function csv2post_textdomain()
{
    load_plugin_textdomain('csv2post', false, dirname(plugin_basename(__FILE__)) . '/languages/');
}
add_action('plugins_loaded', 'csv2post_textdomain');
 public function categories()
 {
     if (isset($this->projectsettings['categories'])) {
         if (isset($this->projectsettings['categories']['data'])) {
             $CSV2POST = new CSV2POST();
             // load categories class
             $CSV2POST->load_class('C2P_Categories', 'class-categories.php', 'classes', array('noreturn'));
             $CSV2POST_Categories = new C2P_Categories();
             // establish if pre-set parent in use
             $preset_parent = false;
             if (isset($this->project_settings_array['categories']['presetcategoryid'])) {
                 $preset_parent = $this->project_settings_array['categories']['presetcategoryid'];
             }
             // create $posts_array which consists of a post ID as key and array of category terms
             $posts_array = array();
             foreach ($this->projectsettings['categories']['data'] as $level => $catarray) {
                 $posts_array[$this->my_post['ID']][] = $this->row[$catarray['column']];
             }
             // $posts_array must have post ID has key and each item an array of terms in order as they are to be in WP
             $CSV2POST_Categories->mass_update_posts_categories($posts_array, $preset_parent);
         }
     }
     // call next method
     $this->content();
 }
示例#18
0
 function __construct()
 {
     global $status, $page;
     $this->CSV2POST = CSV2POST::load_class('CSV2POST', 'class-csv2post.php', 'classes');
     //Set parent defaults
     parent::__construct(array('singular' => 'movie', 'plural' => 'movies', 'ajax' => false));
 }
 public function __construct()
 {
     $this->DB = CSV2POST::load_class('CSV2POST_DB', 'class-wpdb.php', 'classes');
 }