芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/psaree.com/wp-content/plugins/facebook-messenger-customer-chat/options.php
'0', 'category_index' => '0', 'front_page' => '0', 'pages' => array(), 'pages_all' => '0', 'posts' => '0', 'product_pages' => '0', 'tag_index' => '0', ); if ( ! is_array( $data ) ) { return $defaults; } $page_types = array(); foreach ( $data as $key => $value ) { if ( ! array_key_exists( $key, $defaults ) ) { continue; } if ( 'pages' === $key ) { $page_types[ $key ] = array_map( 'sanitize_text_field', (array) $value ); } else { $page_types[ $key ] = '1' === $value ? '1' : '0'; } } $page_types = wp_parse_args( $page_types, $defaults ); return $page_types; } /** * Update plugin settings. * * @return void */ function fbmcc_update_options() { $capability = fbmcc_get_options_capability(); if ( current_user_can( $capability ) ) { check_ajax_referer( 'update_fbmcc_code' ); if ( isset( $_POST['pageTypes'] ) ) { update_option( 'fbmcc_page_types', fbmcc_sanitize_page_types( $_POST['pageTypes'] ) ); } if ( isset( $_POST['pageID'] ) ) { update_option( 'fbmcc_pageID', absint( $_POST['pageID'] ) ); } if ( isset( $_POST['locale'] ) ) { update_option( 'fbmcc_locale', sanitize_text_field( $_POST['locale'] ) ); } update_option( 'fbmcc_install_ts', time() ); } wp_die(); } /** * Enqueue admin styles. * * @return void */ function fbmcc_add_styles() { wp_enqueue_style( 'fbmcc-admin', plugins_url( '/settings.css', __FILE__ ), array(), FBMCC_VERSION, 'all' ); } /** * Enqueue admin JavaScript. * * @param string $hook_suffix The current admin page. * * @return void */ function fbmcc_localize_ajax( $hook_suffix ) { if ( 'settings_page_facebook-messenger-customer-chat' !== $hook_suffix && 'plugins.php' !== $hook_suffix ) { return; } $capability = fbmcc_get_options_capability(); if ( ! current_user_can( $capability ) ) { return; } wp_register_script( 'fbmcc-admin', plugins_url( '/script.js', __FILE__ ), array(), FBMCC_VERSION, false ); wp_localize_script( 'fbmcc-admin', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'update_fbmcc_code' ), ) ); wp_enqueue_script( 'fbmcc-admin' ); } /** * Display settings page. * * @return void */ function fbmcc_integration_settings() { $pages_arr = get_pages(); $page_id = get_option( 'fbmcc_pageID' ); $page_types = get_option( 'fbmcc_page_types' ); ?>
%2$s
', esc_url( $inbox_url ), esc_html__( 'Edit Availability and Automated Responses', 'facebook-messenger-customer-chat' ) ); } ?>
%2$s', selected( ! $page_types || '1' === $page_types['all'], true, false ), esc_html__( 'All WordPress pages', 'facebook-messenger-customer-chat' ) ); printf( '
%2$s
', selected( $page_types && '0' === $page_types['all'], true, false ), esc_html__( 'Custom WordPress pages', 'facebook-messenger-customer-chat' ) ); ?>
/>
/>
/>
/>
/>
/>
ID, $page_types['pages'], true ) ); printf( '
%3$s
', esc_attr( $page->ID ), checked( $checked, true, false ), esc_html( $page->post_title ) ); ?>
/>