From 5c07ab8ae8fcdd0b9e5586f30370a69c4227473a Mon Sep 17 00:00:00 2001
From: Sebastien Dumont ';
- echo sprintf( __('Sorry, %s requires WordPress ' . AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE . ' or higher. Please upgrade your WordPress setup', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST );
- echo ' ' . sprintf( __( 'Thank you for using %s :) Should you need help using or extending %s please read the documentation.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, Auto_Load_Next_Post()->name ) . ' ' . sprintf( __( 'After reading the documentation, for further assistance you can use the community forum.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->doc_url, Auto_Load_Next_Post()->wp_plugin_support_url ) . ' ' . __( 'Community Support', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . ' '.sprintf( __( 'Thank you for using %1$s :) Should you need help using %1$s please read the documentation.', 'auto-load-next-post' ), 'Auto Load Next Post' ).' '.sprintf( __( '%s Documentation', 'auto-load-next-post' ), 'Auto Load Next Post' ).' ' . sprintf( __( 'If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'issues?state=open', AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'blob/master/CONTRIBUTING.md' ) . ' ' . __( 'Report a bug', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . ' '.sprintf( __( 'If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open', 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md' ).' '.__( 'Report a bug', 'auto-load-next-post' ).' ' . __( 'For more information:', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . ' ' . sprintf( __( 'About %s', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name ) . ' ' . __( 'Project on WordPress.org', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . ' ' . __( 'Project on Github', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . ' '.__( 'For more information:', 'auto-load-next-post' ).' '.sprintf( __( 'About %s', 'auto-load-next-post' ), 'Auto Load Next Post' ).' '.__( 'Project on WordPress.org', 'auto-load-next-post' ).' '.__( 'Project on Github', 'auto-load-next-post' ).' ' . wp_kses_post( $description ) . ' '.wp_kses_post( $description ).' ' . $tip . ' '.$tip.'
' );
- initialise_Scrollspy();
+ // Initialise Scrollspy
+ initialise_scrollspy();
+
+ // Initialise History
+ initialise_history();
+}); // END document()
- initialise_History();
-});
+function initialise_scrollspy() {
+ scrollspy();
+} // END initialise_scrollspy()
-function initialise_Scrollspy() {
- // Spy on post-divider - changes the URL in browser location, loads new post
- jQuery('.post-divider').on('scrollSpy:exit', changeURL );
+function initialise_history() {
+ history();
+} // END initialise_history()
+
+function scrollspy() {
+ // Spy on post-divider - changes the URL in browser location, loads new post
+ jQuery('.post-divider').on('scrollSpy:exit', changeURL );
jQuery('.post-divider').on('scrollSpy:enter', changeURL );
jQuery('.post-divider').scrollSpy();
-}
+} // END scrollspy()
-function initialise_History() {
+function history(){
// Bind to StateChange Event
History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate
var State = History.getState(); // Note: We are using History.getState() instead of event.state
@@ -43,7 +57,7 @@ function initialise_History() {
window.location.reload(State.url);
}
});
-}
+} // END history()
function changeURL() {
var el = jQuery(this);
@@ -52,34 +66,81 @@ function changeURL() {
var offset = el.offset();
var scrollTop = jQuery(document).scrollTop();
- // If exiting or entering from top, change URL
- if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url) {
+ // If exiting or entering from top, change URL
+ if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url ) {
curr_url = this_url;
History.pushState(null, null, this_url);
window.document.title = this_title;
- if( auto_load_next_post_params.alnp_google_analytics == 'yes' ) {
- console.log( 'Google Analytics Tracked' );
+ if ( track_pageviews == 'yes' ) {
+ console.log( 'Google Analytics Tracking Enabled' );
update_google_analytics();
- }
+ } // END if track_pageviews
}
auto_load_next_post();
-}
-function updategoogle_analytics() {
- if( typeof ga === 'undefined' ) {
+} // END changeURL()
+
+/**
+ * This function tracks the page views using Google Analytics.
+ *
+ * It will first detect if Google Analytics is installed before
+ * attempting to send a pageview.
+ *
+ * The tracker detects both classic and universal tracking methods.
+ *
+ * Also supports Google Analytics by Yoast should it be used.
+ */
+function update_google_analytics() {
+ if ( typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) {
+ console.error( 'Google Analytics is not installed!' );
return;
}
- ga('send', 'pageview', window.location.pathname);
-}
+ var track_page_url = window.location.pathname;
+ console.log( 'Track: ' + track_page_url );
+
+ // This uses Asynchronous version of Google Analytics tracking method.
+ if ( typeof pageTracker !== "undefined" && pageTracker !== null ) {
+ console.log( 'Google Analytics is installed, but old.' );
+ pageTracker._trackPageview( track_page_url );
+ }
+
+ // This uses Google's classic Google Analytics tracking method.
+ if ( typeof _gaq !== 'undefined' && _gaq !== null ) {
+ console.log( 'Google Analytics is installed. Yahoo!' );
+ _gaq.push(['_trackPageview', track_page_url]);
+ }
+
+ // This uses Google Analytics Universal Analytics tracking method.
+ if ( typeof ga !== 'undefined' && _ga !== null ) {
+ console.log( 'Google Analytics Universal Analytics is installed. Yahoo!' );
+ ga('send', 'pageview', track_page_url);
+ }
+
+ // This uses Yoast's method of tracking Google Analytics.
+ if ( typeof __gaTracker !== 'undefined' && __gaTracker !== null ) {
+ console.log( 'Google Analytics by Yoast is installed. Awesome!' );
+ __gaTracker('send', 'pageview', track_page_url);
+ }
+} // END update_google_analytics()
+/**
+ * This is the main function.
+ */
function auto_load_next_post() {
// Grab the url for the next post
var post_url = jQuery('a[rel="prev"]').attr('href');
- console.log( 'Next Post URL: ' + post_url );
+ // For some browsers, `post_url` is undefined; for others,
+ // `post_url` is false. So we check for both possibilites.
+ if ( typeof post_url !== typeof undefined && post_url !== false ) {
+ console.log( 'Post URL was defined. All is good.' );
+ console.log( 'Next Post URL: ' + post_url );
+ } else {
+ console.error( 'Post URL was not defined. Oh dear!' );
+ }
if ( !post_url ) return;
@@ -89,7 +150,7 @@ function auto_load_next_post() {
} else {
var partial_endpoint = 'partial/';
- if( post_url.charAt(post_url.length - 1) != '/')
+ if ( post_url.charAt(post_url.length - 1) != '/' )
partial_endpoint = '/' + partial_endpoint;
np_url = post_url + partial_endpoint;
@@ -97,10 +158,12 @@ function auto_load_next_post() {
// Remove the post navigation HTML once the next post has loaded.
jQuery( nav_container ).remove();
- console.log( 'Post Navigation Removed!' );
+ if ( jQuery( nav_container ).length <= 0 ) {
+ console.log( 'Post Navigation Removed!' );
+ }
- jQuery.get( np_url , function( data ) {
- var post = jQuery("
'+b),e=d.find(post_title_selector);console.log("Post Title: "+e.text()),jQuery(content_container).append(d),jQuery('hr[data-url="'+a+'"]').attr("data-title",e.text()).css("display","inline-block"),initialise_Scrollspy()})}}var content_container=auto_load_next_post_params.alnp_content_container,nav_container=auto_load_next_post_params.alnp_navigation_container,comments_container=auto_load_next_post_params.alnp_comments_container,post_title_selector=auto_load_next_post_params.alnp_title_selector,curr_url=window.location.href;jQuery.noConflict(),jQuery(document).ready(function(){window.location.href.indexOf("#comments")>-1||(console.log("Remove Comments: "+auto_load_next_post_params.alnp_remove_comments),"yes"===auto_load_next_post_params.alnp_remove_comments&&jQuery(comments_container).remove(),jQuery(content_container).prepend('
'),initialise_Scrollspy(),initialise_History())});
\ No newline at end of file
+function initialise_scrollspy(){scrollspy()}function initialise_history(){history()}function scrollspy(){jQuery(".post-divider").on("scrollSpy:exit",changeURL),jQuery(".post-divider").on("scrollSpy:enter",changeURL),jQuery(".post-divider").scrollSpy()}function history(){History.Adapter.bind(window,"statechange",function(){var a=History.getState();a.url!=curr_url&&window.location.reload(a.url)})}function changeURL(){var a=jQuery(this),b=a.attr("data-url"),c=a.attr("data-title"),d=a.offset(),e=jQuery(document).scrollTop();d.top-e<150&&curr_url!=b&&(curr_url=b,History.pushState(null,null,b),window.document.title=c,"yes"==track_pageviews&&(console.log("Google Analytics Tracking Enabled"),update_google_analytics())),auto_load_next_post()}function update_google_analytics(){if("undefined"===typeof pageTracker||"undefined"===typeof _gaq||"undefined"===typeof ga||"undefined"===typeof __gaTracker)return void console.error("Google Analytics is not installed!");var a=window.location.pathname;console.log("Track: "+a),"undefined"!==typeof pageTracker&&null!==pageTracker&&(console.log("Google Analytics is installed, but old."),pageTracker._trackPageview(a)),"undefined"!==typeof _gaq&&null!==_gaq&&(console.log("Google Analytics is installed. Yahoo!"),_gaq.push(["_trackPageview",a])),"undefined"!==typeof ga&&null!==_ga&&(console.log("Google Analytics Universal Analytics is installed. Yahoo!"),ga("send","pageview",a)),"undefined"!==typeof __gaTracker&&null!==__gaTracker&&(console.log("Google Analytics by Yoast is installed. Awesome!"),__gaTracker("send","pageview",a))}function auto_load_next_post(){var a=jQuery('a[rel="prev"]').attr("href");if("undefined"!==typeof a&&a!==!1?(console.log("Post URL was defined. All is good."),console.log("Next Post URL: "+a)):console.error("Post URL was not defined. Oh dear!"),a){if(a.indexOf("?p=")>-1)np_url=a+"&partial=1";else{var b="partial/";"/"!=a.charAt(a.length-1)&&(b="/"+b),np_url=a+b}jQuery(nav_container).remove(),jQuery(nav_container).length<=0&&console.log("Post Navigation Removed!"),jQuery.get(np_url,function(b){var c=jQuery("
'+b),e=d.find(post_title_selector);console.log("Post Title: "+e.text()),jQuery(content_container).append(d),jQuery('hr[data-url="'+a+'"]').attr("data-title",e.text()).css("display","inline-block"),scrollspy()})}}var content_container=auto_load_next_post_params.alnp_content_container,post_title_selector=auto_load_next_post_params.alnp_title_selector,nav_container=auto_load_next_post_params.alnp_navigation_container,comments_container=auto_load_next_post_params.alnp_comments_container,remove_comments=auto_load_next_post_params.alnp_remove_comments,track_pageviews=auto_load_next_post_params.alnp_google_analytics,curr_url=window.location.href;jQuery.noConflict(),jQuery(document).ready(function(){window.location.href.indexOf("#comments")>-1||("yes"===remove_comments&&(jQuery(comments_container).remove(),jQuery(comments_container).length<=0&&console.log("Comments Removed")),jQuery(content_container).prepend('
'),initialise_scrollspy(),initialise_history())});
diff --git a/assets/js/chosen/chosen.jquery.js b/assets/js/libs/chosen/chosen.jquery.js
similarity index 100%
rename from assets/js/chosen/chosen.jquery.js
rename to assets/js/libs/chosen/chosen.jquery.js
diff --git a/assets/js/chosen/chosen.jquery.min.js b/assets/js/libs/chosen/chosen.jquery.min.js
similarity index 100%
rename from assets/js/chosen/chosen.jquery.min.js
rename to assets/js/libs/chosen/chosen.jquery.min.js
diff --git a/assets/js/jquery-tiptip/jquery.tipTip.js b/assets/js/libs/jquery-tiptip/jquery.tipTip.js
similarity index 100%
rename from assets/js/jquery-tiptip/jquery.tipTip.js
rename to assets/js/libs/jquery-tiptip/jquery.tipTip.js
diff --git a/assets/js/jquery-tiptip/jquery.tipTip.min.js b/assets/js/libs/jquery-tiptip/jquery.tipTip.min.js
similarity index 100%
rename from assets/js/jquery-tiptip/jquery.tipTip.min.js
rename to assets/js/libs/jquery-tiptip/jquery.tipTip.min.js
diff --git a/assets/js/frontend/jquery.history.js b/assets/js/libs/jquery.history.js
similarity index 100%
rename from assets/js/frontend/jquery.history.js
rename to assets/js/libs/jquery.history.js
diff --git a/assets/js/frontend/scrollspy.js b/assets/js/libs/scrollspy.js
similarity index 100%
rename from assets/js/frontend/scrollspy.js
rename to assets/js/libs/scrollspy.js
diff --git a/assets/js/frontend/scrollspy.min.js b/assets/js/libs/scrollspy.min.js
similarity index 100%
rename from assets/js/frontend/scrollspy.min.js
rename to assets/js/libs/scrollspy.min.js
diff --git a/auto-load-next-post.php b/auto-load-next-post.php
index cdd3773..9fc9ed4 100644
--- a/auto-load-next-post.php
+++ b/auto-load-next-post.php
@@ -1,9 +1,9 @@
setup_constants();
+ self::$_instance->load_plugin_textdomain();
+ self::$_instance->includes();
}
return self::$_instance;
} // END instance()
@@ -203,7 +81,7 @@ public static function instance() {
*/
public function __clone() {
// Cloning instances of the class is forbidden
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), $this->version );
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION );
} // END __clone()
/**
@@ -215,7 +93,7 @@ public function __clone() {
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), $this->version );
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION );
} // END __wakeup()
/**
@@ -223,7 +101,6 @@ public function __wakeup() {
*
* @since 1.0.0
* @access public
- * @return void
*/
public function __construct() {
// Auto-load classes on demand
@@ -232,70 +109,11 @@ public function __construct() {
spl_autoload_register( array( $this, 'autoload' ) );
- // Define constants
- $this->define_constants();
-
- // Check plugin requirements
- $this->check_requirements();
-
- // Include required files
- $this->includes();
-
// Hooks
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) );
- add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
- add_action( 'init', array( $this, 'init_auto_load_next_post' ), 0 );
- add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_and_styles' ) );
-
- // Loaded action
- do_action( 'auto_load_next_post_loaded' );
+ add_action( 'init', array( $this, 'init_auto_load_next_post' ), 0 );
+ add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_and_styles' ) );
} // END __construct()
- /**
- * Plugin action links.
- *
- * @since 1.0.0
- * @access public
- * @param mixed $links
- * @return void
- */
- public function action_links( $links ) {
- if( current_user_can( $this->manage_plugin ) ) {
- $plugin_links = array(
- '' . __( 'Settings', 'auto-load-next-post' ) . '',
- '' . __( 'Support', 'auto-load-next-post' ) . ''
- );
-
- return array_merge( $plugin_links, $links );
- }
- return $links;
- } // END action_links()
-
- /**
- * Plugin row meta links
- *
- * @filter auto_load_next_post_about_text_link
- * @filter auto_load_next_post_documentation_url
- * @since 1.0.0
- * @access public
- * @param array $input already defined meta links
- * @param string $file plugin file path and name being processed
- * @return array $input
- */
- public function plugin_row_meta( $input, $file ) {
- if ( plugin_basename( __FILE__ ) !== $file ) {
- return $input;
- }
-
- $links = array(
- '' . __( 'Documentation', 'auto-load-next-post' ) . '',
- );
-
- $input = array_merge( $input, $links );
-
- return $input;
- } // END plugin_row_meta()
-
/**
* Auto-load Auto Load Next Post classes on demand to reduce memory consumption.
*
@@ -306,80 +124,54 @@ public function plugin_row_meta( $input, $file ) {
*/
public function autoload( $class ) {
$path = null;
- $file = strtolower( 'class-' . str_replace( '_', '-', $class ) ) . '.php';
+ $file = strtolower( 'class-'.str_replace( '_', '-', $class ) ).'.php';
if ( strpos( $class, 'auto_load_next_post_admin' ) === 0 ) {
- $path = $this->plugin_path() . '/includes/admin/';
+ $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/admin/';
+ } else if ( strpos( $class, 'auto_load_next_post_' ) === 0 ) {
+ $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/';
}
- if ( $path && is_readable( $path . $file ) ) {
- include_once( $path . $file );
- return;
- }
-
- // Fallback
- if ( strpos( $class, 'auto_load_next_post_' ) === 0 ) {
- $path = $this->plugin_path() . '/includes/';
- }
-
- if ( $path && is_readable( $path . $file ) ) {
- include_once( $path . $file );
- return;
+ if ( $path !== null && is_readable( $path.$file ) ) {
+ include_once( $path.$file );
+ return true;
}
} // END autoload()
/**
- * Define Constants
+ * Setup Constants
*
- * @since 1.0.0
+ * @since 1.4.3
* @access private
*/
- private function define_constants() {
- if ( ! defined( 'AUTO_LOAD_NEXT_POST' ) ) define( 'AUTO_LOAD_NEXT_POST', $this->name );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_FILE' ) ) define( 'AUTO_LOAD_NEXT_POST_FILE', __FILE__ );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_VERSION' ) ) define( 'AUTO_LOAD_NEXT_POST_VERSION', $this->version );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE' ) ) define( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', $this->wp_version_min );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_SCREEN_ID' ) ) define( 'AUTO_LOAD_NEXT_POST_SCREEN_ID', 'auto-load-next-post-settings' );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_SLUG' ) ) define( 'AUTO_LOAD_NEXT_POST_SLUG', $this->plugin_slug );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_TEXT_DOMAIN' ) ) define( 'AUTO_LOAD_NEXT_POST_TEXT_DOMAIN', $this->text_domain );
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_DEFAULT_SETTINGS_TAB' ) ) define( 'AUTO_LOAD_NEXT_POST_DEFAULT_SETTINGS_TAB', 'general');
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI' ) ) define( 'AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI', $this->github_repo_url );
+ private function setup_constants() {
+ $this->define( 'AUTO_LOAD_NEXT_POST_VERSION', '1.4.3' );
+ $this->define( 'AUTO_LOAD_NEXT_POST_FILE', __FILE__ );
+ $this->define( 'AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post' );
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
- if ( ! defined( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE' ) ) define( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix );
+ $this->define( 'AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
+ $this->define( 'AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
+ $this->define( 'AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/' );
- } // END define_constants()
+ $this->define( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.0' );
+
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+ $this->define( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix );
+ } // END setup_constants()
/**
- * Checks that the WordPress setup meets the plugin requirements.
+ * Define constant if not already set.
*
- * @since 1.0.0
+ * @param string $name
+ * @param string|bool $value
* @access private
- * @global string $wp_version
- * @return bool
+ * @since 1.4.3
*/
- private function check_requirements() {
- global $wp_version;
-
- if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) {
- add_action( 'admin_notices', array( $this, 'display_req_notice' ) );
- return false;
+ private function define( $name, $value ) {
+ if ( ! defined( $name ) ) {
+ define( $name, $value );
}
-
- return true;
- } // END check_requirements()
-
- /**
- * Display the requirement notice.
- *
- * @since 1.0.0
- * @access static
- */
- static function display_req_notice() {
- echo '' . esc_html( $value['title'] ) . '
';
+ echo ''.esc_html( $value['title'] ).'
';
}
if ( ! empty( $value['desc'] ) ) {
@@ -280,7 +277,7 @@ public static function output_fields( $options ) {
echo ''. "\n\n";
if ( ! empty( $value['id'] ) ) {
- do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) );
+ do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ) );
}
break;
@@ -289,13 +286,13 @@ public static function output_fields( $options ) {
case 'sectionend':
if ( ! empty( $value['id'] ) ) {
- do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_end' );
+ do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_end' );
}
echo '
';
if ( ! empty( $value['id'] ) ) {
- do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_after' );
+ do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_after' );
}
break;
@@ -313,7 +310,7 @@ public static function output_fields( $options ) {
if ( $value['type'] == 'color' ) {
$type = 'text';
$value['class'] .= 'colorpick';
- $description .= '';
+ $description .= '';
}
?>
"
?>
@@ -486,7 +483,7 @@ class=""
× px
-
+
"
// Default: run an action
default:
- do_action( 'auto_load_next_post_admin_field_' . $value['type'], $value );
+ do_action( 'auto_load_next_post_admin_field_'.$value['type'], $value );
break;
} // end switch
@@ -626,7 +623,7 @@ public static function save_fields( $options, $current_tab, $current_section = '
// Custom handling
default :
- do_action( 'auto_load_next_post_update_option_' . $type, $value );
+ do_action( 'auto_load_next_post_update_option_'.$type, $value );
break;
@@ -673,10 +670,10 @@ public static function save_fields( $options, $current_tab, $current_section = '
// Save all options as an array. Ready for export.
if ( empty( $current_section ) ) {
- update_option( 'auto_load_next_post_options_' . $current_tab, $update_options );
+ update_option( 'auto_load_next_post_options_'.$current_tab, $update_options );
}
else {
- update_option( 'auto_load_next_post_options_' . $current_tab . '_' . $current_section, $update_options );
+ update_option( 'auto_load_next_post_options_'.$current_tab.'_'.$current_section, $update_options );
}
return true;
diff --git a/includes/admin/class-auto-load-next-post-admin.php b/includes/admin/class-auto-load-next-post-admin.php
index 7a7087a..abaf1e3 100644
--- a/includes/admin/class-auto-load-next-post-admin.php
+++ b/includes/admin/class-auto-load-next-post-admin.php
@@ -28,35 +28,78 @@ class Auto_Load_Next_Post_Admin {
*/
public function __construct() {
// Actions
- add_action( 'init', array( $this, 'includes' ), 0 );
- add_action( 'admin_init', array( $this, 'register_scripts_and_styles' ), 10 );
+ add_action( 'init', array( $this, 'includes' ), 10 );
+ add_action( 'admin_init', array( $this, 'admin_scripts' ), 100 );
// Filters
- add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
- add_filter( 'update_footer', array( $this, 'update_footer' ), 15 );
+ add_filter( 'plugin_action_links_'.plugin_basename( AUTO_LOAD_NEXT_POST_FILE ), array( $this, 'action_links' ) );
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
+ add_filter( 'update_footer', array( $this, 'update_footer' ), 15 );
} // END __construct()
+ /**
+ * Plugin action links.
+ *
+ * @since 1.0.0
+ * @access public
+ * @param mixed $links
+ * @return void
+ */
+ public function action_links( $links ) {
+ if ( current_user_can( 'manage_options' ) ) {
+ $plugin_links = array(
+ ''.__( 'Upgrade to Premium', 'auto-load-next-post' ).'',
+ ''.__( 'Settings', 'auto-load-next-post' ).'',
+ ''.__( 'Support', 'auto-load-next-post' ).'',
+ );
+
+ return array_merge( $plugin_links, $links );
+ }
+
+ return $links;
+ } // END action_links()
+
+ /**
+ * Plugin row meta links
+ *
+ * @since 1.0.0
+ * @access public
+ * @param array $input already defined meta links
+ * @param string $file plugin file path and name being processed
+ * @return array $input
+ */
+ public function plugin_row_meta( $input, $file ) {
+ if ( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) !== $file ) {
+ return $input;
+ }
+
+ $links = array(
+ ''.__( 'Documentation', 'auto-load-next-post' ).'',
+ ''.__( 'Community Support', 'auto-load-next-post' ).''
+ );
+
+ $input = array_merge( $input, $links );
+
+ return $input;
+ } // END plugin_row_meta()
+
/**
* Include any classes we need within admin.
*
* @since 1.0.0
* @access public
- * @filter auto_load_next_post_enable_admin_help_tab
*/
public function includes() {
- // Functions
- include( 'auto-load-next-post-admin-functions.php' );
+ // The plugin checks requirements on activation before it does other stuff.
+ include_once( 'class-auto-load-next-post-admin-activation.php' );
// Classes we only need if the ajax is not-ajax
- if ( ! auto_load_next_post_is_ajax() ) {
- // Main Plugin
- include( 'class-auto-load-next-post-admin-menus.php' );
- include( 'class-auto-load-next-post-admin-notices.php' );
-
- // Plugin Help
- if ( apply_filters( 'auto_load_next_post_enable_admin_help_tab', true ) ) {
- include( 'class-auto-load-next-post-admin-help.php' );
- }
+ if ( !auto_load_next_post_is_ajax() ) {
+ include( 'class-auto-load-next-post-install.php' ); // Install Plugin
+ include( 'class-auto-load-next-post-admin-menus.php' ); // Plugin Menu
+ include( 'class-auto-load-next-post-admin-notices.php' ); // Plugin Notices
+ include( 'class-auto-load-next-post-admin-help.php' ); // Plugin Help Tab
}
} // END includes()
@@ -66,30 +109,25 @@ public function includes() {
*
* @since 1.0.0
* @access public
- * @filter auto_load_next_post_admin_params
*/
- public function register_scripts_and_styles() {
- Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_admin_script', '/assets/js/admin/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version );
-
+ public function admin_scripts() {
+ // Auto Load Next Post Main Javascript
+ Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_script', '/assets/js/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION );
// Chosen
- Auto_Load_Next_Post()->load_file( 'chosen', '/assets/js/chosen/chosen.jquery' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version );
-
+ Auto_Load_Next_Post::load_file( 'chosen', '/assets/js/libs/chosen/chosen.jquery'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION );
// TipTip
- Auto_Load_Next_Post()->load_file( 'jquery-tiptip', '/assets/js/jquery-tiptip/jquery.tipTip' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version );
-
+ Auto_Load_Next_Post::load_file( 'jquery-tiptip', '/assets/js/libs/jquery-tiptip/jquery.tipTip'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION );
// Variables for Admin JavaScripts
- wp_localize_script( Auto_Load_Next_Post()->plugin_slug . '_admin_script', 'auto_load_next_post_admin_params', apply_filters( 'auto_load_next_post_admin_params', array(
- 'plugin_url' => Auto_Load_Next_Post()->plugin_url(),
+ wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG.'_admin_script', 'auto_load_next_post_admin_params', array(
+ //'plugin_url' => Auto_Load_Next_Post::plugin_url(),
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ),
- 'plugin_screen_id' => AUTO_LOAD_NEXT_POST_SCREEN_ID,
- ) ) );
+ //'plugin_screen_id' => AUTO_LOAD_NEXT_POST_SCREEN_ID,
+ ) );
// Stylesheets
- Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_admin_style', '/assets/css/admin/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' );
-
- Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_chosen_style', '/assets/css/chosen' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' );
-
- } // END register_scripts_and_styles()
+ Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_style', '/assets/css/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' );
+ Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_chosen_style', '/assets/css/libs/chosen'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' );
+ } // END admin_scripts()
/**
* Filters the admin footer text by placing links
@@ -99,24 +137,23 @@ public function register_scripts_and_styles() {
* @since 1.0.0
* @access public
* @param $text
- * @filter auto_load_next_post_admin_footer_review_text
* @return string
*/
public function admin_footer_text( $text ) {
$screen = get_current_screen();
- if ( in_array( $screen->id, auto_load_next_post_get_screen_ids() ) ) {
+ if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) {
- $links = apply_filters( 'auto_load_next_post_admin_footer_text_links', array(
- Auto_Load_Next_Post()->web_url . '?utm_source=wpadmin&utm_campaign=footer' => __( 'Website', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- Auto_Load_Next_Post()->doc_url . '?utm_source=wpadmin&utm_campaign=footer' => __( 'Documentation', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- ) );
+ $links = array(
+ 'http://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Website', 'auto-load-next-post' ),
+ 'https://github.com/seb86/Auto-Load-Next-Post/wiki/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Documentation', 'auto-load-next-post' ),
+ );
$text = '';
$counter = 0;
foreach ( $links as $key => $value ) {
- $text .= '' . $value . '';
+ $text .= ''.$value.'';
if( count( $links ) > 1 && count( $links ) != $counter ) {
$text .= ' | ';
@@ -125,9 +162,7 @@ public function admin_footer_text( $text ) {
}
// Rating and Review
- if ( apply_filters( 'auto_load_next_post_admin_footer_review_text', true ) ) {
- $text .= sprintf( __( 'If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, Auto_Load_Next_Post()->wp_plugin_review_url );
- }
+ $text .= sprintf( __( 'If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform' );
return $text;
}
@@ -144,29 +179,28 @@ public function admin_footer_text( $text ) {
* @since 1.0.0
* @access public
* @param $text
- * @filter auto_load_next_post_update_footer_links
* @return string $text
*/
public function update_footer( $text ) {
$screen = get_current_screen();
- if ( in_array( $screen->id, auto_load_next_post_get_screen_ids() ) ) {
+ if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) {
$text = '';
- $links = apply_filters( 'auto_load_next_post_update_footer_links', array(
- AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=footer' => __( 'Contribute', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'issues?state=open&utm_source=wpadmin&utm_campaign=footer' => __( 'Report Bugs', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- ) );
+ $links = array(
+ 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Contribute', 'auto-load-next-post' ),
+ 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open&utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Report Bugs', 'auto-load-next-post' ),
+ );
foreach( $links as $key => $value ) {
- $text .= '' . $value . '';
+ $text .= ''.$value.'';
}
- $text .= '' . '
-
+
'. - sprintf( __( '%s Version', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name ). - ' : ' . esc_attr( Auto_Load_Next_Post()->version ) . '
'; + sprintf( __( '%s Version', 'auto-load-next-post' ), 'Auto Load Next Post' ). + ' : '.esc_attr( AUTO_LOAD_NEXT_POST_VERSION ).''; return $text; } diff --git a/includes/admin/class-auto-load-next-post-install.php b/includes/admin/class-auto-load-next-post-install.php index f7dfeb5..4250b53 100644 --- a/includes/admin/class-auto-load-next-post-install.php +++ b/includes/admin/class-auto-load-next-post-install.php @@ -27,9 +27,7 @@ class Auto_Load_Next_Post_Install { * @access public */ public function __construct() { - register_activation_hook( AUTO_LOAD_NEXT_POST_FILE, array( $this, 'install' ) ); register_deactivation_hook( AUTO_LOAD_NEXT_POST_FILE, array( $this, 'deactivate' ) ); - } // END __construct() /** @@ -42,7 +40,7 @@ public function install() { $this->create_options(); // Add plugin version - update_option( 'auto_load_next_post_version', Auto_Load_Next_Post()->version ); + update_option( 'auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION ); } // END install() /** diff --git a/includes/admin/settings/class-auto-load-next-post-settings-general.php b/includes/admin/settings/class-auto-load-next-post-settings-general.php index f91a87c..12036d0 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-general.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-general.php @@ -28,12 +28,12 @@ class Auto_Load_Next_Post_Settings_General_Tab extends Auto_Load_Next_Post_Setti */ public function __construct() { $this->id = 'general'; - $this->label = __( 'General', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ); + $this->label = __( 'General', 'auto-load-next-post' ); - add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'auto_load_next_post_settings_' . $this->id, array( $this, 'output' ) ); - add_action( 'auto_load_next_post_settings_save_' . $this->id, array( $this, 'save' ) ); + add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); + add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); + add_action( 'auto_load_next_post_settings_'.$this->id, array( $this, 'output' ) ); + add_action( 'auto_load_next_post_settings_save_'.$this->id, array( $this, 'save' ) ); } // END __construct() /** @@ -49,7 +49,7 @@ public function save() { $settings = $this->get_settings(); Auto_Load_Next_Post_Admin_Settings::save_fields( $settings, $current_tab ); - } + } // END save() /** * Get post types @@ -64,7 +64,7 @@ public function get_post_types() { $post_types = get_post_types( array( 'public' => true ), 'names' ); return $post_types; - } + } // END get_post_types() /** * Get settings array @@ -74,18 +74,18 @@ public function get_post_types() { * @return array */ public function get_settings() { - return apply_filters( 'auto_load_next_post_' . $this->id . '_settings', array( + return apply_filters( 'auto_load_next_post_'.$this->id.'_settings', array( array( - 'title' => __( 'Information', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Information', 'auto-load-next-post' ), 'type' => 'title', - 'desc' => __( 'For the plugin to work you need to set the variables below.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'id' => $this->id . '_options' + 'desc' => __( 'For the plugin to work you need to set the variables below.', 'auto-load-next-post' ), + 'id' => $this->id.'_options' ), array( - 'title' => __( 'Restrict Post Types', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Select which post types you wish to load automatically.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Restrict Post Types', 'auto-load-next-post' ), + 'desc' => __( 'Select which post types you wish to load automatically.', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_get_post_types', 'class' => 'chosen-select', @@ -97,30 +97,19 @@ public function get_settings() { ), array( - 'title' => __( 'Content Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example:div.single
', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Content Container', 'auto-load-next-post' ),
+ 'desc' => __( 'Example: main.site-main
', 'auto-load-next-post' ),
'desc_tip' => true,
'id' => 'auto_load_next_post_content_container',
- 'default' => 'div.single',
+ 'default' => 'main.site-main',
'type' => 'text',
'css' => 'min-width:300px;',
'autoload' => false
),
- /*array(
- 'title' => __( 'Post ID Selector', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Example: article
', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc_tip' => true,
- 'id' => 'auto_load_next_post_id_selector',
- 'default' => 'article',
- 'type' => 'text',
- 'css' => 'min-width:300px;',
- 'autoload' => false
- ),*/
-
array(
- 'title' => __( 'Post Title Selector', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Example: h1.entry-title
', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Post Title Selector', 'auto-load-next-post' ),
+ 'desc' => __( 'Example: h1.entry-title
', 'auto-load-next-post' ),
'desc_tip' => true,
'id' => 'auto_load_next_post_title_selector',
'default' => 'h1.entry-title',
@@ -130,8 +119,8 @@ public function get_settings() {
),
array(
- 'title' => __( 'Post Navigation Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Example: nav.post-navigation
', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Post Navigation Container', 'auto-load-next-post' ),
+ 'desc' => __( 'Example: nav.post-navigation
', 'auto-load-next-post' ),
'desc_tip' => true,
'id' => 'auto_load_next_post_navigation_container',
'default' => 'nav.post-navigation',
@@ -141,8 +130,8 @@ public function get_settings() {
),
array(
- 'title' => __( 'Comments Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Example: div#comments
', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Comments Container', 'auto-load-next-post' ),
+ 'desc' => __( 'Example: div#comments
', 'auto-load-next-post' ),
'desc_tip' => true,
'id' => 'auto_load_next_post_comments_container',
'default' => 'div#comments',
@@ -152,35 +141,43 @@ public function get_settings() {
),
array(
- 'title' => __( 'Remove Comments', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Enable to remove comments when each post loads.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Remove Comments', 'auto-load-next-post' ),
+ 'desc' => __( 'Enable to remove comments when each post loads.', 'auto-load-next-post' ),
'id' => 'auto_load_next_post_remove_comments',
'default' => 'yes',
'type' => 'checkbox'
),
array(
- 'title' => __( 'Update Google Analytics', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'Enable to update your Google Analytics each time a post is automatically loaded.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Update Google Analytics', 'auto-load-next-post' ),
+ 'desc' => __( 'Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page.', 'auto-load-next-post' ),
'id' => 'auto_load_next_post_google_analytics',
'default' => 'no',
'type' => 'checkbox'
),
array(
- 'title' => __( 'Remove all data on uninstall?', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
- 'desc' => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ),
+ 'title' => __( 'Reset all data?', 'auto-load-next-post' ),
+ 'desc' => __( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ),
+ 'id' => 'auto_load_next_post_uninstall_data',
+ 'default' => 'no',
+ 'type' => 'reset_data'
+ ),
+
+ array(
+ 'title' => __( 'Remove all data on uninstall?', 'auto-load-next-post' ),
+ 'desc' => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ),
'id' => 'auto_load_next_post_uninstall_data',
'default' => 'no',
'type' => 'checkbox'
),
- array( 'type' => 'sectionend', 'id' => $this->id . '_options'),
+ array( 'type' => 'sectionend', 'id' => $this->id.'_options'),
)); // End general settings
- }
+ } // END get_settings()
}
-} // end if class exists
+} // END if class exists
return new Auto_Load_Next_Post_Settings_General_Tab();
diff --git a/includes/admin/settings/class-auto-load-next-post-settings-page.php b/includes/admin/settings/class-auto-load-next-post-settings-page.php
index 3b59d5c..c52a338 100644
--- a/includes/admin/settings/class-auto-load-next-post-settings-page.php
+++ b/includes/admin/settings/class-auto-load-next-post-settings-page.php
@@ -92,7 +92,7 @@ public function output_sections() {
foreach ( $sections as $id => $label ) {
$output .= ''.__( 'As this is a free plugin, I can not provide support.', 'auto-load-next-post' ).'
'. + ''.sprintf( __( 'You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'auto-load-next-post' ), 'https://wordpress.org/support/plugin/auto-load-next-post' ).'
'. + ''.sprintf( __( 'If you want a timely response via email from me, upgrade and then send me an email.', 'auto-load-next-post' ), 'https://www.sebastiendumont.com/plugins/auto-load-next-post/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-alnp' ).'
'. + ''.sprintf( __( 'If you\'ve found a bug, please submit an issue on GitHub.', 'auto-load-next-post' ), 'https://github.com/seb86/Auto-Load-Next-Post/issues' ).'
'. + ''.__( 'Thank you.', 'auto-load-next-post' ).'
'; + } // END callback() + + /** + * Get settings array + * + * @since 1.4.3 + * @access public + * @param $current_section + * @return array + */ + public function get_settings() { + return array( + + array( + 'title' => __( 'Support', 'auto-load-next-post' ), + 'type' => 'title', + 'desc' => $this->callback(), + 'id' => 'auto_load_next_post_support_tab' + ), + + array( + 'type' => 'sectionend', + 'id' => 'auto_load_next_post_support_tab' + ), + + ); + } // END get_settings() +} + +} // END if class exists + +return new Auto_Load_Next_Post_Settings_Support_Tab(); diff --git a/includes/admin/views/html-admin-settings.php b/includes/admin/views/html-admin-settings.php index 100d01c..aa87294 100644 --- a/includes/admin/views/html-admin-settings.php +++ b/includes/admin/views/html-admin-settings.php @@ -4,25 +4,23 @@ */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. ?> -