Changeset 3778423
- Timestamp:
- 11/01/2026 06:44:01 PM (3 hours ago)
- Location:
- planbatch/trunk
- Files:
-
- 3 edited
-
assets/bulk.js (modified) (8 diffs)
-
planbatch.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
planbatch/trunk/assets/bulk.js
r3778272 r3778423 1040 1040 1041 1041 /** 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 /** 1042 1053 * One tab per network, holding that network's caption and first comment together, for a post 1043 1054 * whose text differs per network (an AI import writes it that way). Two stacked lists of six put … … 1046 1057 function networkTabs( entry ) { 1047 1058 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; 1053 1061 } ); 1054 1062 if ( ! nets.length ) { … … 1200 1208 body.appendChild( tabs ); 1201 1209 } 1202 if ( ! state.captionPatterns) {1210 if ( ! patternNets( state.captionPatterns ).length ) { 1203 1211 body.appendChild( heading( PP.caption || '' ) ); 1204 1212 var caption = document.createElement( 'textarea' ); … … 1220 1228 } 1221 1229 1222 if ( ! state.commentPatterns) {1230 if ( ! patternNets( state.commentPatterns ).length ) { 1223 1231 body.appendChild( heading( PP.comment || '' ) ); 1224 1232 var comment = document.createElement( 'textarea' ); … … 1462 1470 if ( s.captionPatterns ) { 1463 1471 o.caption_patterns = s.captionPatterns; 1464 } else if ( s.caption.trim() !== '' ) { 1472 } 1473 if ( s.caption.trim() !== '' ) { 1465 1474 o.caption = s.caption; 1466 1475 } 1467 1476 if ( s.commentPatterns ) { 1468 1477 o.first_comment_patterns = s.commentPatterns; 1469 } else if ( s.comment !== null ) { 1478 } 1479 if ( s.comment !== null ) { 1470 1480 o.first_comment = s.comment; 1471 1481 } … … 1499 1509 function normalUrl( u ) { 1500 1510 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;1514 1511 } 1515 1512 … … 1639 1636 1640 1637 function syncSlideChoice() { 1641 var copy = slideChoiceCopy( promptPlatforms() );1638 var copy = slideChoiceCopy( batchPlatforms() ); 1642 1639 slideChoice.style.display = copy && isBranded() ? '' : 'none'; 1643 1640 if ( copy ) { … … 1775 1772 only_template_ids: allowedIds.length < pool.length ? allowedIds.join( ',' ) : '', 1776 1773 mode: isBranded() ? 'branded' : 'link', 1777 platforms: promptPlatforms().join( ',' ),1774 platforms: batchPlatforms().join( ',' ), 1778 1775 slides_per_network: perNetwork && 'none' !== slideChoice.style.display ? '1' : '' 1779 1776 } ).then( function ( data ) { -
planbatch/trunk/planbatch.php
r3778272 r3778423 4 4 * Plugin URI: https://planbatch.com/wordpress 5 5 * 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. 196 * Version: 1.0.20 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 … … 18 18 } 19 19 20 define( 'PLANBATCH_VERSION', '1.0. 19' );20 define( 'PLANBATCH_VERSION', '1.0.20' ); 21 21 define( 'PLANBATCH_PLUGIN_FILE', __FILE__ ); 22 22 define( 'PLANBATCH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
planbatch/trunk/readme.txt
r3778272 r3778423 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 197 Stable tag: 1.0.20 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 114 114 == Upgrade Notice == 115 115 116 = 1.0.20 = 117 The AI prompt and the caption tabs list only the networks this batch publishes to. 118 116 119 = 1.0.19 = 117 120 An AI import asks before replacing posts you already changed, and the post preview no longer draws empty boxes for an empty icon or emoji. … … 175 178 176 179 == 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. 177 184 178 185 = 1.0.19 =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)