Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions includes/class-ot-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,23 @@ public function display_page() {
echo '<ul class="ui-tabs-nav">';

// Loop through page sections.
// foreach ( (array) $page['sections'] as $section ) {
// echo '<li id="tab_' . esc_attr( $section['id'] ) . '"><a href="#section_' . esc_attr( $section['id'] ) . '">' . wp_kses_post( $section['title'] ) . '</a></li>';
// }
// }
// Plan-B edit to show group title.
foreach ( (array) $page['sections'] as $section ) {
echo '<li id="tab_' . esc_attr( $section['id'] ) . '"><a href="#section_' . esc_attr( $section['id'] ) . '">' . wp_kses_post( $section['title'] ) . '</a></li>';
if ( isset( $section['group'] ) ) {
if ( isset( $section['group']['title'] ) ) {
echo '<li class="pb-section-group">';
if ( isset( $section['group']['icon'] ) ) {
echo '<i class="' . esc_attr( $section['group']['icon'] ) . '"></i> ';
}
echo esc_attr( $section['group']['title'] ) . '</li>';
}
}
echo '<li id="tab_' . esc_attr( $section['id'] ) . '">';
echo '<a href="#section_' . esc_attr( $section['id'] ) . '">' . wp_kses_post( $section['title'] ) . '</a></li>';
}

echo '</ul>';
Expand Down Expand Up @@ -698,7 +713,7 @@ public function sanitize_callback( $input ) {

foreach ( $current_settings['settings'] as $check_setting ) {

if ( $setting['id'] === $check_setting['id'] && ! empty( $current_options[ $setting['id'] ] ) ) {
if ( isset( $check_setting['id'] ) && $setting['id'] === $check_setting['id'] && ! empty( $current_options[ $setting['id'] ] ) ) {

foreach ( $current_options[ $setting['id'] ] as $key => $value ) {

Expand Down
5 changes: 3 additions & 2 deletions includes/ot-functions-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4718,7 +4718,7 @@ function ot_theme_options_layouts_form() {

echo '<select name="' . esc_attr( ot_layouts_id() ) . '[active_layout]" class="option-tree-ui-select">';

$hidden = '';
$hidden_safe = '';

foreach ( $layouts as $key => $data ) {

Expand Down Expand Up @@ -5057,7 +5057,8 @@ function ot_decode( $value ) {
preg_match( '/a:\d+:{.*?}/', $decoded, $array_matches, PREG_OFFSET_CAPTURE, 0 );

// Search for an object.
preg_match( '/O|C:\+?\d+:"[a-z0-9_]+":\+?\d+:/i', $decoded, $obj_matches, PREG_OFFSET_CAPTURE, 0 );
// preg_match( '/O|C:\+?\d+:"[a-z0-9_]+":\+?\d+:/i', $decoded, $obj_matches, PREG_OFFSET_CAPTURE, 0 );
preg_match( '/O:\d+:"[a-z0-9_]+":\d+:{.*?}/i', $decoded, $obj_matches, PREG_OFFSET_CAPTURE, 0 );

// Prevent object injection or non arrays.
if ( $obj_matches || ! $array_matches ) {
Expand Down