Ejemplo n.º 1
0
 public function enqueue_scripts($hook)
 {
     if ('post.php' !== $hook) {
         return;
     }
     if ('attachment' !== get_post_type()) {
         return;
     }
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_script('wp-gcs-offload-attachment-edit', App::get_url('assets/dist/js/attachment-edit' . $min . '.js'), array('jquery', 'wp-util'), App::get_info('version'), true);
     wp_enqueue_style('wp-gcs-offload-attachment-edit', App::get_url('assets/dist/css/attachment-edit' . $min . '.css'), array(), App::get_info('version'));
     wp_localize_script('wp-gcs-offload-attachment-edit', '_wpGCSOffloadAttachmentEdit', array('sync_attachment_upstream_nonce' => AjaxHandler::instance()->get_action_nonce('sync_attachment_upstream'), 'sync_attachment_downstream_nonce' => AjaxHandler::instance()->get_action_nonce('sync_attachment_downstream'), 'delete_attachment_upstream_nonce' => AjaxHandler::instance()->get_action_nonce('delete_attachment_upstream'), 'delete_attachment_downstream_nonce' => AjaxHandler::instance()->get_action_nonce('delete_attachment_downstream'), 'error_prefix' => __('Error:', 'wp-gcs-offload')));
 }
Ejemplo n.º 2
0
 public function enqueue_scripts()
 {
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_style('wp-gcs-offload-manage-gcs', App::get_url('assets/dist/css/manage-gcs' . $min . '.css'), array(), App::get_info('version'));
     App::get_background_sync()->enqueue_script('#wpgcso-progress', '#wpgcso-start', '#wpgcso-empty-logs');
 }