_saved = $saved;
$this->_post_types = $post_types;
$this->_fields = $fields;
add_action( 'admin_menu', array( $this, 'add_athena_page' ));
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
}//end construct function
public static function init( $saved, $post_types, $fields ){
if(!self::$_instance instanceof self){
self::$_instance = new Athena_Settings( $saved, $post_types, $fields );
}
return self::$_instance;
}//end init function
public function add_athena_page(){
add_menu_page(
'Athena Post Expiration',
'Athena Post Ex',
'administrator',
'athena',
array($this, 'create_settings_page'),
'dashicons-sos'
);
add_submenu_page(
'athena',
'Athena Settings',
'Settings',
'administrator',
'athena'
);
}//end add_athena_page method
public function athena_options(){
$settings['general'] = '';
$settings['post-type'] = '';
$settings['scheduled'] = '';
return $settings;
}//end athena_options method
public function create_settings_page(){
?>
'header',
'name' => ucfirst($title)
),
array(
'type' => 'checkbox',
'name' => __('Enable', 'athena-post-expiration'),
'desc' => __('This will enable Athena Post Expiration options on this particular post type', 'athena-post-expiration'),
'default' => '',
'id' => 'enable_posttype_' . $post_type
),
array(
'type' => 'checkbox',
'name' => __('Auto Apply', 'athena-post-expiration'),
'desc' => __('This automatically apply expiration to new posts of this post type.', 'athena-post-expiration'),
'default' => '',
'id' => 'auto_apply_' . $post_type
),
array(
'type' => 'future_date',
'name' => __('Default Date', 'athena-post-expiration'),
'desc' => __('The default amount of time in the future the post will expire.', 'athena-post-expiration'),
'default' => array('count' => 1, 'type' => 'd'),
'id' => 'future_date_' . $post_type,
'times' => 'day'
),
array(
'type' => 'select',
'name' => __('Expiration Action', 'athena-post-expiration'),
'desc' => __('Choose the action to take on the expiring post type', 'athena-post-expiration'),
'id' => 'expire_action_' . $post_type,
'default' => 'draft',
'options' => array(
'delete' => 'Delete',
'draft' => 'Draft',
'private' => 'Private',
'password' => 'Password Protected',
'category' => 'Change Category'
),
'onChange' => true,
'class' => 'athena-ex-type_' . $post_type
),
array(
'type' => 'text',
'name' => __('Post Password', 'athena-post-expiration'),
'desc' => __('Adds a password to the post', 'athena-post-expiration'),
'id' => 'post_password_' . $post_type,
'default' => '',
'activate' => 'athena-ex-type_' . $post_type,
'select' => 'password',
'required' => true,
'max' => 20
),
array(
'type' => 'category',
'name' => __('Post Category', 'athena-post-expiration'),
'desc' => __('Select the Categories to assign to the post', 'athena-post-expiration'),
'id' => 'post_category_' . $post_type,
'default' => '',
'activate' => 'athena-ex-type_' . $post_type,
'select' => 'category',
'required' => true
),
array(
'type' => 'textarea',
'name' => __('Append To Footer', 'athena-post-expiration'),
'desc' => __('Text that will be added to the bottom of the post', 'athena-post-expiration'),
'id' => 'post_footer_append_' . $post_type,
'default' => '',
'legend' => __('%DATETIME% - Displays the date the post expires
')
)
);
}//end post_type_fields method
}//end Athena_Settings class
}//end class_exists