Skip to content

Commit

Permalink
3.3.1
Browse files Browse the repository at this point in the history
a couple bug fixes
  • Loading branch information
WraithKenny committed May 29, 2015
1 parent 470bc67 commit 4686b80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions includes/class-sns-ajax.php
Expand Up @@ -398,6 +398,7 @@ static function shortcodes() {

// Differs from SnS_Admin_Meta_Box::maybe_set() in that this needs no prefix.
static function maybe_set( $o, $i ) {
if ( ! is_array( $o ) ) return array();
if ( empty( $_REQUEST[ $i ] ) ) {
if ( isset( $o[ $i ] ) ) unset( $o[ $i ] );
} else $o[ $i ] = $_REQUEST[ $i ];
Expand Down
1 change: 1 addition & 0 deletions includes/class-sns-meta-box.php
Expand Up @@ -409,6 +409,7 @@ static function save_post( $post_id ) {
* Filters $o and Checks if the sent data $i is empty (intended to clear). If not, updates.
*/
static function maybe_set( $o, $i, $p = 'SnS_' ) {
if ( ! is_array( $o ) ) return array();
if ( empty( $_REQUEST[ $p . $i ] ) ) {
if ( isset( $o[ $i ] ) ) unset( $o[ $i ] );
} else {
Expand Down
8 changes: 4 additions & 4 deletions js/meta-box.js
Expand Up @@ -483,15 +483,15 @@ jQuery( document ).ready( function( $ ) {
}
initData.style_formats = style_formats;

if ( initData.theme_advanced_buttons2.indexOf( "styleselect" ) == -1 ) {
if ( initData.toolbar2.indexOf( "styleselect" ) == -1 ) {
var tempString = "styleselect,";
initData.theme_advanced_buttons2 = tempString.concat(initData.theme_advanced_buttons2);
initData.toolbar2 = tempString.concat(initData.toolbar2);
}

$( '#delete-mce-dropdown-names', context ).show();
} else {
delete initData.style_formats;
initData.theme_advanced_buttons2 = initData.theme_advanced_buttons2.replace("styleselect,", "");
initData.toolbar2 = initData.toolbar2.replace("styleselect,", "");

$( '#delete-mce-dropdown-names', context ).hide();
}
Expand Down Expand Up @@ -580,7 +580,7 @@ jQuery( document ).ready( function( $ ) {
ed.remove();
if ( initDatas[ed.id] && initDatas[ed.id].wpautop )
$('#'+ed.id).val( switchEditors.wpautop( $('#'+ed.id).val() ) );
ed = new tinymce.Editor( ed.id, initDatas[ed.id] );
ed = new tinymce.Editor( ed.id, initDatas[ed.id], tinymce.EditorManager );
ed.render();
ed.hide();
}
Expand Down

0 comments on commit 4686b80

Please sign in to comment.