Plugin Directory

Changeset 2940393


Ignore:
Timestamp:
07/19/2023 01:20:02 PM (3 years ago)
Author:
billerickson
Message:

tagging version 1.7.0

Location:
be-media-from-production
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • be-media-from-production/tags/1.7.0/README.md

    r2294461 r2940393  
    33Contributors: billerickson,magicroundabout 
    44Requires at least: 4.3
    5 Tested up to: 5.4 
    6 Stable tag: 1.6.0 
     5Tested up to: 6.3 
     6Stable tag: 1.7.0 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    4343```
    4444
    45 ## Using with WP Migrate DB Pro
     45## Using with WP Migrate
    4646
    47 [WP Migrate DB Pro](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environemnts along with the database.
     47[WP Migrate](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environemnts along with the database.
    4848
    4949When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.
  • be-media-from-production/tags/1.7.0/be-media-from-production.php

    r2294461 r2940393  
    66 * Author:      Bill Erickson
    77 * Author URI:  http://www.billerickson.net
    8  * Version:     1.6.0
     8 * Version:     1.7.0
    99 * Text Domain: be-media-from-production
    1010 * Domain Path: languages
     
    8080
    8181        // Update Image URLs
    82         add_filter( 'wp_get_attachment_image_src',        array( $this, 'image_src'              )     );
    83         add_filter( 'wp_get_attachment_image_attributes', array( $this, 'image_attr'             ), 99 );
     82        add_filter( 'wp_get_attachment_image_src',        array( $this, 'image_src'              )        );
     83        add_filter( 'wp_get_attachment_image_attributes', array( $this, 'image_attr'             ), 99    );
    8484        add_filter( 'wp_prepare_attachment_for_js',       array( $this, 'image_js'               ), 10, 3 );
    85         add_filter( 'the_content',                        array( $this, 'image_content'          )     );
    86         add_filter( 'wp_get_attachment_url',              array( $this, 'update_image_url'       )     );
     85        add_filter( 'wp_content_img_tag',                 array( $this, 'image_tag'              ), 10, 3 );
     86        add_filter( 'the_content',                        array( $this, 'image_content'          )        );
     87        add_filter( 'wp_get_attachment_url',              array( $this, 'update_image_url'       )        );
     88        add_filter( 'the_post',                           array( $this, 'update_post_content'    )        );
    8789
    8890    }
     
    146148
    147149    /**
     150     * Modify Image Tags
     151     *
     152     * @since 1.7.0
     153     * @param string $filtered_image Full img tag with attributes that will replace the source img tag.
     154     * @param string $context        Additional context, like the current filter name or the function name from where this was called.
     155     * @param int    $attachment_id  The image attachment ID. May be 0 in case the image is not an attachment.
     156     */
     157    function image_tag( $filtered_image, $context, $attachment_id ) {
     158        $upload_locations = wp_upload_dir();
     159
     160        $regex = '/https?\:\/\/[^\" ]+/i';
     161        preg_match_all($regex, $filtered_image, $matches);
     162
     163        foreach( $matches[0] as $url ) {
     164            if( false !== strpos( $url, $upload_locations[ 'baseurl' ] ) ) {
     165                $new_url = $this->update_image_url( $url );
     166                $filtered_image = str_replace( $url, $new_url, $filtered_image );
     167            }
     168        }
     169
     170        return $filtered_image;
     171    }
     172
     173    /**
    148174     * Modify Images in Content
    149175     *
     
    216242
    217243    /**
     244     * Update Post Content
     245     */
     246    function update_post_content( $post ) {
     247        $post->post_content = $this->image_content( $post->post_content );
     248        return $post;
     249    }
     250
     251    /**
    218252     * Return the production URL
    219253     *
  • be-media-from-production/tags/1.7.0/readme.txt

    r2788729 r2940393  
    33Tags: image, images, media, staging, local, development
    44Requires at least: 4.3
    5 Tested up to: 6.1
    6 Stable tag: 1.6.0
     5Tested up to: 6.3
     6Stable tag: 1.7.0
    77
    88For developers - Uses local media when available, and uses the production server for the rest.
     
    4040```
    4141
    42 **Using with WP Migrate DB Pro**
     42**Using with WP Migrate**
    4343
    44 [WP Migrate DB Pro](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environments along with the database.
     44[WP Migrate](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environments along with the database.
    4545
    4646When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.
  • be-media-from-production/trunk/README.md

    r2294461 r2940393  
    33Contributors: billerickson,magicroundabout 
    44Requires at least: 4.3
    5 Tested up to: 5.4 
    6 Stable tag: 1.6.0 
     5Tested up to: 6.3 
     6Stable tag: 1.7.0 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    4343```
    4444
    45 ## Using with WP Migrate DB Pro
     45## Using with WP Migrate
    4646
    47 [WP Migrate DB Pro](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environemnts along with the database.
     47[WP Migrate](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environemnts along with the database.
    4848
    4949When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.
  • be-media-from-production/trunk/be-media-from-production.php

    r2294461 r2940393  
    66 * Author:      Bill Erickson
    77 * Author URI:  http://www.billerickson.net
    8  * Version:     1.6.0
     8 * Version:     1.7.0
    99 * Text Domain: be-media-from-production
    1010 * Domain Path: languages
     
    8080
    8181        // Update Image URLs
    82         add_filter( 'wp_get_attachment_image_src',        array( $this, 'image_src'              )     );
    83         add_filter( 'wp_get_attachment_image_attributes', array( $this, 'image_attr'             ), 99 );
     82        add_filter( 'wp_get_attachment_image_src',        array( $this, 'image_src'              )        );
     83        add_filter( 'wp_get_attachment_image_attributes', array( $this, 'image_attr'             ), 99    );
    8484        add_filter( 'wp_prepare_attachment_for_js',       array( $this, 'image_js'               ), 10, 3 );
    85         add_filter( 'the_content',                        array( $this, 'image_content'          )     );
    86         add_filter( 'wp_get_attachment_url',              array( $this, 'update_image_url'       )     );
     85        add_filter( 'wp_content_img_tag',                 array( $this, 'image_tag'              ), 10, 3 );
     86        add_filter( 'the_content',                        array( $this, 'image_content'          )        );
     87        add_filter( 'wp_get_attachment_url',              array( $this, 'update_image_url'       )        );
     88        add_filter( 'the_post',                           array( $this, 'update_post_content'    )        );
    8789
    8890    }
     
    146148
    147149    /**
     150     * Modify Image Tags
     151     *
     152     * @since 1.7.0
     153     * @param string $filtered_image Full img tag with attributes that will replace the source img tag.
     154     * @param string $context        Additional context, like the current filter name or the function name from where this was called.
     155     * @param int    $attachment_id  The image attachment ID. May be 0 in case the image is not an attachment.
     156     */
     157    function image_tag( $filtered_image, $context, $attachment_id ) {
     158        $upload_locations = wp_upload_dir();
     159
     160        $regex = '/https?\:\/\/[^\" ]+/i';
     161        preg_match_all($regex, $filtered_image, $matches);
     162
     163        foreach( $matches[0] as $url ) {
     164            if( false !== strpos( $url, $upload_locations[ 'baseurl' ] ) ) {
     165                $new_url = $this->update_image_url( $url );
     166                $filtered_image = str_replace( $url, $new_url, $filtered_image );
     167            }
     168        }
     169
     170        return $filtered_image;
     171    }
     172
     173    /**
    148174     * Modify Images in Content
    149175     *
     
    216242
    217243    /**
     244     * Update Post Content
     245     */
     246    function update_post_content( $post ) {
     247        $post->post_content = $this->image_content( $post->post_content );
     248        return $post;
     249    }
     250
     251    /**
    218252     * Return the production URL
    219253     *
  • be-media-from-production/trunk/readme.txt

    r2788729 r2940393  
    33Tags: image, images, media, staging, local, development
    44Requires at least: 4.3
    5 Tested up to: 6.1
    6 Stable tag: 1.6.0
     5Tested up to: 6.3
     6Stable tag: 1.7.0
    77
    88For developers - Uses local media when available, and uses the production server for the rest.
     
    4040```
    4141
    42 **Using with WP Migrate DB Pro**
     42**Using with WP Migrate**
    4343
    44 [WP Migrate DB Pro](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environments along with the database.
     44[WP Migrate](https://www.billerickson.net/go/wp-migrate-db-pro) is my preferred tool for pushing/pulling databases between environments. The Media addon allows you transfer media between environments along with the database.
    4545
    4646When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.
Note: See TracChangeset for help on using the changeset viewer.