Plugin Directory

Changeset 3396957


Ignore:
Timestamp:
11/17/2025 07:34:02 AM (4 months ago)
Author:
socialpostflow
Message:

Update to version 1.1.1 from GitHub

Location:
social-post-flow
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • social-post-flow/tags/1.1.1/includes/class-social-post-flow-admin.php

    r3385265 r3396957  
    637637        // Post Types.
    638638        $post_types_public = social_post_flow()->get_class( 'common' )->get_post_types();
    639         $post_types        = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
    640             $post_types_public,
    641             wp_get_current_user()->roles[0]
    642         );
     639        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     640            $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
     641                $post_types_public,
     642                wp_get_current_user()->roles[0]
     643            );
     644        } else {
     645            $post_types = $post_types_public;
     646        }
    643647
    644648        // Depending on the screen we're on, load specific options.
     
    705709            default:
    706710                // Run profiles through role restriction.
    707                 $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     711                if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     712                    $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     713                }
    708714
    709715                // Get original statuses that will be stored in a hidden field so they are preserved if the screen is saved
  • social-post-flow/tags/1.1.1/includes/class-social-post-flow-log.php

    r3346110 r3396957  
    318318
    319319        // Check if we need to hide the meta box by the logged in User's role.
    320         $hide_meta_box = social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' );
    321 
    322         // Bail if we're hiding the meta boxes for the logged in User's role.
    323         if ( $hide_meta_box ) {
    324             return;
     320        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     321            // Bail if we're hiding the meta boxes for the logged in User's role.
     322            if ( social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' ) ) {
     323                return;
     324            }
    325325        }
    326326
  • social-post-flow/tags/1.1.1/includes/class-social-post-flow-post.php

    r3344663 r3396957  
    116116
    117117        // Check if we need to hide the meta box by the logged in User's role.
    118         $hide_meta_box = social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' );
    119 
    120         // Bail if we're hiding the meta boxes for the logged in User's role.
    121         if ( $hide_meta_box ) {
    122             return;
     118        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     119            // Bail if we're hiding the meta boxes for the logged in User's role.
     120            if ( social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' ) ) {
     121                return;
     122            }
    123123        }
    124124
    125125        // Get Post Types.
    126         $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
    127             social_post_flow()->get_class( 'common' )->get_post_types(),
    128             wp_get_current_user()->roles[0]
    129         );
     126        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     127            $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
     128                social_post_flow()->get_class( 'common' )->get_post_types(),
     129                wp_get_current_user()->roles[0]
     130            );
     131        } else {
     132            $post_types = social_post_flow()->get_class( 'common' )->get_post_types();
     133        }
    130134
    131135        $title = esc_html__( 'Social Post Flow: Featured and Additional Images', 'social-post-flow' );
     
    191195        // Run profiles through role restriction.
    192196        if ( ! is_wp_error( $profiles ) ) {
    193             $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     197            if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     198                $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     199            }
    194200        }
    195201
  • social-post-flow/tags/1.1.1/readme.txt

    r3386306 r3396957  
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 1.1.0
     8Stable tag: 1.1.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    435435== Changelog ==
    436436
     437= 1.1.1 (2025-11-17) =
     438* Fix: Logs: PHP Warning: Undefined array key `0`
     439
    437440= 1.1.0 (2025-10-29) =
    438441* Removed: Settings: Status: Add Profile link, as it resulted in settings failing to save
  • social-post-flow/tags/1.1.1/social-post-flow.php

    r3386306 r3396957  
    99 * Plugin Name: Social Post Flow
    1010 * Plugin URI: http://www.socialpostflow.com/integrations/wordpress
    11  * Version: 1.1.0
     11 * Version: 1.1.1
    1212 * Author: Social Post Flow
    1313 * Author URI: http://www.socialpostflow.com
     
    2828
    2929// Define Plugin version and build date.
    30 define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.1.0' );
    31 define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2025-10-29 12:00:00' );
     30define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.1.1' );
     31define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2025-11-17 12:00:00' );
    3232
    3333// Define Plugin paths.
  • social-post-flow/trunk/includes/class-social-post-flow-admin.php

    r3385265 r3396957  
    637637        // Post Types.
    638638        $post_types_public = social_post_flow()->get_class( 'common' )->get_post_types();
    639         $post_types        = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
    640             $post_types_public,
    641             wp_get_current_user()->roles[0]
    642         );
     639        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     640            $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
     641                $post_types_public,
     642                wp_get_current_user()->roles[0]
     643            );
     644        } else {
     645            $post_types = $post_types_public;
     646        }
    643647
    644648        // Depending on the screen we're on, load specific options.
     
    705709            default:
    706710                // Run profiles through role restriction.
    707                 $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     711                if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     712                    $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     713                }
    708714
    709715                // Get original statuses that will be stored in a hidden field so they are preserved if the screen is saved
  • social-post-flow/trunk/includes/class-social-post-flow-log.php

    r3346110 r3396957  
    318318
    319319        // Check if we need to hide the meta box by the logged in User's role.
    320         $hide_meta_box = social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' );
    321 
    322         // Bail if we're hiding the meta boxes for the logged in User's role.
    323         if ( $hide_meta_box ) {
    324             return;
     320        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     321            // Bail if we're hiding the meta boxes for the logged in User's role.
     322            if ( social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' ) ) {
     323                return;
     324            }
    325325        }
    326326
  • social-post-flow/trunk/includes/class-social-post-flow-post.php

    r3344663 r3396957  
    116116
    117117        // Check if we need to hide the meta box by the logged in User's role.
    118         $hide_meta_box = social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' );
    119 
    120         // Bail if we're hiding the meta boxes for the logged in User's role.
    121         if ( $hide_meta_box ) {
    122             return;
     118        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     119            // Bail if we're hiding the meta boxes for the logged in User's role.
     120            if ( social_post_flow()->get_class( 'settings' )->get_setting( 'hide_meta_box_by_roles', '[' . wp_get_current_user()->roles[0] . ']' ) ) {
     121                return;
     122            }
    123123        }
    124124
    125125        // Get Post Types.
    126         $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
    127             social_post_flow()->get_class( 'common' )->get_post_types(),
    128             wp_get_current_user()->roles[0]
    129         );
     126        if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     127            $post_types = social_post_flow()->get_class( 'common' )->maybe_remove_post_types_by_role(
     128                social_post_flow()->get_class( 'common' )->get_post_types(),
     129                wp_get_current_user()->roles[0]
     130            );
     131        } else {
     132            $post_types = social_post_flow()->get_class( 'common' )->get_post_types();
     133        }
    130134
    131135        $title = esc_html__( 'Social Post Flow: Featured and Additional Images', 'social-post-flow' );
     
    191195        // Run profiles through role restriction.
    192196        if ( ! is_wp_error( $profiles ) ) {
    193             $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     197            if ( wp_get_current_user() && is_array( wp_get_current_user()->roles ) && ! empty( wp_get_current_user()->roles ) ) {
     198                $profiles = social_post_flow()->get_class( 'common' )->maybe_remove_profiles_by_role( $profiles, wp_get_current_user()->roles[0] );
     199            }
    194200        }
    195201
  • social-post-flow/trunk/readme.txt

    r3386306 r3396957  
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 1.1.0
     8Stable tag: 1.1.1
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    435435== Changelog ==
    436436
     437= 1.1.1 (2025-11-17) =
     438* Fix: Logs: PHP Warning: Undefined array key `0`
     439
    437440= 1.1.0 (2025-10-29) =
    438441* Removed: Settings: Status: Add Profile link, as it resulted in settings failing to save
  • social-post-flow/trunk/social-post-flow.php

    r3386306 r3396957  
    99 * Plugin Name: Social Post Flow
    1010 * Plugin URI: http://www.socialpostflow.com/integrations/wordpress
    11  * Version: 1.1.0
     11 * Version: 1.1.1
    1212 * Author: Social Post Flow
    1313 * Author URI: http://www.socialpostflow.com
     
    2828
    2929// Define Plugin version and build date.
    30 define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.1.0' );
    31 define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2025-10-29 12:00:00' );
     30define( 'SOCIAL_POST_FLOW_PLUGIN_VERSION', '1.1.1' );
     31define( 'SOCIAL_POST_FLOW_PLUGIN_BUILD_DATE', '2025-11-17 12:00:00' );
    3232
    3333// Define Plugin paths.
Note: See TracChangeset for help on using the changeset viewer.