PHP code example of masonitedoors / widen-media

1. Go to this page and download the library: Download masonitedoors/widen-media library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

masonitedoors / widen-media example snippets


define( 'WIDEN_MEDIA_ACCESS_TOKEN', 'my-widen-api-token' );

function filter_defined_image_sizes( $default_image_sizes ) {
  $sizes = [
    'banner-sm' => [
      'label'  => __( 'Small Banner', 'textdomain' ),
      'width'  => 820,
      'height' => 312,
    ],
    'banner-lg' => [
      'label'  => __( 'Large Banner', 'textdomain' ),
      'width'  => 1500,
      'height' => 500,
    ],
  ];

  // Uncomment to append sizes to the plugin's already defined sizes.
  // $sizes = array_merge( $sizes, $default_image_sizes );

  return $sizes;
}
add_filter( 'wm_defined_image_sizes', 'filter_defined_image_sizes', 10, 1 );