Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Apr 17, 2019
1 parent 90d2a2a commit 3ab833b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/class-wp-rest-widget-areas-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,14 @@ protected function update_sidebar_data( $sidebar_id, $request ) {
}
if ( isset( $request['content'] ) && is_string( $request['content'] ) ) {
$sidebars = wp_get_sidebars_widgets();
$sidebar = $sidebars_items[ $sidebar_id ];
$items = array();
$post_id = wp_insert_post(
$sidebar = $sidebars[ $sidebar_id ];
$post_id = wp_insert_post(
array(
'ID' => is_numeric( $sidebar ) ? $sidebar : 0,
'post_content' => $request['content'],
)
);
if( ! is_numeric( $sidebar ) ) {
if ( ! is_numeric( $sidebar ) ) {
wp_set_sidebars_widgets(
array_merge(
$sidebars,
Expand Down

0 comments on commit 3ab833b

Please sign in to comment.