Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
admin@pkms99.info
<? php gunakan Automattic \ Jetpack \ Status; // Bangun menu admin Jetpack secara keseluruhan class Jetpack_Admin { / ** * @var Jetpack_Admin ** / private static $ instance = null; / ** * @var Jetpack ** / private $ jetpack; fungsi statis init () { if (isset ($ _GET ['page']) && $ _GET ['page'] === 'jetpack') { add_filter ('nocache_headers', array ('Jetpack_Admin', 'add_no_store_header'), 100); } if (is_null (self :: $ instance)) { self :: $ instance = new Jetpack_Admin (); } return self :: $ instance; } fungsi statis add_no_store_header ($ header) { $ header ['Cache-Control']. = ', no-store'; return $ header; } fungsi pribadi __construct () { $ this-> jetpack = Jetpack :: init (); jetpack_require_lib ('admin-pages / class.jetpack-react-page'); $ this-> jetpack_react = new Jetpack_React_Page (); jetpack_require_lib ('admin-pages / class.jetpack-settings-page'); $ this-> fallback_page = new Jetpack_Settings_Page (); jetpack_require_lib ('admin-pages / class-jetpack-about-page'); $ this-> jetpack_about = new Jetpack_About_Page (); add_action ('admin_menu', array ($ this-> jetpack_react, 'add_actions'), 998); add_action ('jetpack_admin_menu', array ($ this-> jetpack_react, 'jetpack_add_dashboard_sub_nav_item')); add_action ('jetpack_admin_menu', array ($ this-> jetpack_react, 'jetpack_add_settings_sub_nav_item')); add_action ('jetpack_admin_menu', array ($ this, 'admin_menu_debugger')); add_action ('jetpack_admin_menu', array ($ this-> fallback_page, 'add_actions')); add_action ('jetpack_admin_menu', array ($ this-> jetpack_about, 'add_actions')); // Tambahkan redirect ke halaman saat ini untuk aktivasi / penonaktifan modul add_action ('jetpack_pre_activate_module', array ($ this, 'fix_redirect'), 10, 2); add_action ('jetpack_pre_deactivate_module', array ($ this, 'fix_redirect')); // Tambahkan modul penanganan aksi massal add_action ('jetpack_unrecognized_action', array ($ this, 'handle_unrecognized_action')); } fungsi statis sort_requires_connection_last ($ module1, $ module2) { if ($ module1 ['require_connection'] == $ module2 ['membutuhkan_connection']) { return 0; } elseif ($ module1 ['require_connection']) { return 1; } elseif ($ module2 ['required_connection']) { return -1; } return 0; } // Menghasilkan objek yang dapat dimengerti JS dari modul yang berisi informasi untuk // presentasi seperti deskripsi, nama, url konfigurasi, dll. function get_modules () { include_once JETPACK__PLUGIN_DIR. 'modules / module-info.php'; $ available_modules = Jetpack :: get_available_modules (); $ active_modules = Jetpack :: get_active_modules (); $ modules = array (); $ jetpack_active = Jetpack :: is_active () || (Status baru ()) -> is_development_mode (); $ overrides = Jetpack_Modules_Overrides :: instance (); foreach ($ available_modules sebagai $ module) { if ($ module_array = Jetpack :: get_module ($ module)) { / ** * Memfilter deskripsi singkat setiap modul. * * @ sejak 3.0.0 * * @param string $ module_array ['description'] Deskripsi modul. * @param string $ module Slug modul. * / $ short_desc = apply_filters ('jetpack_short_module_description', $ module_array ['description'], $ module); // Perbaiki: perbaiki string multibyte dengan memeriksa ekstensi mbstring $ short_desc_trunc = (function_exists ('mb_strlen')) ? ((mb_strlen ($ short_desc)> 143) ? mb_substr ($ short_desc, 0, 140). '...' : $ short_desc) : ((strlen ($ short_desc)> 143) ? substr ($ short_desc, 0, 140). '...' : $ short_desc); $ module_array ['module'] = $ module; $ module_array ['activated'] = ($ jetpack_active? in_array ($ module, $ active_modules): false); $ module_array ['deactivate_nonce'] = wp_create_nonce ('jetpack_deactivate-'. $ module); $ module_array ['activ_nonce'] = wp_create_nonce ('jetpack_activate-'. $ module); $ module_array ['available'] = self :: is_module_available ($ module_array); $ module_array ['short_description'] = $ short_desc_trunc; $ module_array ['configure_url'] = Jetpack :: module_configuration_url ($ module); $ module_array ['override'] = $ overrides-> get_module_override ($ module); ob_start (); / ** * Izinkan tampilan tombol "Pelajari Lebih Lanjut". * Bagian dinamis dari tindakan, $ module, adalah siput modul. * * @ sejak 3.0.0 * / do_action ('jetpack_learn_more_button_'. $ module); $ module_array ['learn_more_button'] = ob_get_clean (); ob_start (); / ** * Izinkan tampilan teks informasi ketika Jetpack terhubung ke WordPress.com. * Bagian dinamis dari tindakan, $ module, adalah siput modul. * * @ sejak 3.0.0 * / do_action ('jetpack_module_more_info_'. $ module); / ** * Saring deskripsi panjang modul. * * @ sejak 3.5.0 * * @param string ob_get_clean () Deskripsi panjang modul. * @param string $ module Nama modul. * / $ module_array ['long_description'] = apply_filters ('jetpack_long_module_description', ob_get_clean (), $ module); ob_start (); / ** * Saring istilah pencarian untuk sebuah modul * * Istilah pencarian biasanya ditambahkan ke header modul, di bawah "Permintaan Pencarian Tambahan". * * Gunakan sintaks: * function jetpack_ $ module_search_terms ($ terms) { * $ terms = _x ('term 1, term 2', 'term search', 'jetpack'); * mengembalikan ketentuan $; *} * add_filter ('jetpack_search_terms_ $ module', 'jetpack_ $ module_search_terms'); * * @ sejak 3.5.0 * * @param string Istilah pencarian (dipisahkan koma). * / echo apply_filters ('jetpack_search_terms_'. $ module, $ module_array ['additional_search_queries']); $ module_array ['search_terms'] = ob_get_clean (); $ module_array ['konfigurable'] = false; jika ( current_user_can ('manage_options') && / ** * Izinkan tampilan tautan konfigurasi di layar Pengaturan Jetpack. * * @ sejak 3.0.0 * * @param string $ module Nama modul. * @param bool false Haruskah tautan Konfigurasi modul ditampilkan? Default ke false. * / apply_filters ('jetpack_module_configurable_'. $ module, false) ) { $ module_array ['konfigurable'] = sprintf ('<a href="%1$s">% 2 $ s </a>', esc_url ($ module_array ['configure_url']), __ ('Configure', ' jetpack ')); } $ modules [$ module] = $ module_array; } } uasort ($ modules, array ($ this-> jetpack, 'sort_modules')); if (! Jetpack :: is_active ()) { uasort ($ modules, array (__CLASS__, 'sort_requires_connection_last')); } mengembalikan $ modul; } fungsi statis is_module_available ($ module) { if (! is_array ($ module) || empty ($ module)) { return false; } / ** * Kami tidak pernah ingin menunjukkan VaultPress dapat diaktifkan melalui Jetpack. * / if ('vaultpress' === $ module ['module']) { return false; } if ((Status baru ()) -> is_development_mode ()) { kembali! ($ module ['require_connection']); } lain { if (! Jetpack :: is_active ()) { return false; } return Jetpack_Plan :: support ($ module ['module']); } } function handle_unrecognized_action ($ action) { switch ($ action) { huruf 'aktifkan massal': if (! current_user_can ('jetpack_activate_modules'))) { istirahat; } $ modules = (array) $ _GET ['modules']; $ modules = array_map ('sanitize_key', $ modules); check_admin_referer ('bulk-jetpack_page_jetpack_modules'); foreach ($ modules as $ module) { Jetpack :: log ('aktifkan', $ module); Jetpack :: activ_module ($ module, false); } // Dua baris berikut jarang akan terjadi, karena Jetpack :: activ_module biasanya keluar di akhir. wp_safe_redirect (wp_get_referer ()); keluar; case 'bulk-nonaktifkan': if (! current_user_can ('jetpack_deactivate_modules')) { istirahat; } $ modules = (array) $ _GET ['modules']; $ modules = array_map ('sanitize_key', $ modules); check_admin_referer ('bulk-jetpack_page_jetpack_modules'); foreach ($ modules as $ module) { Jetpack :: log ('nonaktifkan', $ module); Jetpack :: deactivate_module ($ module); Jetpack :: state ('message', 'module_deactivated'); } Jetpack :: state ('module', $ modules); wp_safe_redirect (wp_get_referer ()); keluar; default: kembali; } } function fix_redirect ($ module, $ redirect = true) { if (! $ redirect) { kembali; } if (wp_get_referer ()) { add_filter ('wp_redirect', 'wp_get_referer'); } } function admin_menu_debugger () { jetpack_require_lib ('debugger'); Jetpack_Debugger :: disconnect_and_redirect (); $ debugger_hook = add_submenu_page ( batal, __ ('Pusat Debugging', 'jetpack'), '', 'kelola_pilihan', 'jetpack-debugger', array ($ this, 'wrap_debugger_page') ); add_action ("admin_head- $ debugger_hook", array ('Jetpack_Debugger', 'jetpack_debug_admin_head')); } function wrap_debugger_page () { nocache_headers (); if (! current_user_can ('manage_options')) { die ('-1'); } Jetpack_Admin_Page :: wrap_ui (array ($ this, 'debugger_page')); } function debugger_page () { jetpack_require_lib ('debugger'); Jetpack_Debugger :: jetpack_debug_display_handler (); } } Jetpack_Admin :: init ();
run
|
edit
|
history
|
help
0
test
test wall
Closest companies
department
MySQL Practice
D for Devil
Top 2 Query
gandu
Finde einmalige Datensätze im Vergleich mehrerer Tabellen
string time compare