$fake_names, 'translations' => $translations['additional'] ]); wp_localize_script( 'ainisa-smart-reviewer-main', 'wpApiSettings', array( 'root' => esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ) ) ); } } /** * Function for getting ip address */ if( ! function_exists( 'ains_get_ip_address' ) ) { function ains_get_ip_address() { return isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : null; } } /** * Function for getting post types for Ainisa */ if( ! function_exists( 'ains_get_post_types_for_ainisa' ) ) { function ains_get_post_types_for_ainisa() { $post_types = get_post_types(); $post_types_to_be_removed = [ 'attachment', 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset', 'oembed_cache', 'user_request', 'wp_block', 'wp_template', 'wp_template_part', 'wp_global_styles', 'wp_navigation', 'wp_font_family', 'wp_font_face' ]; foreach ($post_types_to_be_removed as $pt) { unset($post_types[$pt]); } return $post_types; } }