Skip to content

Commit

Permalink
Email Options
Browse files Browse the repository at this point in the history
  • Loading branch information
cogdog committed Aug 5, 2019
1 parent 8c60738 commit bfaa3ab
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 159 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -34,3 +34,4 @@ On activation, the plugin *should* create two Pages in your site; one acts as th
## Changes

* v1.1.0 Just got it working! It's beta, baby
* v1.2.0 Minor fixes, new options to enable/hide email entry form plus allow limiting use of emails by domain
8 changes: 0 additions & 8 deletions admin/class-splotwriter-admin.php
Expand Up @@ -117,14 +117,6 @@ public function splotwriter_change_label() {

}


// load theme options Settings
public function splotwriter_load_theme_options() {
// class for adding admin options
require plugin_dir_path( __FILE__ ) . 'class-splotwriter-options.php';
}


public function splotwriter_options_to_admin() {
// put the options on the menu and top stage
global $wp_admin_bar;
Expand Down
3 changes: 1 addition & 2 deletions includes/class-splotwriter.php
Expand Up @@ -154,7 +154,6 @@ private function define_admin_hooks() {

$plugin_admin = new Splotwriter_Admin( $this->get_plugin_name(), $this->get_version() );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
$this->loader->add_action( 'after_setup_theme', $plugin_admin, 'splotwriter_load_theme_options', 9 );
$this->loader->add_action( 'init', $plugin_admin, 'splotwriter_change_post_object' );
$this->loader->add_action( 'admin_menu', $plugin_admin, 'splotwriter_change_label' );
$this->loader->add_action( 'wp_before_admin_bar_render', $plugin_admin, 'splotwriter_options_to_admin' );
Expand All @@ -176,12 +175,12 @@ private function define_public_hooks() {
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );

$this->loader->add_action( 'after_switch_theme', $plugin_public, 'splotwriter_rewrite_rules' );
$this->loader->add_action( 'init', $plugin_public, 'splotwriter_rewrite_rules' );
$this->loader->add_action( 'init', $plugin_public, 'register_shortcodes' );
$this->loader->add_action( 'customize_register', $plugin_public, 'splotwriter_register_theme_customizer' );

$this->loader->add_action( 'after_setup_theme', $plugin_public, 'splot_remove_admin_bar' );
$this->loader->add_action( 'after_setup_theme', $plugin_public, 'splotwriter_load_theme_options', 9 );
$this->loader->add_action( 'query_vars', $plugin_public, 'splotwriter_queryvars' );
$this->loader->add_action( 'template_redirect', $plugin_public, 'splotwriter_write_director' );
$this->loader->add_action( 'rest_api_init', $plugin_public, 'splotwriter_create_api_posts_meta_field' );
Expand Down
Expand Up @@ -45,7 +45,7 @@ public function add_pages() {
/* HTML to display the theme options page */
public function display_page() {
echo '<div class="wrap">
<h1>TRU Writer Options</h1>';
<h1>Splot Writer Options</h1>';

if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true )
echo '<div class="updated fade"><p>' . __( 'Plugin options updated.' ) . '</p></div>';
Expand Down Expand Up @@ -102,7 +102,7 @@ public function display_docs() {
// This displays on the "Documentation" tab.

echo '<div class="wrap">
<h1>TRU Writer Documentation</h1>
<h1>SPLOT Writer Documentation</h1>
<h2 class="nav-tab-wrapper">
<a class="nav-tab" href="?page=splotwriter-options">Settings</a>
<a class="nav-tab nav-tab-active" href="?page=splotwriter-docs">Documentation</a></h2>';
Expand All @@ -121,7 +121,7 @@ public function get_settings() {
'section' => 'general',
'title' => '', // Not used for headings.
'desc' => 'Access to Writing Tool',
'std' => '',
'std' => 'Use to require a access code to use the writing form.',
'type' => 'heading'
);

Expand All @@ -137,17 +137,17 @@ public function get_settings() {

$this->settings['accesshint'] = array(
'title' => __( 'Access Hint' ),
'desc' => __( 'Suggestion if someone cannot guess the code. Not super secure, but hey.' ),
'std' => 'Name of this site (lower the case, Ace!)',
'desc' => __( 'Suggestion if someone cannot guess the code. Not super secure' ),
'std' => 'Enter a good suggestion here. ',
'type' => 'text',
'section' => 'general'
);

$this->settings['pages_heading'] = array(
'section' => 'general',
'title' => '', // Not used for headings.
'desc' => 'Pages Setup',
'std' => '',
'desc' => 'Special Pages Setup',
'std' => 'Choose the pages for the two ones that create access to the writing form',
'type' => 'heading'
);

Expand Down Expand Up @@ -214,18 +214,6 @@ public function get_settings() {
'publish' => 'Published immediately to site',
)
);

$this->settings['def_text'] = array(
'title' => __( 'Default Writing Prompt' ),
'desc' => __( 'The default content that will appear in a new blank editor.' ),
'std' => 'Introduction
This is what I have to say, which of course is something important.
Edit this to be more appropriate for your TRU Writer SPLOT.',
'type' => 'richtextarea',
'section' => 'general'
);

$this->settings['allow_comments'] = array(
'section' => 'general',
Expand All @@ -234,18 +222,27 @@ public function get_settings() {
'type' => 'checkbox',
'std' => 0 // Set to 1 to be checked by default, 0 to be unchecked by default.
);

$this->settings['require_extra_info'] = array(


$this->settings['form_heading'] = array(
'section' => 'general',
'title' => __( 'Require Extra Information Field Filled In?'),
'desc' => '',
'type' => 'radio',
'std' => '0',
'choices' => array (
'0' => 'No',
'1' => 'Yes',
'-1' => 'Hide this field',
)
'title' => '', // Not used for headings.
'desc' => 'Writer Form Settings',
'std' => 'Options for the form where visitors compose their writing.',
'type' => 'heading'
);


$this->settings['def_text'] = array(
'title' => __( 'Default Writing Prompt' ),
'desc' => __( 'The default content that will appear in a new blank editor.' ),
'std' => '<h1>Introduction</h1>
This is what I have to say, which of course is something <em>really</em> important.
Edit this to be more appropriate for your onw site as sample starting content.',
'type' => 'richtextarea',
'section' => 'general'
);

$this->settings['defheaderimg'] = array(
Expand All @@ -259,7 +256,7 @@ public function get_settings() {

$this->settings['show_cats'] = array(
'section' => 'general',
'title' => __( 'Show the categories menu on writing form and display'),
'title' => __( 'Show the categories menu on writing form and display the categories when published.'),
'desc' => '',
'type' => 'radio',
'std' => '1',
Expand All @@ -283,8 +280,8 @@ public function get_settings() {

$this->settings['def_cat'] = array(
'section' => 'general',
'title' => __( 'Default Category for New Writing'),
'desc' => '',
'title' => __( 'Set the default category for new items (choose from child categories of "Published").'),
'desc' => '<a href="' . admin_url( 'edit-tags.php?taxonomy=category') . '">Edit categories now</a>.',
'type' => 'select',
'std' => get_option('default_category'),
'choices' => $cat_options
Expand All @@ -293,7 +290,7 @@ public function get_settings() {

$this->settings['show_tags'] = array(
'section' => 'general',
'title' => __( 'Show the tags entry on writing form and single items displays?'),
'title' => __( 'Show the tags entry on writing form and display the tags when published.'),
'desc' => '',
'type' => 'radio',
'std' => '1',
Expand All @@ -302,28 +299,55 @@ public function get_settings() {
'1' => 'Yes'
)
);
$this->settings['show_footer'] = array(

$this->settings['show_email'] = array(
'section' => 'general',
'title' => __( 'Show the footer entry field on the writing form?'),
'desc' => '',
'title' => __( 'Activate email address field for providing access to editing after publication.'),
'desc' => ' Setting to <strong>No</strong> will remove this feature from being available on published items.',
'type' => 'radio',
'std' => '1',
'choices' => array (
'0' => 'No',
'1' => 'Yes'
)
);


$this->settings['notify'] = array(
'title' => __( 'Notification Emails' ),
'desc' => __( 'Send notifications to these addresses (separate multiple wth commas). They must have an Editor Role on this site to be able to moderate' ),

$this->settings['email_domains'] = array(
'title' => __( 'Limit email addresses to domain(s).' ),
'desc' => __( 'Seperate multiple domains by commas' ),
'std' => '',
'type' => 'text',
'section' => 'general'
);


$this->settings['require_extra_info'] = array(
'section' => 'general',
'title' => __( 'Require extra information field filled in?'),
'desc' => 'Use this to enable and/or require additional information entered in the web form that only site admins can view.',
'type' => 'radio',
'std' => '0',
'choices' => array (
'0' => 'No',
'1' => 'Yes',
'-1' => 'Hide this field',
)
);


$this->settings['show_footer'] = array(
'section' => 'general',
'title' => __( 'Show the footer entry field on the writing form?'),
'desc' => 'A field to add extra information like an original source or credit; this gets published at the bottom of the published item.',
'type' => 'radio',
'std' => '1',
'choices' => array (
'0' => 'No',
'1' => 'Yes'
)
);


$this->settings['twitter_heading'] = array(
'section' => 'general',
'title' => '', // Not used for headings.
Expand All @@ -344,7 +368,6 @@ public function get_settings() {
)
);


$this->settings['hashtags'] = array(
'title' => __( 'Twitter Button Hashtag(s)' ),
'desc' => __( 'When a writing is tweeted add these hashtags. Do not include # and separate multiple hashtags with commas.' ),
Expand All @@ -353,6 +376,23 @@ public function get_settings() {
'section' => 'general'
);

$this->settings['admin_heading'] = array(
'section' => 'general',
'title' => '', // Not used for headings.
'desc' => 'Admin Settings',
'std' => '',
'type' => 'heading'
);


$this->settings['notify'] = array(
'title' => __( 'Notification Emails' ),
'desc' => __( 'Send notifications to these addresses (separate multiple wth commas). They must have an Editor Role on this site to be able to moderate' ),
'std' => '',
'type' => 'text',
'section' => 'general'
);

$this->settings['readingtimecheck'] = array(
'section' => 'general',
'title' => '' ,// Not used for headings.
Expand Down Expand Up @@ -428,7 +468,7 @@ public function get_settings() {
public function display_general() {
// section heading for general setttings

echo '<p>These settings manaage the behavior and appearance of your TRU Writer site. There are quite a few of them!</p>';
echo '<p>These settings manaage the behavior and appearance of your Writer site. There are quite a few of them!</p>';
}


Expand Down

0 comments on commit bfaa3ab

Please sign in to comment.