Making WordPress.org


Ignore:
Timestamp:
09/05/2022 08:21:02 PM (4 years ago)
Author:
iandunn
Message:

Developer: Sync with Git 41e97d9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php

    r12051 r12053  
    2222    public function init() {
    2323
    24         add_action( 'wp_ajax_autocomplete',  array( $this, 'autocomplete_data_update' ) );
    25         add_action( "wp_ajax_nopriv_autocomplete", array( $this, 'autocomplete_data_update' ) );
     24        add_action( 'wp_ajax_autocomplete', array( $this, 'autocomplete_data_update' ) );
     25        add_action( 'wp_ajax_nopriv_autocomplete', array( $this, 'autocomplete_data_update' ) );
    2626
    2727        // Enqueue scripts and styles.
     
    3737    public function scripts_and_styles() {
    3838
    39         wp_enqueue_style( 'awesomplete-css', get_template_directory_uri() . '/stylesheets/awesomplete.css', array(), '20220905' );
    40         wp_enqueue_style( 'autocomplete-css', get_template_directory_uri() . '/stylesheets/autocomplete.css', array(), '20220905' );
     39        wp_enqueue_style(
     40            'awesomplete-css',
     41            get_template_directory_uri() . '/stylesheets/awesomplete.css',
     42            array(),
     43            filemtime( dirname( __DIR__ ) . '/stylesheets/awesomplete.css' )
     44        );
     45        wp_enqueue_style(
     46            'autocomplete-css',
     47            get_template_directory_uri() . '/stylesheets/autocomplete.css',
     48            array(),
     49            filemtime( dirname( __DIR__ ) . '/stylesheets/autocomplete.css' )
     50        );
    4151
    42         wp_register_script( 'awesomplete', get_template_directory_uri() . '/js/awesomplete.min.js', array(), '20220905', true );
     52        wp_register_script(
     53            'awesomplete',
     54            get_template_directory_uri() . '/js/awesomplete.min.js',
     55            array(),
     56            filemtime( dirname( __DIR__ ) . '/js/awesomplete.min.js' ),
     57            true
     58        );
    4359        wp_enqueue_script( 'awesomplete' );
    4460
    4561        wp_register_script( 'autocomplete', get_stylesheet_directory_uri() . '/js/autocomplete.js', array( 'awesomplete' ), filemtime( dirname( __DIR__ ) . '/js/autocomplete.js' ), true );
    46         wp_localize_script( 'autocomplete', 'autocomplete', array(
     62        wp_localize_script(
     63            'autocomplete',
     64            'autocomplete',
     65            array(
    4766                'ajaxurl' => admin_url( 'admin-ajax.php' ),
    4867                'nonce'   => wp_create_nonce( 'autocomplete_nonce' ),
     
    7291        );
    7392
    74         if ( !( isset( $_POST['data'] ) && $_POST['data'] ) ) {
     93        if ( ! ( isset( $_POST['data'] ) && $_POST['data'] ) ) {
    7594            wp_send_json_error( $defaults );
    7695        }
     
    86105
    87106        foreach ( $form_data['post_type'] as $key => $post_type ) {
    88             if ( !in_array( $post_type , $parser_post_types ) ) {
     107            if ( ! in_array( $post_type, $parser_post_types ) ) {
    89108                unset( $form_data['post_type'][ $key ] );
    90109            }
    91110        }
    92111
    93         $post_types = !empty( $form_data['post_type'] ) ? $form_data['post_type'] : $parser_post_types;
     112        $post_types = ! empty( $form_data['post_type'] ) ? $form_data['post_type'] : $parser_post_types;
    94113
    95114        $args = array(
     
    117136
    118137                if ( $post->post_type == 'wp-parser-class' ) {
    119                     $title =  'class ' . $title . ' {}';
     138                    $title = 'class ' . $title . ' {}';
    120139                }
    121140
     
    124143        }
    125144
    126         wp_send_json_success ( $form_data );
     145        wp_send_json_success( $form_data );
    127146    }
    128147
Note: See TracChangeset for help on using the changeset viewer.