refactor: remove MCI prefixes
This commit is contained in:
parent
2f809f4fe9
commit
58683dd523
14 changed files with 462 additions and 462 deletions
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
abstract class MCI_Footnotes_Layout_Engine {
|
||||
abstract class Footnotes_Layout_Engine {
|
||||
|
||||
/**
|
||||
* Stores the Hook connection string for the child sub page.
|
||||
|
@ -89,7 +89,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
*/
|
||||
protected function add_section( $p_str_id, $p_str_title, $p_int_settings_container_index, $p_bool_has_submit_button = true ) {
|
||||
return array(
|
||||
'id' => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_id,
|
||||
'id' => Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_id,
|
||||
'title' => $p_str_title,
|
||||
'submit' => $p_bool_has_submit_button,
|
||||
'container' => $p_int_settings_container_index,
|
||||
|
@ -108,7 +108,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
*/
|
||||
protected function add_meta_box( $p_str_section_id, $p_str_id, $p_str_title, $p_str_callback_function_name ) {
|
||||
return array(
|
||||
'parent' => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_section_id,
|
||||
'parent' => Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_section_id,
|
||||
'id' => $p_str_id,
|
||||
'title' => $p_str_title,
|
||||
'callback' => $p_str_callback_function_name,
|
||||
|
@ -123,20 +123,20 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
public function register_sub_page() {
|
||||
global $submenu;
|
||||
|
||||
if ( array_key_exists( plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ), $submenu ) ) {
|
||||
foreach ( $submenu[ plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ) ] as $l_arr_sub_menu ) {
|
||||
if ( plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() ) === $l_arr_sub_menu[2] ) {
|
||||
remove_submenu_page( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG, MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() );
|
||||
if ( array_key_exists( plugin_basename( Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ), $submenu ) ) {
|
||||
foreach ( $submenu[ plugin_basename( Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ) ] as $l_arr_sub_menu ) {
|
||||
if ( plugin_basename( Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() ) === $l_arr_sub_menu[2] ) {
|
||||
remove_submenu_page( Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG, Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->a_str_sub_page_hook = add_submenu_page(
|
||||
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
|
||||
Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
|
||||
$this->get_sub_page_title(),
|
||||
$this->get_sub_page_title(),
|
||||
'manage_options',
|
||||
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
|
||||
Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
|
||||
array( $this, 'display_content' )
|
||||
);
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
echo sprintf(
|
||||
'<a class="nav-tab%s" href="?page=%s&t=%s">%s</a>',
|
||||
( $l_str_id === $l_arr_active_section['id'] ) ? ' nav-tab-active' : '',
|
||||
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
|
||||
Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
|
||||
$l_str_id,
|
||||
$l_arr_description['title']
|
||||
);
|
||||
|
@ -310,7 +310,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
|
||||
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
|
||||
|
||||
foreach ( MCI_Footnotes_Settings::instance()->get_defaults( $l_arr_active_section['container'] ) as $l_str_key => $l_mixed_value ) {
|
||||
foreach ( Footnotes_Settings::instance()->get_defaults( $l_arr_active_section['container'] ) as $l_str_key => $l_mixed_value ) {
|
||||
if ( array_key_exists( $l_str_key, $_POST ) ) {
|
||||
$l_arr_new_settings[ $l_str_key ] = wp_unslash( $_POST[ $l_str_key ] );
|
||||
} else {
|
||||
|
@ -319,7 +319,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
}
|
||||
}
|
||||
// Update settings.
|
||||
return MCI_Footnotes_Settings::instance()->save_options( $l_arr_active_section['container'], $l_arr_new_settings );
|
||||
return Footnotes_Settings::instance()->save_options( $l_arr_active_section['container'], $l_arr_new_settings );
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
|
||||
|
||||
|
@ -360,7 +360,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
$p_arr_return = array();
|
||||
$p_arr_return['id'] = sprintf( '%s', $p_str_setting_key_name );
|
||||
$p_arr_return['name'] = sprintf( '%s', $p_str_setting_key_name );
|
||||
$p_arr_return['value'] = esc_attr( MCI_Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
|
||||
$p_arr_return['value'] = esc_attr( Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
|
||||
return $p_arr_return;
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ abstract class MCI_Footnotes_Layout_Engine {
|
|||
'<input type="checkbox" name="%s" id="%s" %s/>',
|
||||
$l_arr_data['name'],
|
||||
$l_arr_data['id'],
|
||||
MCI_Footnotes_Convert::to_bool( $l_arr_data['value'] ) ? 'checked="checked"' : ''
|
||||
Footnotes_Convert::to_bool( $l_arr_data['value'] ) ? 'checked="checked"' : ''
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue