- review edit_field();

This commit is contained in:
Mykyta Synelnikov
2023-06-28 20:56:09 +03:00
parent fcd5854424
commit 6f9109adca
4 changed files with 296 additions and 324 deletions
+13 -5
View File
@@ -171,14 +171,23 @@ if ( ! class_exists( 'UM_Functions' ) ) {
*
* @return string|void
*/
function get_template( $template_name, $basename = '', $t_args = array(), $echo = false ) {
public function get_template( $template_name, $basename = '', $t_args = array(), $echo = false ) {
if ( ! empty( $t_args ) && is_array( $t_args ) ) {
extract( $t_args );
/*
* This use of extract() cannot be removed. There are many possible ways that
* templates could depend on variables that it creates existing, and no way to
* detect and deprecate it.
*
* Passing the EXTR_SKIP flag is the safest option, ensuring globals and
* function variables cannot be overwritten.
*/
// phpcs:ignore WordPress.PHP.DontExtract.extract_extract
extract( $t_args, EXTR_SKIP );
}
$path = '';
if ( $basename ) {
// use '/' instead of "DIRECTORY_SEPARATOR", because wp_normalize_path makes the correct replace
// use '/' instead of "DIRECTORY_SEPARATOR", because wp_normalize_path makes the correct replacement
$array = explode( '/', wp_normalize_path( trim( $basename ) ) );
$path = $array[0];
}
@@ -189,7 +198,6 @@ if ( ! class_exists( 'UM_Functions' ) ) {
return;
}
/**
* UM hook
*
@@ -240,7 +248,7 @@ if ( ! class_exists( 'UM_Functions' ) ) {
* ?>
*/
do_action( 'um_before_template_part', $template_name, $path, $located, $t_args );
include( $located );
include $located;
/**
* UM hook