Plugin Directory

Changeset 2465320


Ignore:
Timestamp:
01/30/2021 12:11:54 AM (4 years ago)
Author:
gfirem
Message:

Release 1.2.6

Location:
buddyforms-attach-posts-to-groups-extension
Files:
74 added
5 edited

Legend:

Unmodified
Added
Removed
  • buddyforms-attach-posts-to-groups-extension/trunk/includes/functions.php

    r2421880 r2465320  
    144144
    145145    $groups_post_id = groups_get_groupmeta( $group_id, 'group_post_id' );
     146    if ( empty($groups_post_id) ) {
     147        return;
     148    }
     149
     150    remove_action( 'groups_before_delete_group', 'buddyforms_delete_a_group_post' );
    146151    wp_delete_post( $groups_post_id );
    147152}
  • buddyforms-attach-posts-to-groups-extension/trunk/includes/group-control.php

    r2421880 r2465320  
    249249}
    250250
    251 add_action( 'buddyforms_init', function () { new BuddyForms_GroupControl(); } );
    252 
     251new BuddyForms_GroupControl();
    253252
    254253function bf_get_attachment_thumbnail_path( $attachment_id = 0 ) {
  • buddyforms-attach-posts-to-groups-extension/trunk/includes/group-extension.php

    r2421880 r2465320  
    153153                    jQuery(".bf_show_aptg").click(function () {
    154154
    155                         jQuery(".bf_main_aptg").hide();
    156                         jQuery("#bf_aptg" + jQuery(this).attr("target")).show();
    157 
    158                         jQuery("li.current").removeClass("current");
    159                         jQuery(this).closest("li").addClass("current");
     155                        var url = window.location.href;
     156                        var base_url = url.split("?")[0];
     157
     158                        if ( jQuery(this).attr("id") === "edit-post-details" ) {
     159                            window.location.href = base_url + "?edit_post_group";
     160                        } else {
     161                            window.location.href = base_url;
     162                        }
    160163
    161164                        return false;
     
    167170            <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    168171                <ul>
    169                     <li id="view-post-details-groups-li" class="current"><a id="view-post-details" class="bf_show_aptg"
     172                    <li id="view-post-details-groups-li" class="<?php echo ! isset( $_GET['edit_post_group'] ) ? "current" : "" ?> "><a id="view-post-details" class="bf_show_aptg"
    170173                                                                            target="1"
    171174                                                                            href=" <?php $group_permalink ?>">View</a>
     
    173176
    174177                    <?php if ( $this->buddyforms_user_can ) { ?>
    175                         <li id="edit-post-details-groups-li"><a id="edit-post-details" class="bf_show_aptg" target="2"
     178                        <li id="edit-post-details-groups-li" class="<?php echo isset( $_GET['edit_post_group'] ) ? "current" : "" ?>"><a id="edit-post-details" class="bf_show_aptg" target="2"
    176179                                                                href="<?php get_edit_post_link( $attached_post_id ) ?>">Edit</a>
    177180                        </li>
     
    180183            </div>
    181184
    182             <div id="bf_aptg1"
    183                  class="bf_main_aptg"><?php buddyforms_ge_locate_template( 'buddyforms/groups/single-post.php' ) ?></div>
    184 
    185             <?php if ( $this->buddyforms_user_can ) { ?>
    186                 <div id="bf_aptg2" style="display: none;" class="bf_main_aptg">
    187                     <?php
    188                     $args = array(
    189                         'post_type' => $buddyforms[ $form_slug ]['post_type'],
    190                         'post_id'   => $attached_post_id,
    191                         'form_slug' => $form_slug,
    192                     );
    193 
    194                     echo buddyforms_create_edit_form( $args );
    195                     ?>
    196                 </div>
    197             <?php } ?>
     185            <?php if ( isset( $_GET['edit_post_group'] ) && $this->buddyforms_user_can ) : ?>
     186
     187            <div id="bf_aptg2" class="bf_main_aptg">
     188                <?php
     189                $args = array(
     190                    'post_type' => $buddyforms[ $form_slug ]['post_type'],
     191                    'post_id'   => $attached_post_id,
     192                    'form_slug' => $form_slug,
     193                );
     194
     195                echo buddyforms_create_edit_form( $args );
     196                ?>
     197            </div>
     198
     199            <?php else : ?>
     200
     201            <div id="bf_aptg1" class="bf_main_aptg">
     202                <?php buddyforms_ge_locate_template( 'buddyforms/groups/single-post.php' ) ?>
     203            </div>
     204
     205            <?php endif; ?>
     206
    198207            <?php
    199208            $tmp = ob_get_clean();
  • buddyforms-attach-posts-to-groups-extension/trunk/loader.php

    r2421880 r2465320  
    1010 * Requires at least: 3.9
    1111 * Tested up to: 5.0
    12  * Version: 1.2.5
     12 * Version: 1.2.6
    1313 * Author: ThemeKraft
    1414 * Author URI: https://themekraft.com/buddyforms/
     
    115115    public function load_constants()
    116116    {
    117         define( 'BuddyForms_Attach_Post_with_Group', '1.2.5' );
     117        define( 'BuddyForms_Attach_Post_with_Group', '1.2.6' );
    118118        if ( !defined( 'BUDDYFORMS_GE_INSTALL_PATH' ) ) {
    119119            define( 'BUDDYFORMS_GE_INSTALL_PATH', dirname( __FILE__ ) . '/' );
  • buddyforms-attach-posts-to-groups-extension/trunk/readme.txt

    r2421880 r2465320  
    44Plugin URI: http://buddyforms.com/downloads/attach-post-with-group/
    55Requires at least: 3.9
    6 Tested up to: 5.4
    7 Stable tag: 1.2.5
     6Tested up to: 5.6
     7Stable tag: 1.2.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898
    9999== Changelog ==
     100= 1.2.6 - 29 Jan 2021 =
     101* Fixed issue with BF ACF fields on the edit screen of the group post.
     102* Fix issue with the list items on the Post Group tab. The items aren't marked as current when interacting with them.
     103* Fix issue related to endless loop on the process deletion of group or post.
     104* Fixed Rance Condition on class BuddyForms_GroupControl loading.
     105
    100106= 1.2.5 - 19 Nov 2020 =
    101107* Fixed some typos in the code.
Note: See TracChangeset for help on using the changeset viewer.