Add backwards compat fix for new single-stage array

This commit is contained in:
Jay Wood
2016-09-30 14:17:53 -04:00
parent ecb81f4d3a
commit 12db99072a
3 changed files with 18 additions and 2 deletions

View File

@ -86,13 +86,13 @@ class ContentWarning_v2 {
add_action( 'wp_footer', array( $this, 'render_dialog' ) ); add_action( 'wp_footer', array( $this, 'render_dialog' ) );
add_action( 'wp_head', array( $this, 'override_css' ) ); add_action( 'wp_head', array( $this, 'override_css' ) );
if ( ! is_admin() ) { if ( ! is_admin() ) {
} }
$this->plugin_classes(); $this->plugin_classes();
} }
/** /**
* Get Cookie Name * Get Cookie Name
* *

View File

@ -37,6 +37,9 @@ class CWV2_Admin {
* @since 3.6.3 * @since 3.6.3
*/ */
function hooks() { function hooks() {
add_action( 'admin_init', array( $this, 'admin_init' ) );
// Post Meta Box for this. // Post Meta Box for this.
add_action( 'add_meta_boxes', array( $this, 'setup_metabox' ) ); add_action( 'add_meta_boxes', array( $this, 'setup_metabox' ) );
add_action( 'save_post', array( $this, 'cwv3_meta_save' ) ); add_action( 'save_post', array( $this, 'cwv3_meta_save' ) );
@ -59,6 +62,19 @@ class CWV2_Admin {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_script' ) );
} }
/**
* Back compat update
*
* @deprecated Will deprecate a few versions out.
* @author JayWood
*/
public function admin_init() {
$color = get_option( 'cwv3_bg_color', '' );
if ( isset( $color['color'] ) ) {
update_option( 'cwv3_bg_color', $color['color'] );
}
}
/** /**
* Enqueues up the adminisrator scripts/styles * Enqueues up the adminisrator scripts/styles
* *

View File

@ -25,7 +25,7 @@ function cwv3_get_css() {
$opacity = get_option( 'cwv3_bg_opacity', '' ); $opacity = get_option( 'cwv3_bg_opacity', '' );
$bg_image_css = ! empty( $image ) ? 'background: url( '. esc_url( $image ) . ' ) no-repeat top center;' : ''; $bg_image_css = ! empty( $image ) ? 'background: url( '. esc_url( $image ) . ' ) no-repeat top center;' : '';
$bg_color_css = ! empty( $color ) ? 'background-color: ' . $color['color'] . ';' : ''; $bg_color_css = ! empty( $color ) ? 'background-color: ' . $color . ';' : '';
ob_start(); ob_start();
?> ?>