diff --git a/readme.txt b/readme.txt index e6de0a3..24011d0 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === WooFramework Tweaks === -Contributors: woothemes,mattyza +Contributors: woothemes,mattyza,jeffikus Donate link: http://woothemes.com/ Tags: wooframework,settings Requires at least: 3.9.1 Tested up to: 3.9.1 -Stable tag: 1.0.0 +Stable tag: 1.0.1 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -46,12 +46,24 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi == Upgrade Notice == += 1.0.1 = +* 2014-08-18 +* Adds WF export capabilities +* Adds better descriptions for tweaks options +* Fixes generator removal logic + = 1.0.0 = * 2014-07-03 * Initial release. Woo! == Changelog == += 1.0.1 = +* 2014-08-18 +* Adds WF export capabilities +* Adds better descriptions for tweaks options +* Fixes generator removal logic + = 1.0.0 = * 2014-07-03 * Initial release. Woo! \ No newline at end of file diff --git a/wooframework-tweaks.php b/wooframework-tweaks.php index 6917d9e..d1091f8 100644 --- a/wooframework-tweaks.php +++ b/wooframework-tweaks.php @@ -3,7 +3,7 @@ * Plugin Name: WooFramework Tweaks * Plugin URI: http://github.com/woothemes/wooframework-tweaks/ * Description: Hidey ho, neighborino! Lets add a few options back to the WooFramework, for a bit of extra fine tuning, shall we? - * Version: 1.0.0 + * Version: 1.0.1 * Author: WooThemes * Author URI: http://woothemes.com/ * Requires at least: 3.9.1 @@ -99,7 +99,7 @@ public function __construct () { $this->token = 'wooframework-tweaks'; $this->plugin_url = plugin_dir_url( __FILE__ ); $this->plugin_path = plugin_dir_path( __FILE__ ); - $this->version = '1.0.0'; + $this->version = '1.0.1'; $this->_field_obj = null; register_activation_hook( __FILE__, array( $this, 'install' ) ); @@ -107,6 +107,8 @@ public function __construct () { add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); // We need to run this only once the theme is setup and ready. + add_action( 'after_setup_theme', array( $this, 'init_admin' ) ); + add_action( 'plugins_loaded', array( $this, 'init_frontend' ) ); add_action( 'after_setup_theme', array( $this, 'init' ) ); } // End __construct() @@ -117,6 +119,18 @@ public function __construct () { * @return void */ public function init () { + // Placeholders are in both the frontend and admin, so apply this globally. + add_filter( 'wf_placeholder_image_url', array( $this, 'maybe_override_placeholder_image_url' ) ); + add_filter( 'wf_placeholder_image_path', array( $this, 'maybe_override_placeholder_image_path' ) ); + } // End init() + + /** + * Initialise the plugin admin. + * @access public + * @since 1.0.1 + * @return void + */ + public function init_admin () { if ( is_admin() ) { // Register the admin screen. add_action( 'admin_menu', array( $this, 'register_admin_screen' ) ); @@ -137,17 +151,23 @@ public function init () { // If a super user is specified, apply the filter. add_filter( 'wf_super_user', array( $this, 'maybe_apply_super_user' ) ); - } else { + } // End If Statement + } // End init_admin() + + /** + * Initialise the plugin frontend. + * @access public + * @since 1.0.1 + * @return void + */ + public function init_frontend () { + if ( !is_admin() ) { // Maybe disable the generator tag. - if ( 'true' == get_option( 'framework_woo_disable_generator', 'false' ) ) { + if ( 'true' == get_option( 'framework_woo_disable_generator', 'false' ) ) { add_filter( 'wf_disable_generator_tags', '__return_true' ); } - } - - // Placeholders are in both the frontend and admin, so apply this globally. - add_filter( 'wf_placeholder_image_url', array( $this, 'maybe_override_placeholder_image_url' ) ); - add_filter( 'wf_placeholder_image_path', array( $this, 'maybe_override_placeholder_image_path' ) ); - } // End init() + } // End If Statement + } // End init_frontend() /** * Register the screen ID with the WooFramework's asset loader. @@ -185,6 +205,9 @@ public function register_admin_screen () { // Add contextual help tabs. add_action( 'load-' . $this->admin_page, array( $this, 'admin_screen_help' ) ); + // Make sure our data is added to the WooFramework settings exporter. + add_filter( 'wooframework_export_query_inner', array( $this, 'add_exporter_data' ) ); + // Add admin notices. add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } // End register_admin_screen() @@ -420,19 +443,19 @@ public function get_settings_template () { 'type' => 'text' ), 'framework_woo_disable_generator' => array( - 'desc' => __( 'Disable the "Generator" META tags', 'wooframework-tweaks' ), + 'desc' => __( 'Disable the "Generator" META tags', 'wooframework-tweaks' ) . '

' . __( "Removes the meta tags which show the current theme and WooFramework version in your site's source code.", 'wooframework-tweaks' ) . '

', 'std' => '', 'id' => 'framework_woo_disable_generator', 'type' => 'checkbox' ), 'framework_woo_disable_shortcodes' => array( - 'desc' => __( 'Disable the shortcodes stylesheet', 'wooframework-tweaks' ), + 'desc' => __( 'Disable the shortcodes stylesheet', 'wooframework-tweaks' ) . '

' . __( "Removes the CSS styles for all WooThemes theme shortcodes.", 'wooframework-tweaks' ) . '

', 'std' => '', 'id' => 'framework_woo_disable_shortcodes', 'type' => 'checkbox' ), 'framework_woo_move_tracking_code' => array( - 'desc' => __( 'Output the Tracking Code setting in the Header', 'wooframework-tweaks' ), + 'desc' => __( 'Output the Tracking Code setting in the Header', 'wooframework-tweaks' ) . '

' . __( "Moves the output of your theme's 'Tracking Code' setting from the footer to the header.", 'wooframework-tweaks' ) . '

', 'std' => '', 'id' => 'framework_woo_move_tracking_code', 'type' => 'checkbox' @@ -504,5 +527,26 @@ private function _log_version_number () { // Log the version number. update_option( $this->token . '-version', $this->version ); } // End _log_version_number() + + /** + * Add our saved data to the WooFramework data exporter. + * @access public + * @since 1.0.1 + * @param string $data SQL query. + * @return string SQL query. + */ + public function add_exporter_data ( $data ) { + $option_keys = array( + 'framework_woo_disable_generator', + 'framework_woo_default_image', + 'framework_woo_default_image-id', + 'framework_woo_super_user', + 'framework_woo_last_tweaks_editor', + ); + foreach ( $option_keys as $key ) { + $data .= " OR option_name = '" . $key . "'"; + } // End For Loop + return $data; + } // End add_exporter_data() } // End Class ?> \ No newline at end of file