Skip to content

Commit c218daa

Browse files
authored
Merge pull request #17 from n7studios/release-1.3.3
1.3.3
2 parents 6779f95 + b7dcc99 commit c218daa

9 files changed

Lines changed: 160 additions & 54 deletions

assets/js/min/statuses-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/statuses.js

Lines changed: 121 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -554,25 +554,98 @@ function socialPostFlowUpdateImageOptions() {
554554
$(social_post_flow.status_form)
555555
).val();
556556

557-
// Hide additional and text to image options.
557+
// Hide additional images, limit and text to image options.
558558
$(
559-
'tr.additional-images, tr.text-to-image',
559+
'tr.additional-images, tr.additional-images-limit, tr.text-to-image',
560560
$(social_post_flow.status_form)
561561
).hide();
562562

563-
// Show additional and text to image options, based on the selected image option.
564-
$(
565-
'tr.additional-images, tr.text-to-image',
563+
switch (selected_image_option) {
564+
case 'featured_image':
565+
$(
566+
'tr.additional-images',
567+
$(social_post_flow.status_form)
568+
).show();
569+
$(
570+
'tr.additional-images-limit',
571+
$(social_post_flow.status_form)
572+
).show();
573+
break;
574+
case 'text_to_image':
575+
$('tr.text-to-image', $(social_post_flow.status_form)).show();
576+
break;
577+
}
578+
579+
// Enable options based on the Post Type.
580+
const post_type = $(
581+
'select.post_type',
566582
$(social_post_flow.status_form)
567-
).each(function () {
568-
const conditionalValues = $(this)
569-
.data('conditional-value')
570-
.toString()
571-
.split(','); // .toString() prevents errors when splitting a single integer e.g. 2.
572-
if (conditionalValues.indexOf(selected_image_option) !== -1) {
573-
$(this).show();
574-
}
575-
});
583+
).val();
584+
switch (post_type) {
585+
case 'image':
586+
// Enable all options in Additional Images.
587+
$(
588+
'option',
589+
$(
590+
'select.additional-images',
591+
$(social_post_flow.status_form)
592+
)
593+
).attr('disabled', false);
594+
break;
595+
596+
case 'story':
597+
case 'pin':
598+
case 'google':
599+
// Disable all options in Additional Images.
600+
$(
601+
'option',
602+
$(
603+
'select.additional-images',
604+
$(social_post_flow.status_form)
605+
)
606+
).attr('disabled', true);
607+
608+
// Enable the "None" Additional Images option.
609+
$(
610+
'option[value=""]',
611+
$(
612+
'select.additional-images',
613+
$(social_post_flow.status_form)
614+
)
615+
).attr('disabled', false);
616+
617+
// Hide the row.
618+
$(
619+
'tr.additional-images',
620+
$(social_post_flow.status_form)
621+
).hide();
622+
$(
623+
'tr.additional-images-limit',
624+
$(social_post_flow.status_form)
625+
).hide();
626+
break;
627+
}
628+
})(jQuery);
629+
}
630+
631+
function socialPostFlowUpdateAdditionalImagesLimitOption() {
632+
(function ($) {
633+
// Hide Limit option.
634+
$('tr.additional-images-limit', $(social_post_flow.status_form)).hide();
635+
636+
// Show Limit option if Additional Images has more than one option that is enabled
637+
// i.e. "None" and other option(s) enabled by socialPostFlowUpdateImageOptions().
638+
if (
639+
$(
640+
'option:enabled',
641+
$('select.additional-images', $(social_post_flow.status_form))
642+
).length > 1
643+
) {
644+
$(
645+
'tr.additional-images-limit',
646+
$(social_post_flow.status_form)
647+
).show();
648+
}
576649
})(jQuery);
577650
}
578651

@@ -611,6 +684,25 @@ function socialPostFlowUpdatePostTypeOptions(profile) {
611684
).attr('disabled', false);
612685
break;
613686

687+
case 'google':
688+
$(
689+
'option[value="text"]',
690+
$('select.post_type', $(social_post_flow.status_form))
691+
).attr('disabled', false);
692+
$(
693+
'option[value="link"]',
694+
$('select.post_type', $(social_post_flow.status_form))
695+
).attr('disabled', false);
696+
$(
697+
'option[value="image"]',
698+
$('select.post_type', $(social_post_flow.status_form))
699+
).attr('disabled', false);
700+
$(
701+
'option[value="google"]',
702+
$('select.post_type', $(social_post_flow.status_form))
703+
).attr('disabled', false);
704+
break;
705+
614706
default:
615707
$(
616708
'option[value="text"]',
@@ -669,6 +761,7 @@ function socialPostFlowUpdateStatusSections() {
669761
break;
670762

671763
case 'pin':
764+
case 'google':
672765
$('.link', $(social_post_flow.status_form)).show();
673766
$('.images', $(social_post_flow.status_form)).show();
674767
break;
@@ -753,6 +846,9 @@ function socialPostFlowEditStatus(
753846
// Update image options.
754847
socialPostFlowUpdateImageOptions();
755848

849+
// Update additional images limit option.
850+
socialPostFlowUpdateAdditionalImagesLimitOption();
851+
756852
// Update status sections to display, depending on the status' post type.
757853
socialPostFlowUpdateStatusSections();
758854

@@ -1793,6 +1889,8 @@ jQuery(document).ready(function ($) {
17931889
'select.post_type',
17941890
function () {
17951891
socialPostFlowUpdateStatusSections();
1892+
socialPostFlowUpdateImageOptions();
1893+
socialPostFlowUpdateAdditionalImagesLimitOption();
17961894
}
17971895
);
17981896

@@ -1816,6 +1914,15 @@ jQuery(document).ready(function ($) {
18161914
}
18171915
);
18181916

1917+
// Additional Images dropdown.
1918+
$(social_post_flow.status_form).on(
1919+
'change.' + social_post_flow.status_form,
1920+
'select.additional-images',
1921+
function () {
1922+
socialPostFlowUpdateAdditionalImagesLimitOption();
1923+
}
1924+
);
1925+
18191926
/**
18201927
* Enable/Disable Profile or Action
18211928
*/

includes/class-social-post-flow-api.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Social_Post_Flow_API {
2121
*
2222
* @var string.
2323
*/
24-
private $app_endpoint = 'https://app.socialpostflow.com/';
24+
private $app_endpoint = 'https://socialpostflow.local';
2525

2626
/**
2727
* Holds the API endpoint
@@ -30,7 +30,7 @@ class Social_Post_Flow_API {
3030
*
3131
* @var string.
3232
*/
33-
private $api_endpoint = 'https://app.socialpostflow.com/api/';
33+
private $api_endpoint = 'https://socialpostflow.local/api/';
3434

3535
/**
3636
* Holds the OAuth Authorize URL
@@ -39,7 +39,7 @@ class Social_Post_Flow_API {
3939
*
4040
* @var string.
4141
*/
42-
private $oauth_authorize_url = 'https://app.socialpostflow.com/oauth/authorize';
42+
private $oauth_authorize_url = 'https://socialpostflow.local/oauth/authorize';
4343

4444
/**
4545
* Holds the OAuth Redirect URL
@@ -48,7 +48,7 @@ class Social_Post_Flow_API {
4848
*
4949
* @var string.
5050
*/
51-
private $oauth_redirect_uri = 'https://app.socialpostflow.com/oauth/callback';
51+
private $oauth_redirect_uri = 'https://socialpostflow.local/oauth/callback';
5252

5353
/**
5454
* Holds the OAuth Token URL
@@ -57,7 +57,7 @@ class Social_Post_Flow_API {
5757
*
5858
* @var string.
5959
*/
60-
private $oauth_token_url = 'https://app.socialpostflow.com/oauth/token';
60+
private $oauth_token_url = 'https://socialpostflow.local/oauth/token';
6161

6262
/**
6363
* Holds the OAuth Client ID

includes/class-social-post-flow-common.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ public function get_status_post_type_options() {
5959

6060
// Build status post type options.
6161
$status_post_type_options = array(
62-
'text' => __( 'Text', 'social-post-flow' ),
63-
'link' => __( 'Link', 'social-post-flow' ),
64-
'image' => __( 'Image', 'social-post-flow' ),
65-
'story' => __( 'Story', 'social-post-flow' ),
66-
'pin' => __( 'Pin', 'social-post-flow' ),
62+
'text' => __( 'Text', 'social-post-flow' ),
63+
'link' => __( 'Link', 'social-post-flow' ),
64+
'image' => __( 'Image', 'social-post-flow' ),
65+
'story' => __( 'Story', 'social-post-flow' ),
66+
'pin' => __( 'Pin', 'social-post-flow' ),
67+
'google' => __( 'Google Post', 'social-post-flow' ),
6768
);
6869

6970
/**

includes/class-social-post-flow-image.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,6 @@ public function get_status_image_options( $network = false, $post_type = false )
6666

6767
}
6868

69-
/**
70-
* Helper method to retrieve Additional Image Options that are supported by the given network and post type.
71-
*
72-
* @since 1.0.0
73-
*
74-
* @param bool $network Network (false = defaults).
75-
* @param string $post_type Post Type.
76-
* @return array Image Options
77-
*/
78-
public function get_status_image_options_supporting_additional_images( $network = false, $post_type = false ) {
79-
80-
return array_filter(
81-
$this->get_status_image_options( $network, $post_type ),
82-
function ( $option ) {
83-
return $option['additional_images'];
84-
}
85-
);
86-
87-
}
88-
8969
/**
9070
* Helper method to retrieve Text to Image Options that are supported by the given network and post type.
9171
*

includes/class-social-post-flow-publish.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,13 @@ private function build_args( $post, $profile_id, $service, $status, $action ) {
16031603
case 'pinterest':
16041604
$status['post_type'] = 'pin';
16051605
break;
1606+
1607+
/**
1608+
* Google: Change post type to `google`.
1609+
*/
1610+
case 'google':
1611+
$status['post_type'] = 'google';
1612+
break;
16061613
}
16071614

16081615
// Build API compatible arguments.
@@ -1623,6 +1630,7 @@ private function build_args( $post, $profile_id, $service, $status, $action ) {
16231630

16241631
default:
16251632
// First comment is supported for these services.
1633+
// Pinterest: uses this for the description field on the Pin.
16261634
$args['first_comment'] = $this->parse_text( $post, $status['first_comment'], ( $service === 'instagram' ? true : false ) );
16271635
break;
16281636
}
@@ -1643,8 +1651,10 @@ private function build_args( $post, $profile_id, $service, $status, $action ) {
16431651

16441652
/**
16451653
* Pinterest
1654+
* Google
16461655
*/
16471656
case 'pin':
1657+
case 'google':
16481658
// Get URL.
16491659
$url = $this->parse_text( $post, $status['url'] );
16501660

@@ -1669,6 +1679,7 @@ private function build_args( $post, $profile_id, $service, $status, $action ) {
16691679
// Image(s).
16701680
switch ( $args['post_type'] ) {
16711681
case 'pin':
1682+
case 'google':
16721683
case 'story':
16731684
case 'image':
16741685
switch ( $status['image'] ) {
@@ -2010,6 +2021,7 @@ private function get_additional_images( $post, $service, $status ) {
20102021
break;
20112022

20122023
case 'google':
2024+
case 'pinterest':
20132025
case 'telegram':
20142026
default:
20152027
// A network that does not support additional images.
@@ -2025,11 +2037,13 @@ private function get_additional_images( $post, $service, $status ) {
20252037
* Text
20262038
* Link
20272039
* Pin
2040+
* Google
20282041
* Story
20292042
*/
20302043
case 'text':
20312044
case 'link':
20322045
case 'pin':
2046+
case 'google':
20332047
case 'story':
20342048
// No additional images supported.
20352049
break;

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: auto post, social media, google business, instagram, linkedin
55
Requires at least: 6.0
66
Tested up to: 7.0
77
Requires PHP: 7.4
8-
Stable tag: 1.3.2
8+
Stable tag: 1.3.3
99
License: GPLv3 or later
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1111

@@ -450,6 +450,10 @@ Social Post Flow offers a 7-day free trial so you can test all features before p
450450

451451
== Changelog ==
452452

453+
= 1.3.3 (2026-05-23) =
454+
* Added: Status: Google Post Type. See Docs: https://www.socialpostflow.com/documentation/wordpress-plugin/status-configuration-and-types/#type
455+
* Fix: Status: Image: Additional Images: Don't permit selecting option when Post Type only supports a single image (Instagram Story, Pinterest Pin, Google Post). See Docs: https://www.socialpostflow.com/documentation/wordpress-plugin/image-statuses/
456+
453457
= 1.3.2 (2026-05-22) =
454458
* Added: Google Business Profile support
455459
* Fix: Status: First Comment: Don't display field if overriding status settings and the profile does not support this feature (Mastodon, Telegram, TikTok and Google)

social-post-flow.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @wordpress-plugin
99
* Plugin Name: Social Post Flow
1010
* Plugin URI: http://www.socialpostflow.com/integrations/wordpress
11-
* Version: 1.3.2
11+
* Version: 1.3.3
1212
* Author: Social Post Flow
1313
* Author URI: http://www.socialpostflow.com
1414
* Description: Send WordPress Pages, Posts or Custom Post Types to social media for scheduled publishing to social networks.
@@ -27,8 +27,8 @@
2727
}
2828

2929
// Define Plugin version and build date.
30-
define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.3.2' );
31-
define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-05-22 18:00:00' );
30+
define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.3.3' );
31+
define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2026-05-23 18:00:00' );
3232

3333
// Define Plugin paths.
3434
define( 'SOCIAL_POST_FLOW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

0 commit comments

Comments
 (0)