Changeset 3058 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 05/02/2016 02:39:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r3030 r3058 955 955 */ 956 956 function wporg_themes_glotpress_import( $theme_post, $version ) { 957 if ( ! defined( 'TRANSLATE_API_INTERNAL_BEARER_TOKEN' ) ) { 958 return; 959 } 960 957 961 $theme_post = get_post( $theme_post ); 958 962 … … 961 965 } 962 966 963 $cmd = WPORGTRANSLATE_WPCLI . ' wporg-translate set-theme-project ' . escapeshellarg( $theme_post->post_name ) . ' ' . escapeshellarg( $version ); 964 965 shell_exec( $cmd ); 967 wp_remote_post( 'https://translate.wordpress.org/wp-json/translate/v1/jobs', array( 968 'body' => json_encode( 969 array( 970 'timestamp' => time() + 2 * 60, 971 'recurrence' => 'once', 972 'hook' => 'wporg_translate_import_or_update_theme', 973 'args' => array( 974 array( 975 'theme' => $theme_post->post_name, 976 'version' => $version, 977 ), 978 ), 979 ) 980 ), 981 'headers' => array( 982 'Content-Type' => 'application/json', 983 'Authorization' => 'Bearer ' . TRANSLATE_API_INTERNAL_BEARER_TOKEN, 984 ), 985 'blocking' => false, 986 'user-agent' => 'WordPress.org Themes Import', 987 ) ); 966 988 } 967 989 add_action( 'wporg_themes_update_version_live', 'wporg_themes_glotpress_import', 100, 2 );
Note: See TracChangeset
for help on using the changeset viewer.