wp_stateless_add_media_args

wp_stateless_add_media_args

Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wp-stateless.4.1.2

apply_filters('wp_stateless_add_media_args') is found 3 times:

  • /lib/classes/class-gs-client.php line 203
              $object_id = isset($args['metadata']['object-id']) ? $args['metadata']['object-id'] : (isset($args['metadata']['child-of']) ? $args['metadata']['child-of'] : "");
              $object_size = isset($args['metadata']['size']) ? $args['metadata']['size'] : "";
    
              $args['name'] = apply_filters('wp_stateless_file_name', $args['name'], $args['use_root'], $object_id, $object_size);
              $args = apply_filters('wp_stateless_add_media_args', $args);
              $name = $args['name'];
    
              // If media exists we just return it
              if (!$args['force'] && $media = $this->media_exists($name)) {
                if ($media->getCacheControl() != $args['cacheControl']) {
                  $media->setCacheControl($args['cacheControl']);
    
  • /lib/classes/class-sync-non-media.php line 150
                  ),
                  'is_webp' => '',
                ));
    
                $args = apply_filters('wp_stateless_add_media_args', $args);
    
                /**
                 * Updating object metadata, ACL, CacheControl and contentDisposition
                 * @return media object
                 */
                try {
    
  • /lib/classes/class-utility.php line 317
                      'mimeType' => 'image/jpeg',
                      'metadata' => array(),
                      'is_webp' => '',
                    ));
                    $media_args = apply_filters('wp_stateless_add_media_args', $media_args);
    
                    //Bucket
                    $bucket = ud_get_stateless_media()->get('sm.bucket');
    
                    $bucket = $gs_client->bucket($bucket);
                    $object = $bucket->object($media_args['name']);
    

See this hook used in plugins: