$val): if (!is_array($val)): $bx_page_settings[$key] = sanitize_text_field($val); else: foreach($val as $subkey => $subval): if (!is_array($subval)): $bx_page_settings[$key][$subkey] = sanitize_text_field($subval); else: foreach($subval as $sub_subkey => $sub_subval): if (!is_array($sub_subval)): $bx_page_settings[$key][$subkey][$sub_subkey] = sanitize_text_field($sub_subval); else: foreach($sub_subval as $sub_sub_subkey => $sub_sub_subval): if (!is_array($sub_sub_subval)): $bx_page_settings[$key][$subkey][$sub_subkey][$sub_sub_subkey] = sanitize_text_field($sub_sub_subval); else: foreach($sub_sub_subval as $sub_sub_sub_subkey => $sub_sub_sub_subval): $bx_page_settings[$key][$subkey][$sub_subkey][$sub_sub_subkey][$sub_sub_sub_subkey] = sanitize_text_field($sub_sub_sub_subval); endforeach; endif; endforeach; endif; endforeach; endif; endforeach; endif; endforeach; endif; // Update the page settings meta field. update_post_meta( $post_id, '_boxytheme_page_settings', $bx_page_settings ); // Update the post's excerpt and content if Short Description is entered (for SEO purposes). if ($page_excerpt): // Unhook this function so it doesn't loop infinitely remove_action( 'save_post', array( &$this, 'save_page_meta_box' ) ); // Update the post, which calls save_post again wp_update_post( array( 'ID' => $post_id, 'post_excerpt' => $page_excerpt, 'post_content' => $page_excerpt ) ); // Re-hook this function add_action( 'save_post', array( &$this, 'save_page_meta_box' ) ); endif; } /** * Render Meta Box content. * * @param WP_Post $post The post object. */ public function render_page_meta_box( ) { global $post; /* * Output the page meta fields * @since 1.0.0 */ do_action( 'boxytheme_page_fields', $post->ID ); // Add an nonce field so we can check for it later. wp_nonce_field( 'boxytheme_page_custom_box', 'boxytheme_page_custom_box_nonce' ); } } /** * Page Fields */ function boxytheme_render_page_fields( $post_id ) { global $wp_registered_sidebars; $bx_options = wpc_get_settings(); $sidebars = wp_get_sidebars_widgets(); $bx_page_settings = get_post_meta( $post_id, '_boxytheme_page_settings', true); ?>
getArrSliders(); if (!empty($arrSliders)): foreach($arrSliders as $slider): $title = $slider->getTitle(); $alias = $slider->getAlias(); $revSliders[$alias] = $title; endforeach; endif; else: $revSliders = array(); endif; if ( !empty($revSliders) ): ?> esc_html__('Full-Width','boxy-studio'), 'default' => esc_html__('1100px','boxy-studio'), '1000px' => esc_html__('1000px','boxy-studio'), '900px' => esc_html__('900px','boxy-studio'), '800px' => esc_html__('800px','boxy-studio'), '700px' => esc_html__('700px','boxy-studio'), '600px' => esc_html__('600px','boxy-studio') )); if ( isset( $content_options[$default_setting] ) ): $default_setting_array = sprintf( esc_html__('Default (%s)','boxy-studio'), ( $content_options[$default_setting] ? $content_options[$default_setting] : $content_options['default'] ) ); array_unshift( $content_options, $default_setting_array ); unset( $content_options[$default_setting] ); $new_default[$default_setting] = $content_options[0]; unset($content_options[0]); $content_options = $new_default + $content_options; endif; ?> esc_html__('Disabled','boxy-studio'), 'page_banner' => esc_html__('Page Banner w/Title','boxy-studio'), 'page_banner_blank' => esc_html__('Page Banner w/o Title','boxy-studio'), 'inline' => esc_html__('Inline','boxy-studio') ); if ( isset( $thumbnail_layout_options[$default_setting] ) ): $default_setting_array = sprintf( esc_html__('Default (%s)','boxy-studio'), ( $thumbnail_layout_options[$default_setting] ? $thumbnail_layout_options[$default_setting] : $thumbnail_layout_options['page_banner'] ) ); array_unshift( $thumbnail_layout_options, $default_setting_array ); unset( $thumbnail_layout_options[$default_setting] ); $new_default[$default_setting] = $thumbnail_layout_options[0]; unset($thumbnail_layout_options[0]); $thumbnail_layout_options = $new_default + $thumbnail_layout_options; endif; ?>