Changeset 10102
- Timestamp:
- 07/27/2020 09:23:24 PM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-block-plugin-checker.php
r10101 r10102 802 802 803 803 /** 804 * Check that the plugin uses `wp_set_script_translations`. 805 */ 806 function check_for_translation_function() { 807 $functions = wp_list_pluck( $this->php_function_calls, 0 ); 808 if ( ! in_array( 'wp_set_script_translations', $functions ) ) { 809 $this->record_result( 810 __FUNCTION__, 811 'warning', 812 __( 'No translations are loaded for the scripts.', 'wporg-plugins' ), 813 $call 814 ); 815 } 816 } 817 818 /** 804 819 * Does it make PHP function calls that shouldn't be in a block plugin? 805 820 */ -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php
r10089 r10102 318 318 case 'check_php_function_calls': 319 319 return __( 'Block plugins should contain minimal PHP with no UI outside the editor. JavaScript should be used instead of PHP where possible.', 'wporg-plugins' ); 320 case 'check_for_translation_function': 321 return sprintf( 322 // translators: %s is the link to the internationalization docs. 323 __( 'Block plugins should use <code>wp_set_script_translations</code> to load translations for each script file. <a href="%s">Learn more about internationalization.</a>', 'wporg-plugins' ), 324 'https://developer.wordpress.org/block-editor/developers/internationalization/' 325 ); 320 326 // This is a special case, since multiple values may be collapsed. 321 327 case 'check_block_json_is_valid':
Note: See TracChangeset
for help on using the changeset viewer.