Plugin Directory

Changeset 1963455


Ignore:
Timestamp:
10/26/2018 10:44:51 AM (7 years ago)
Author:
herregroen
Message:

Update loading of the test script.

Location:
nothing-much/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nothing-much/trunk/js/nothing-much.js

    r1963446 r1963455  
    1 var __ = wp.i18n.__;
    2 var sprintf = wp.i18n.sprintf;
     1jQuery( function () {
     2    var __ = wp.i18n.__;
     3    var sprintf = wp.i18n.sprintf;
    34
    45// String also in PHP:
    5 console.log(
    6     __( 'Yo, we told you this plugin didn’t do much. Test Trunk', 'nothing-much' )
    7 );
     6    console.log(
     7        __( 'Yo, we told you this plugin didn’t do much. Test Trunk', 'nothing-much' )
     8    );
    89
    910// String unique to JavaScript:
    10 console.log(
    11     __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )
    12 );
     11    console.log(
     12        __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )
     13    );
    1314
    14 console.log(
    15     __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )
    16 );
     15    console.log(
     16        __( 'Yo, this plugin isn’t doing much in JavaScript.', 'nothing-much' )
     17    );
    1718
    18 console.log(
    19     // translators: %s: The name of this plugin.
    20     sprintf( __( 'Yo, this plugin is named %s.' ), 'nothing-much' )
    21 );
     19    console.log(
     20        // translators: %s: The name of this plugin.
     21        sprintf( __( 'Yo, this plugin is named %s.' ), 'nothing-much' )
     22    );
     23} );
  • nothing-much/trunk/nothing-much.php

    r1963446 r1963455  
    1414        add_action( 'admin_init', array( $this, 'load_textdomain' ) );
    1515        add_action( 'admin_notices', array( $this, 'admin_notices' ) );
    16         add_action( 'wp_enqueue_scripts', array( $this, 'admin_enqueue_script' ) );
     16        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_script' ) );
    1717    }
    1818
     
    2828
    2929    public function enqueue_script() {
    30         wp_enqueue_script( 'nothing-much-script', plugins_url( '/js/newscript.js' , __FILE__ ) );
     30        wp_enqueue_script( 'nothing-much-script', plugins_url( '/js/nothing-much.js' , __FILE__ ), array( 'jquery', 'wp-i18n' ) );
    3131
    3232        if ( function_exists( 'wp_set_script_translations' ) ) {
Note: See TracChangeset for help on using the changeset viewer.