Plugin Directory

Changeset 3778423


Ignore:
Timestamp:
11/01/2026 06:44:01 PM (3 hours ago)
Author:
siaccslv
Message:

Release 1.0.20

Location:
planbatch/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • planbatch/trunk/assets/bulk.js

    r3778272 r3778423  
    10401040
    10411041        /**
     1042         * The batch's networks that a per-network map writes for, in LABELS order. Text written for a
     1043         * network the batch is not going to stays in the map, hidden, and returns if it is ticked.
     1044         */
     1045        function patternNets( map ) {
     1046                var batchNets = batchPlatforms();
     1047                return map ? Object.keys( LABELS ).filter( function ( slug ) {
     1048                        return batchNets.indexOf( slug ) !== -1 && undefined !== map[ slug ];
     1049                } ) : [];
     1050        }
     1051
     1052        /**
    10421053         * One tab per network, holding that network's caption and first comment together, for a post
    10431054         * whose text differs per network (an AI import writes it that way). Two stacked lists of six put
    … …  
    10461057        function networkTabs( entry ) {
    10471058                var s = entry.state;
    1048                 if ( ! s.captionPatterns && ! s.commentPatterns ) {
    1049                         return null;
    1050                 }
    1051                 var nets = Object.keys( LABELS ).filter( function ( slug ) {
    1052                         return ( s.captionPatterns && undefined !== s.captionPatterns[ slug ] ) || ( s.commentPatterns && undefined !== s.commentPatterns[ slug ] );
     1059                var nets = patternNets( s.captionPatterns ).concat( patternNets( s.commentPatterns ) ).filter( function ( slug, i, all ) {
     1060                        return all.indexOf( slug ) === i;
    10531061                } );
    10541062                if ( ! nets.length ) {
    … …  
    12001208                        body.appendChild( tabs );
    12011209                }
    1202                 if ( ! state.captionPatterns ) {
     1210                if ( ! patternNets( state.captionPatterns ).length ) {
    12031211                        body.appendChild( heading( PP.caption || '' ) );
    12041212                        var caption = document.createElement( 'textarea' );
    … …  
    12201228                }
    12211229
    1222                 if ( ! state.commentPatterns ) {
     1230                if ( ! patternNets( state.commentPatterns ).length ) {
    12231231                        body.appendChild( heading( PP.comment || '' ) );
    12241232                        var comment = document.createElement( 'textarea' );
    … …  
    14621470                        if ( s.captionPatterns ) {
    14631471                                o.caption_patterns = s.captionPatterns;
    1464                         } else if ( s.caption.trim() !== '' ) {
     1472                        }
     1473                        if ( s.caption.trim() !== '' ) {
    14651474                                o.caption = s.caption;
    14661475                        }
    14671476                        if ( s.commentPatterns ) {
    14681477                                o.first_comment_patterns = s.commentPatterns;
    1469                         } else if ( s.comment !== null ) {
     1478                        }
     1479                        if ( s.comment !== null ) {
    14701480                                o.first_comment = s.comment;
    14711481                        }
    … …  
    14991509        function normalUrl( u ) {
    15001510                return String( u || '' ).trim().replace( /[?#].*$/, '' ).replace( /\/+$/, '' ).toLowerCase();
    1501         }
    1502 
    1503         /** The networks the prompt writes for: the batch's, plus any a post chose for itself. */
    1504         function promptPlatforms() {
    1505                 var out = batchPlatforms();
    1506                 Object.keys( entries ).forEach( function ( id ) {
    1507                         ( entries[ id ].state.platforms || [] ).forEach( function ( p ) {
    1508                                 if ( out.indexOf( p ) < 0 ) {
    1509                                         out.push( p );
    1510                                 }
    1511                         } );
    1512                 } );
    1513                 return out;
    15141511        }
    15151512
    … …  
    16391636
    16401637                function syncSlideChoice() {
    1641                         var copy = slideChoiceCopy( promptPlatforms() );
     1638                        var copy = slideChoiceCopy( batchPlatforms() );
    16421639                        slideChoice.style.display = copy && isBranded() ? '' : 'none';
    16431640                        if ( copy ) {
    … …  
    17751772                                only_template_ids: allowedIds.length < pool.length ? allowedIds.join( ',' ) : '',
    17761773                                mode: isBranded() ? 'branded' : 'link',
    1777                                 platforms: promptPlatforms().join( ',' ),
     1774                                platforms: batchPlatforms().join( ',' ),
    17781775                                slides_per_network: perNetwork && 'none' !== slideChoice.style.display ? '1' : ''
    17791776                        } ).then( function ( data ) {
  • planbatch/trunk/planbatch.php

    r3778272 r3778423  
    44 * Plugin URI: https://planbatch.com/wordpress
    55 * Description: Turn published posts into branded social images from your own templates, and schedule them to your connected channels through your PlanBatch account.
    6  * Version: 1.0.19
     6 * Version: 1.0.20
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
    … …  
    1818}
    1919
    20 define( 'PLANBATCH_VERSION', '1.0.19' );
     20define( 'PLANBATCH_VERSION', '1.0.20' );
    2121define( 'PLANBATCH_PLUGIN_FILE', __FILE__ );
    2222define( 'PLANBATCH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • planbatch/trunk/readme.txt

    r3778272 r3778423  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.19
     7Stable tag: 1.0.20
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    114114== Upgrade Notice ==
    115115
     116= 1.0.20 =
     117The AI prompt and the caption tabs list only the networks this batch publishes to.
     118
    116119= 1.0.19 =
    117120An AI import asks before replacing posts you already changed, and the post preview no longer draws empty boxes for an empty icon or emoji.
    … …  
    175178
    176179== Changelog ==
     180
     181= 1.0.20 =
     182* Fixed: the AI prompt asked for captions for networks a post had chosen earlier but the batch was not publishing to. It now lists only the networks ticked for the batch.
     183* Fixed: each post showed a caption tab for every network the imported file wrote for. Tabs now follow the networks ticked for the batch, and text for an unticked network comes back when you tick it.
    177184
    178185= 1.0.19 =
Note: See TracChangeset for help on using the changeset viewer.