| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
if ( ! class_exists( 'MywpSettingInit' ) ) : |
| 8 |
|
| 9 |
final class MywpSettingInit { |
| 10 |
|
| 11 |
private static $instance; |
| 12 |
|
| 13 |
private function __construct() {} |
| 14 |
|
| 15 |
public static function get_instance() { |
| 16 |
|
| 17 |
if ( !isset( self::$instance ) ) { |
| 18 |
|
| 19 |
self::$instance = new self(); |
| 20 |
|
| 21 |
} |
| 22 |
|
| 23 |
return self::$instance; |
| 24 |
|
| 25 |
} |
| 26 |
|
| 27 |
private function __clone() {} |
| 28 |
|
| 29 |
private function __wakeup() {} |
| 30 |
|
| 31 |
public static function init() { |
| 32 |
|
| 33 |
add_action( 'mywp_plugins_loaded' , array( __CLASS__ , 'plugins_loaded_include_modules' ) , 20 ); |
| 34 |
|
| 35 |
add_action( 'mywp_after_setup_theme' , array( __CLASS__ , 'after_setup_theme_include_modules' ) , 20 ); |
| 36 |
|
| 37 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_main' ) , 5 ); |
| 38 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_network' ) , 5 ); |
| 39 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_admin' ) , 30 ); |
| 40 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_frontend' ) , 40 ); |
| 41 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_login' ) , 50 ); |
| 42 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_site' ) , 60 ); |
| 43 |
add_filter( 'mywp_setting_menus' , array( __CLASS__ , 'add_setting_menu_debug' ) , 100 ); |
| 44 |
|
| 45 |
add_action( 'mywp_request_admin_manager' , array( __CLASS__ , 'mywp_request_admin_manager' ) ); |
| 46 |
add_action( 'mywp_request_network_admin_manager' , array( __CLASS__ , 'mywp_request_network_admin_manager' ) ); |
| 47 |
|
| 48 |
} |
| 49 |
|
| 50 |
public static function plugins_loaded_include_modules() { |
| 51 |
|
| 52 |
$dir = MYWP_PLUGIN_PATH . 'setting/modules/'; |
| 53 |
|
| 54 |
$includes = array( |
| 55 |
'admin_comments' => $dir . 'mywp.setting.admin.comments.php', |
| 56 |
'admin_dashboard' => $dir . 'mywp.setting.admin.dashboard.php', |
| 57 |
'admin_general' => $dir . 'mywp.setting.admin.general.php', |
| 58 |
'admin_nav_menu' => $dir . 'mywp.setting.admin.nav-menu.php', |
| 59 |
'admin_post_edit' => $dir . 'mywp.setting.admin.post-edit.php', |
| 60 |
'admin_posts' => $dir . 'mywp.setting.admin.posts.php', |
| 61 |
'admin_sidebar' => $dir . 'mywp.setting.admin.sidebar.php', |
| 62 |
'admin_toolbar' => $dir . 'mywp.setting.admin.toolbar.php', |
| 63 |
'admin_uploads' => $dir . 'mywp.setting.admin.uploads.php', |
| 64 |
'admin_user_edit' => $dir . 'mywp.setting.admin.user-edit.php', |
| 65 |
'admin_users' => $dir . 'mywp.setting.admin.users.php', |
| 66 |
'debug_blogs' => $dir . 'mywp.setting.debug.blogs.php', |
| 67 |
'debug_crons' => $dir . 'mywp.setting.debug.crons.php', |
| 68 |
'debug_defines' => $dir . 'mywp.setting.debug.defines.php', |
| 69 |
'debug_find_option' => $dir . 'mywp.setting.debug.find-option.php', |
| 70 |
'debug_general' => $dir . 'mywp.setting.debug.general.php', |
| 71 |
'debug_options' => $dir . 'mywp.setting.debug.options.php', |
| 72 |
'debug_post_types' => $dir . 'mywp.setting.debug.post-types.php', |
| 73 |
'debug_site_options' => $dir . 'mywp.setting.debug.site-options.php', |
| 74 |
'debug_taxonomies' => $dir . 'mywp.setting.debug.taxonomies.php', |
| 75 |
'debug_transients' => $dir . 'mywp.setting.debug.transients.php', |
| 76 |
'debug_translations' => $dir . 'mywp.setting.debug.translations.php', |
| 77 |
'frontend_author_archive' => $dir . 'mywp.setting.frontend.author-archive.php', |
| 78 |
'frontend_date_archive' => $dir . 'mywp.setting.frontend.date-archive.php', |
| 79 |
'frontend_taxonomy_archive' => $dir . 'mywp.setting.frontend.taxonomy-archive.php', |
| 80 |
'frontend_general' => $dir . 'mywp.setting.frontend.general.php', |
| 81 |
'frontend_toolbar' => $dir . 'mywp.setting.frontend.toolbar.php', |
| 82 |
'login_general' => $dir . 'mywp.setting.login.general.php', |
| 83 |
'login_user' => $dir . 'mywp.setting.login.user.php', |
| 84 |
'main_general' => $dir . 'mywp.setting.main.general.php', |
| 85 |
'site_general' => $dir . 'mywp.setting.site.general.php', |
| 86 |
'site_post_type' => $dir . 'mywp.setting.site.post-type.php', |
| 87 |
); |
| 88 |
|
| 89 |
$includes = apply_filters( 'mywp_setting_plugins_loaded_include_modules' , $includes ); |
| 90 |
|
| 91 |
MywpApi::require_files( $includes ); |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
public static function after_setup_theme_include_modules() { |
| 96 |
|
| 97 |
$includes = array(); |
| 98 |
|
| 99 |
$includes = apply_filters( 'mywp_setting_after_setup_theme_include_modules' , $includes ); |
| 100 |
|
| 101 |
MywpApi::require_files( $includes ); |
| 102 |
|
| 103 |
} |
| 104 |
|
| 105 |
public static function add_setting_menu_main( $setting_menus ) { |
| 106 |
|
| 107 |
$setting_menus['main'] = array( |
| 108 |
'menu_title' => __( 'My WP' , 'my-wp' ), |
| 109 |
'page_title' => __( 'My WP Customize' , 'my-wp' ), |
| 110 |
'slug' => 'mywp', |
| 111 |
'main' => true, |
| 112 |
'multiple_screens' => false, |
| 113 |
'icon_url' => 'none', |
| 114 |
); |
| 115 |
|
| 116 |
return $setting_menus; |
| 117 |
|
| 118 |
} |
| 119 |
|
| 120 |
public static function add_setting_menu_admin( $setting_menus ) { |
| 121 |
|
| 122 |
$setting_menus['admin'] = array( |
| 123 |
'menu_title' => __( 'Admin' , 'my-wp' ), |
| 124 |
); |
| 125 |
|
| 126 |
return $setting_menus; |
| 127 |
|
| 128 |
} |
| 129 |
|
| 130 |
public static function add_setting_menu_frontend( $setting_menus ) { |
| 131 |
|
| 132 |
$setting_menus['frontend'] = array( |
| 133 |
'menu_title' => __( 'Frontend' , 'my-wp' ), |
| 134 |
); |
| 135 |
|
| 136 |
return $setting_menus; |
| 137 |
|
| 138 |
} |
| 139 |
|
| 140 |
public static function add_setting_menu_login( $setting_menus ) { |
| 141 |
|
| 142 |
$setting_menus['login'] = array( |
| 143 |
'menu_title' => __( 'Log in' ), |
| 144 |
); |
| 145 |
|
| 146 |
return $setting_menus; |
| 147 |
|
| 148 |
} |
| 149 |
|
| 150 |
public static function add_setting_menu_site( $setting_menus ) { |
| 151 |
|
| 152 |
$setting_menus['site'] = array( |
| 153 |
'menu_title' => __( 'Website' , 'my-wp' ), |
| 154 |
); |
| 155 |
|
| 156 |
return $setting_menus; |
| 157 |
|
| 158 |
} |
| 159 |
|
| 160 |
public static function add_setting_menu_network( $setting_menus ) { |
| 161 |
|
| 162 |
$setting_menus['network'] = array( |
| 163 |
'menu_title' => __( 'My WP' , 'my-wp' ), |
| 164 |
'network' => true, |
| 165 |
'main' => true, |
| 166 |
'icon_url' => 'none', |
| 167 |
); |
| 168 |
|
| 169 |
return $setting_menus; |
| 170 |
|
| 171 |
} |
| 172 |
|
| 173 |
public static function add_setting_menu_debug( $setting_menus ) { |
| 174 |
|
| 175 |
$setting_menus['debug'] = array( |
| 176 |
'menu_title' => __( 'Debug' , 'my-wp' ), |
| 177 |
); |
| 178 |
|
| 179 |
$setting_menus['network_debug'] = array( |
| 180 |
'menu_title' => __( 'Debug' , 'my-wp' ), |
| 181 |
'network' => true, |
| 182 |
); |
| 183 |
|
| 184 |
return $setting_menus; |
| 185 |
|
| 186 |
} |
| 187 |
|
| 188 |
public static function mywp_request_admin_manager() { |
| 189 |
|
| 190 |
if( is_network_admin() ) { |
| 191 |
|
| 192 |
return false; |
| 193 |
|
| 194 |
} |
| 195 |
|
| 196 |
$setting_menus = MywpSettingMenu::get_setting_menus(); |
| 197 |
|
| 198 |
if( empty( $setting_menus ) ) { |
| 199 |
|
| 200 |
return false; |
| 201 |
|
| 202 |
} |
| 203 |
|
| 204 |
$setting_screens = MywpSettingScreen::get_setting_screens(); |
| 205 |
|
| 206 |
if( empty( $setting_screens ) ) { |
| 207 |
|
| 208 |
return false; |
| 209 |
|
| 210 |
} |
| 211 |
|
| 212 |
self::setting_data_update(); |
| 213 |
|
| 214 |
add_action( 'admin_menu' , array( __CLASS__ , 'admin_menu' ) ); |
| 215 |
|
| 216 |
add_action( 'admin_init' , array( __CLASS__ , 'admin_init' ) , 20 ); |
| 217 |
|
| 218 |
} |
| 219 |
|
| 220 |
public static function mywp_request_network_admin_manager() { |
| 221 |
|
| 222 |
if( ! is_network_admin() ) { |
| 223 |
|
| 224 |
return false; |
| 225 |
|
| 226 |
} |
| 227 |
|
| 228 |
$setting_menus = MywpSettingMenu::get_setting_menus(); |
| 229 |
|
| 230 |
if( empty( $setting_menus ) ) { |
| 231 |
|
| 232 |
return false; |
| 233 |
|
| 234 |
} |
| 235 |
|
| 236 |
$setting_screens = MywpSettingScreen::get_setting_screens(); |
| 237 |
|
| 238 |
if( empty( $setting_screens ) ) { |
| 239 |
|
| 240 |
return false; |
| 241 |
|
| 242 |
} |
| 243 |
|
| 244 |
self::setting_data_update(); |
| 245 |
|
| 246 |
add_action( 'network_admin_menu' , array( __CLASS__ , 'network_admin_menu' ) ); |
| 247 |
|
| 248 |
add_action( 'admin_init' , array( __CLASS__ , 'admin_init' ) , 20 ); |
| 249 |
|
| 250 |
} |
| 251 |
|
| 252 |
private static function setting_data_update() { |
| 253 |
|
| 254 |
if( empty( $_POST ) ) { |
| 255 |
|
| 256 |
return false; |
| 257 |
|
| 258 |
} |
| 259 |
|
| 260 |
if( ! MywpSetting::is_mywp_form_action( $_POST ) ) { |
| 261 |
|
| 262 |
return false; |
| 263 |
|
| 264 |
} |
| 265 |
|
| 266 |
if( is_network_admin() ) { |
| 267 |
|
| 268 |
if( ! MywpApi::is_network_manager() ) { |
| 269 |
|
| 270 |
return false; |
| 271 |
|
| 272 |
} |
| 273 |
|
| 274 |
} else { |
| 275 |
|
| 276 |
if( ! MywpApi::is_manager() ) { |
| 277 |
|
| 278 |
return false; |
| 279 |
|
| 280 |
} |
| 281 |
|
| 282 |
} |
| 283 |
|
| 284 |
$form = $_POST['mywp']; |
| 285 |
|
| 286 |
$setting_screen_id = strip_tags( $form['setting_screen'] ); |
| 287 |
|
| 288 |
$action = strip_tags( $form['action'] ); |
| 289 |
|
| 290 |
$nonce_key = MywpSetting::get_nonce_key( $setting_screen_id , $action ); |
| 291 |
|
| 292 |
check_admin_referer( $nonce_key , $nonce_key ); |
| 293 |
|
| 294 |
$mywp_notice = new MywpNotice(); |
| 295 |
|
| 296 |
$formatted_data = MywpSetting::post_data_format( $setting_screen_id , $action , $form ); |
| 297 |
|
| 298 |
$notice = $mywp_notice->get_notice(); |
| 299 |
|
| 300 |
if( ! empty( $notice ) ) { |
| 301 |
|
| 302 |
return false; |
| 303 |
|
| 304 |
} |
| 305 |
|
| 306 |
$validated_data = MywpSetting::post_data_validate( $setting_screen_id , $action , $formatted_data ); |
| 307 |
|
| 308 |
$notice = $mywp_notice->get_notice(); |
| 309 |
|
| 310 |
if( ! empty( $notice ) ) { |
| 311 |
|
| 312 |
return false; |
| 313 |
|
| 314 |
} |
| 315 |
|
| 316 |
$is_redirect = MywpSetting::post_data_action( $setting_screen_id , $action , $validated_data ); |
| 317 |
|
| 318 |
if( $is_redirect ) { |
| 319 |
|
| 320 |
wp_redirect( esc_url_raw( remove_query_arg( 'updated' , add_query_arg( 'updated' , true ) ) ) ); |
| 321 |
exit; |
| 322 |
|
| 323 |
} |
| 324 |
|
| 325 |
} |
| 326 |
|
| 327 |
public static function admin_menu() { |
| 328 |
|
| 329 |
$setting_menus = MywpSettingMenu::get_setting_menus(); |
| 330 |
|
| 331 |
if( empty( $setting_menus ) ) { |
| 332 |
|
| 333 |
return false; |
| 334 |
|
| 335 |
} |
| 336 |
|
| 337 |
foreach( $setting_menus as $setting_menu_id => $setting_menu ) { |
| 338 |
|
| 339 |
if( ! empty( $setting_menu['network'] ) ) { |
| 340 |
|
| 341 |
continue; |
| 342 |
|
| 343 |
} |
| 344 |
|
| 345 |
MywpSettingMenu::add_menu( $setting_menu_id , $setting_menu ); |
| 346 |
|
| 347 |
} |
| 348 |
|
| 349 |
} |
| 350 |
|
| 351 |
public static function network_admin_menu() { |
| 352 |
|
| 353 |
$setting_menus = MywpSettingMenu::get_setting_menus(); |
| 354 |
|
| 355 |
if( empty( $setting_menus ) ) { |
| 356 |
|
| 357 |
return false; |
| 358 |
|
| 359 |
} |
| 360 |
|
| 361 |
foreach( $setting_menus as $setting_menu_id => $setting_menu ) { |
| 362 |
|
| 363 |
if( empty( $setting_menu['network'] ) ) { |
| 364 |
|
| 365 |
continue; |
| 366 |
|
| 367 |
} |
| 368 |
|
| 369 |
MywpSettingMenu::add_menu( $setting_menu_id , $setting_menu ); |
| 370 |
|
| 371 |
} |
| 372 |
|
| 373 |
} |
| 374 |
|
| 375 |
public static function admin_init() { |
| 376 |
|
| 377 |
$menu_hook_names = MywpSettingMenu::get_menu_hook_names(); |
| 378 |
|
| 379 |
if( empty( $menu_hook_names ) ) { |
| 380 |
|
| 381 |
return false; |
| 382 |
|
| 383 |
} |
| 384 |
|
| 385 |
foreach( $menu_hook_names as $setting_menu_id => $menu_hook_name ) { |
| 386 |
|
| 387 |
add_action( "load-{$menu_hook_name}" , array( __CLASS__ , 'load_setting_screen' ) ); |
| 388 |
|
| 389 |
} |
| 390 |
|
| 391 |
} |
| 392 |
|
| 393 |
public static function load_setting_screen() { |
| 394 |
|
| 395 |
self::set_current_setting(); |
| 396 |
|
| 397 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 398 |
|
| 399 |
if( empty( $current_setting_menu_id ) ) { |
| 400 |
|
| 401 |
return false; |
| 402 |
|
| 403 |
} |
| 404 |
|
| 405 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 406 |
|
| 407 |
if( empty( $current_setting_screen_id ) ) { |
| 408 |
|
| 409 |
return false; |
| 410 |
|
| 411 |
} |
| 412 |
|
| 413 |
add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'admin_enqueue_scripts' ) ); |
| 414 |
|
| 415 |
add_action( 'admin_print_styles' , array( __CLASS__ , 'admin_print_styles' ) ); |
| 416 |
|
| 417 |
add_action( 'admin_print_scripts' , array( __CLASS__ , 'admin_print_scripts' ) ); |
| 418 |
|
| 419 |
add_action( 'admin_print_footer_scripts' , array( __CLASS__ , 'admin_print_footer_scripts' ) ); |
| 420 |
|
| 421 |
add_filter( 'admin_body_class' , array( __CLASS__ , 'admin_body_class' ) ); |
| 422 |
|
| 423 |
do_action( "mywp_setting_load_setting_screen_{$current_setting_menu_id}" ); |
| 424 |
|
| 425 |
do_action( "mywp_setting_load_setting_screen_{$current_setting_screen_id}" ); |
| 426 |
|
| 427 |
do_action( "mywp_setting_load_setting_screen_{$current_setting_screen_id}_{$current_setting_menu_id}" ); |
| 428 |
|
| 429 |
do_action( 'mywp_setting_load_setting_screen' , $current_setting_screen_id , $current_setting_menu_id ); |
| 430 |
|
| 431 |
do_action( 'mywp_setting_after_load_setting_screen' ); |
| 432 |
|
| 433 |
} |
| 434 |
|
| 435 |
private static function set_current_setting() { |
| 436 |
|
| 437 |
global $page_hook; |
| 438 |
|
| 439 |
if( empty( $page_hook ) ) { |
| 440 |
|
| 441 |
return false; |
| 442 |
|
| 443 |
} |
| 444 |
|
| 445 |
MywpSettingMenu::set_current_menu_by_page_hook( $page_hook ); |
| 446 |
|
| 447 |
if( ! empty( $_GET['setting_screen'] ) ) { |
| 448 |
|
| 449 |
MywpSettingScreen::set_current_screen_id( $_GET['setting_screen'] ); |
| 450 |
|
| 451 |
} else { |
| 452 |
|
| 453 |
MywpSettingScreen::set_current_screen_by_menu_id( MywpSettingMenu::get_current_menu_id() ); |
| 454 |
|
| 455 |
} |
| 456 |
|
| 457 |
if( ! empty( $_GET['setting_post_type'] ) ) { |
| 458 |
|
| 459 |
MywpSettingPostType::set_current_post_type_id( $_GET['setting_post_type'] ); |
| 460 |
|
| 461 |
} else { |
| 462 |
|
| 463 |
MywpSettingPostType::set_current_post_type_to_default(); |
| 464 |
|
| 465 |
} |
| 466 |
|
| 467 |
do_action( 'mywp_set_current_setting' ); |
| 468 |
|
| 469 |
} |
| 470 |
|
| 471 |
public static function admin_enqueue_scripts() { |
| 472 |
|
| 473 |
$dir_css = MywpApi::get_plugin_url( 'css' ); |
| 474 |
$dir_js = MywpApi::get_plugin_url( 'js' ); |
| 475 |
|
| 476 |
wp_register_style( 'mywp_admin_setting' , $dir_css . 'admin-setting.css' , array() , MYWP_VERSION ); |
| 477 |
wp_register_script( 'mywp_admin_setting' , $dir_js . 'admin-setting.js' , array( 'jquery' ) , MYWP_VERSION ); |
| 478 |
|
| 479 |
$mywp_admin_setting = array( |
| 480 |
'error_try_again' => sprintf( 'ERROR: %s' , __( 'Please try again.' ) ), |
| 481 |
'confirm_message' => __( 'Are you sure you want to do this?' ), |
| 482 |
'confirm_delete_message' => __( 'Are you sure you want to delete this?' , 'my-wp' ), |
| 483 |
'not_found_update_url' => __( 'Not found update URL.' , 'my-wp' ), |
| 484 |
'column_already_added' => __( 'It column can not be added because it has already added.' , 'my-wp' ), |
| 485 |
); |
| 486 |
|
| 487 |
wp_localize_script( 'mywp_admin_setting' , 'mywp_admin_setting' , $mywp_admin_setting ); |
| 488 |
|
| 489 |
wp_enqueue_style( 'mywp_admin_setting' ); |
| 490 |
wp_enqueue_script( 'mywp_admin_setting' ); |
| 491 |
|
| 492 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 493 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 494 |
|
| 495 |
do_action( "mywp_setting_admin_enqueue_scripts_{$current_setting_menu_id}" ); |
| 496 |
|
| 497 |
do_action( "mywp_setting_admin_enqueue_scripts_{$current_setting_screen_id}" ); |
| 498 |
|
| 499 |
do_action( "mywp_setting_admin_enqueue_scripts_{$current_setting_screen_id}_{$current_setting_menu_id}" ); |
| 500 |
|
| 501 |
do_action( 'mywp_setting_admin_enqueue_scripts' , $current_setting_screen_id , $current_setting_menu_id ); |
| 502 |
|
| 503 |
} |
| 504 |
|
| 505 |
public static function admin_print_styles() { |
| 506 |
|
| 507 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 508 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 509 |
|
| 510 |
do_action( "mywp_setting_admin_print_styles_{$current_setting_menu_id}" ); |
| 511 |
|
| 512 |
do_action( "mywp_setting_admin_print_styles_{$current_setting_screen_id}" ); |
| 513 |
|
| 514 |
do_action( "mywp_setting_admin_print_styles_{$current_setting_screen_id}_{$current_setting_menu_id}" ); |
| 515 |
|
| 516 |
do_action( 'mywp_setting_admin_print_styles' , $current_setting_screen_id , $current_setting_menu_id ); |
| 517 |
|
| 518 |
} |
| 519 |
|
| 520 |
public static function admin_print_scripts() { |
| 521 |
|
| 522 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 523 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 524 |
|
| 525 |
do_action( "mywp_setting_admin_print_scripts_{$current_setting_menu_id}" ); |
| 526 |
|
| 527 |
do_action( "mywp_setting_admin_print_scripts_{$current_setting_screen_id}" ); |
| 528 |
|
| 529 |
do_action( "mywp_setting_admin_print_scripts_{$current_setting_screen_id}_{$current_setting_menu_id}" ); |
| 530 |
|
| 531 |
do_action( 'mywp_setting_admin_print_scripts' , $current_setting_screen_id , $current_setting_menu_id ); |
| 532 |
|
| 533 |
} |
| 534 |
|
| 535 |
public static function admin_print_footer_scripts() { |
| 536 |
|
| 537 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 538 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 539 |
|
| 540 |
do_action( "mywp_setting_admin_print_footer_scripts_{$current_setting_menu_id}" ); |
| 541 |
|
| 542 |
do_action( "mywp_setting_admin_print_footer_scripts_{$current_setting_screen_id}" ); |
| 543 |
|
| 544 |
do_action( "mywp_setting_admin_print_footer_scripts_{$current_setting_screen_id}_{$current_setting_menu_id}" ); |
| 545 |
|
| 546 |
do_action( 'mywp_setting_admin_print_footer_scripts' , $current_setting_screen_id , $current_setting_menu_id ); |
| 547 |
|
| 548 |
} |
| 549 |
|
| 550 |
public static function admin_body_class( $admin_body_class ) { |
| 551 |
|
| 552 |
$admin_body_class .= ' mywp-setting '; |
| 553 |
|
| 554 |
$current_setting_menu_id = MywpSettingMenu::get_current_menu_id(); |
| 555 |
$current_setting_screen_id = MywpSettingScreen::get_current_screen_id(); |
| 556 |
|
| 557 |
$admin_body_class .= "mywp-{$current_setting_menu_id} mywp-{$current_setting_screen_id}"; |
| 558 |
$admin_body_class .= "mywp-{$current_setting_menu_id}-{$current_setting_screen_id}"; |
| 559 |
|
| 560 |
return $admin_body_class; |
| 561 |
|
| 562 |
} |
| 563 |
|
| 564 |
} |
| 565 |
|
| 566 |
endif; |
| 567 |
|