Use array_keys to prevent error in admin
This commit is contained in:
@@ -91,7 +91,7 @@ class SP_Settings_Page {
|
|||||||
|
|
||||||
$templates = array_merge( array_flip( $layout ), $templates );
|
$templates = array_merge( array_flip( $layout ), $templates );
|
||||||
|
|
||||||
$slice = array_search( 'tabs', array_flip( $templates ) );
|
$slice = array_search( 'tabs', array_keys( $templates ) );
|
||||||
if ( $slice ) {
|
if ( $slice ) {
|
||||||
$templates = array_slice( $templates, 0, $slice );
|
$templates = array_slice( $templates, 0, $slice );
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class SP_Settings_Page {
|
|||||||
|
|
||||||
$templates = array_merge( array_flip( $layout ), $templates );
|
$templates = array_merge( array_flip( $layout ), $templates );
|
||||||
|
|
||||||
$slice = array_search( 'tabs', array_flip( $templates ) );
|
$slice = array_search( 'tabs', array_keys( $templates ) );
|
||||||
if ( $slice ) {
|
if ( $slice ) {
|
||||||
$templates = array_slice( $templates, $slice );
|
$templates = array_slice( $templates, $slice );
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class SP_Template_Loader {
|
|||||||
$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
|
$templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
|
||||||
|
|
||||||
// Split templates into sections and tabs
|
// Split templates into sections and tabs
|
||||||
$slice = array_search( 'tabs', array_flip( $templates ) );
|
$slice = array_search( 'tabs', array_keys( $templates ) );
|
||||||
if ( $slice ) {
|
if ( $slice ) {
|
||||||
$section_templates = array_slice( $templates, 0, $slice );
|
$section_templates = array_slice( $templates, 0, $slice );
|
||||||
$tab_templates = array_slice( $templates, $slice );
|
$tab_templates = array_slice( $templates, $slice );
|
||||||
|
|||||||
Reference in New Issue
Block a user