Plugin Directory

Changeset 3366446


Ignore:
Timestamp:
09/23/2025 12:08:59 PM (3 months ago)
Author:
advancedads
Message:

Update to version 2.0.12 from GitHub

Location:
advanced-ads
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • advanced-ads/tags/2.0.12/advanced-ads.php

    r3350685 r3366446  
    1111 * @wordpress-plugin
    1212 * Plugin Name:       Advanced Ads
    13  * Version:           2.0.11
     13 * Version:           2.0.12
    1414 * Description:       Manage and optimize your ads in WordPress
    1515 * Plugin URI:        https://wpadvancedads.com
     
    3838
    3939define( 'ADVADS_FILE', __FILE__ );
    40 define( 'ADVADS_VERSION', '2.0.11' );
     40define( 'ADVADS_VERSION', '2.0.12' );
    4141
    4242// Load the autoloader.
  • advanced-ads/tags/2.0.12/includes/abstracts/abstract-ad.php

    r3350685 r3366446  
    617617     */
    618618    public function is_head_placement(): bool {
    619         return null !== $this->get_parent() && $this->get_parent()->is_type( 'header' );
     619        if ( null !== $this->get_parent() && $this->get_parent()->is_type( 'header' ) ) {
     620            return true;
     621        }
     622
     623        // group as head placement.
     624        if ( 'header' === $this->get_prop( 'group_placement_context' ) ) {
     625            return true;
     626        }
     627
     628        return false;
    620629    }
    621630
  • advanced-ads/tags/2.0.12/includes/abstracts/abstract-group.php

    r3253289 r3366446  
    264264
    265265    /**
    266      * Checks if the group is placed in the header.
     266     * Checks if the group is placed in head.
    267267     *
    268268     * @return bool
     
    567567
    568568    /**
    569      * Prepare the output for the ads.
     569     * Prepare the output for the ads in the group.
    570570     *
    571571     * @param array $ordered_ad_ids Ordered ad IDs.
    572572     *
    573      * @return array
     573     * @return array Output for each ad.
    574574     */
    575575    private function prepare_ad_output( $ordered_ad_ids ): array {
     
    587587                $ad->set_prop_temp( 'ad_args', $this->get_prop( 'ad_args' ) );
    588588                $ad->set_parent( $this );
     589                // group as head placement.
     590                $ad->set_prop_temp( 'group_placement_context', $this->is_head_placement() ? 'header' : 'content' );
    589591                $ad->set_prop_temp( 'ad_label', 'disabled' );
    590592                $ad_output = $ad->can_display() ? $ad->output() : '';
  • advanced-ads/tags/2.0.12/includes/ads/class-ad-repository.php

    r3350685 r3366446  
    127127                'post_content' => apply_filters(
    128128                    'advanced-ads-pre-ad-save-' . $ad->get_type(),
    129                     apply_filters(
    130                         'content_save_pre',
    131                         $is_text_ad ? $ad->get_content( 'edit' ) : wp_unslash( $ad->get_content( 'edit' ) )
    132                     )
     129                    $is_text_ad
     130                        ? wp_unslash( $ad->get_content( 'edit' ) )
     131                        : apply_filters( 'content_save_pre', wp_unslash( $ad->get_content( 'edit' ) ) )
    133132                ),
    134133            ];
  • advanced-ads/tags/2.0.12/includes/compatibility/class-admin-compatibility.php

    r3253289 r3366446  
    1010namespace AdvancedAds\Compatibility;
    1111
     12use AdvancedAds\Constants;
    1213use AdvancedAds\Utilities\Conditional;
    1314use AdvancedAds\Framework\Interfaces\Integration_Interface;
     
    2930        add_action( 'quads_meta_box_post_types', [ $this, 'fix_wpquadspro_issue' ], 11 );
    3031        add_filter( 'wpml_admin_language_switcher_active_languages', [ $this, 'wpml_language_switcher' ] );
     32
     33        // Hide from WPML translation settings.
     34        if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
     35            add_filter( 'get_translatable_documents', [ $this, 'wpml_hide_from_translation' ], 10, 1 );
     36        }
    3137    }
    3238
     
    8995        return $active_languages;
    9096    }
     97
     98    /**
     99     * Hide post type from WPML translatable documents.
     100     *
     101     * @param array $documents Array of translatable documents.
     102     *
     103     * @return array Modified array.
     104     */
     105    public function wpml_hide_from_translation( $documents ): array {
     106        if ( isset( $documents[ Constants::POST_TYPE_PLACEMENT ] ) ) {
     107            unset( $documents[ Constants::POST_TYPE_PLACEMENT ] );
     108        }
     109        return $documents;
     110    }
    91111}
  • advanced-ads/tags/2.0.12/languages/advanced-ads.pot

    r3350685 r3366446  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Advanced Ads 2.0.10\n"
     5"Project-Id-Version: Advanced Ads 2.0.11\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads\n"
    77"Last-Translator: Thomas Maier <[email protected]>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-08-26T20:07:47+00:00\n"
     12"POT-Creation-Date: 2025-09-23T12:04:42+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    12421242
    12431243#: classes/display-conditions.php:734
    1244 #: includes/abstracts/abstract-ad.php:827
     1244#: includes/abstracts/abstract-ad.php:836
    12451245#: includes/admin/class-groups-list-table.php:362
    12461246#: views/admin/placements/quick-edit.php:16
     
    16171617
    16181618#. translators: %s is a date.
    1619 #: includes/abstracts/abstract-ad.php:804
     1619#: includes/abstracts/abstract-ad.php:813
    16201620#, php-format
    16211621msgid "starts %s"
     
    16231623
    16241624#. translators: %s is a date.
    1625 #: includes/abstracts/abstract-ad.php:816
     1625#: includes/abstracts/abstract-ad.php:825
    16261626#, php-format
    16271627msgid "expires %s"
     
    16291629
    16301630#. translators: %s is a date.
    1631 #: includes/abstracts/abstract-ad.php:822
     1631#: includes/abstracts/abstract-ad.php:831
    16321632#, php-format
    16331633msgid "expired %s"
    16341634msgstr ""
    16351635
    1636 #: includes/abstracts/abstract-ad.php:828
     1636#: includes/abstracts/abstract-ad.php:837
    16371637#: includes/admin/class-placement-quick-edit.php:48
    16381638#: views/admin/placements/edit-modal/fields/status.php:13
     
    16421642msgstr ""
    16431643
    1644 #: includes/abstracts/abstract-ad.php:829
     1644#: includes/abstracts/abstract-ad.php:838
    16451645msgid "Trashed"
    16461646msgstr ""
    16471647
    16481648#. translators: %1$s is a placement name, %2$s is the ads name.
    1649 #: includes/abstracts/abstract-ad.php:1202
     1649#: includes/abstracts/abstract-ad.php:1211
    16501650#, php-format
    16511651msgid "Placement name: %1$s; Ads: %2$s"
  • advanced-ads/tags/2.0.12/readme.txt

    r3350685 r3366446  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 2.0.11
     7Stable tag: 2.0.12
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    361361== Changelog ==
    362362
     363= 2.0.12 (September 23, 2025) =
     364
     365- Improvement: prevent quotation marks in ad codes being escaped with ACF enabled
     366- Fix: groups now correctly inject ads in header placements
     367- Fix: remove placements from WPML translation options
     368
    363369= 2.0.11 (August 27, 2025) =
    364370
  • advanced-ads/tags/2.0.12/wp.advads

    r3350685 r3366446  
    33    "name": "Advanced Ads",
    44    "description": "Manage and optimize your ads in WordPress",
    5     "version": "2.0.11",
     5    "version": "2.0.12",
    66    "requireWP": "5.7",
    77    "requirePHP": "7.4",
  • advanced-ads/trunk/advanced-ads.php

    r3350685 r3366446  
    1111 * @wordpress-plugin
    1212 * Plugin Name:       Advanced Ads
    13  * Version:           2.0.11
     13 * Version:           2.0.12
    1414 * Description:       Manage and optimize your ads in WordPress
    1515 * Plugin URI:        https://wpadvancedads.com
     
    3838
    3939define( 'ADVADS_FILE', __FILE__ );
    40 define( 'ADVADS_VERSION', '2.0.11' );
     40define( 'ADVADS_VERSION', '2.0.12' );
    4141
    4242// Load the autoloader.
  • advanced-ads/trunk/includes/abstracts/abstract-ad.php

    r3350685 r3366446  
    617617     */
    618618    public function is_head_placement(): bool {
    619         return null !== $this->get_parent() && $this->get_parent()->is_type( 'header' );
     619        if ( null !== $this->get_parent() && $this->get_parent()->is_type( 'header' ) ) {
     620            return true;
     621        }
     622
     623        // group as head placement.
     624        if ( 'header' === $this->get_prop( 'group_placement_context' ) ) {
     625            return true;
     626        }
     627
     628        return false;
    620629    }
    621630
  • advanced-ads/trunk/includes/abstracts/abstract-group.php

    r3253289 r3366446  
    264264
    265265    /**
    266      * Checks if the group is placed in the header.
     266     * Checks if the group is placed in head.
    267267     *
    268268     * @return bool
     
    567567
    568568    /**
    569      * Prepare the output for the ads.
     569     * Prepare the output for the ads in the group.
    570570     *
    571571     * @param array $ordered_ad_ids Ordered ad IDs.
    572572     *
    573      * @return array
     573     * @return array Output for each ad.
    574574     */
    575575    private function prepare_ad_output( $ordered_ad_ids ): array {
     
    587587                $ad->set_prop_temp( 'ad_args', $this->get_prop( 'ad_args' ) );
    588588                $ad->set_parent( $this );
     589                // group as head placement.
     590                $ad->set_prop_temp( 'group_placement_context', $this->is_head_placement() ? 'header' : 'content' );
    589591                $ad->set_prop_temp( 'ad_label', 'disabled' );
    590592                $ad_output = $ad->can_display() ? $ad->output() : '';
  • advanced-ads/trunk/includes/ads/class-ad-repository.php

    r3350685 r3366446  
    127127                'post_content' => apply_filters(
    128128                    'advanced-ads-pre-ad-save-' . $ad->get_type(),
    129                     apply_filters(
    130                         'content_save_pre',
    131                         $is_text_ad ? $ad->get_content( 'edit' ) : wp_unslash( $ad->get_content( 'edit' ) )
    132                     )
     129                    $is_text_ad
     130                        ? wp_unslash( $ad->get_content( 'edit' ) )
     131                        : apply_filters( 'content_save_pre', wp_unslash( $ad->get_content( 'edit' ) ) )
    133132                ),
    134133            ];
  • advanced-ads/trunk/includes/compatibility/class-admin-compatibility.php

    r3253289 r3366446  
    1010namespace AdvancedAds\Compatibility;
    1111
     12use AdvancedAds\Constants;
    1213use AdvancedAds\Utilities\Conditional;
    1314use AdvancedAds\Framework\Interfaces\Integration_Interface;
     
    2930        add_action( 'quads_meta_box_post_types', [ $this, 'fix_wpquadspro_issue' ], 11 );
    3031        add_filter( 'wpml_admin_language_switcher_active_languages', [ $this, 'wpml_language_switcher' ] );
     32
     33        // Hide from WPML translation settings.
     34        if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
     35            add_filter( 'get_translatable_documents', [ $this, 'wpml_hide_from_translation' ], 10, 1 );
     36        }
    3137    }
    3238
     
    8995        return $active_languages;
    9096    }
     97
     98    /**
     99     * Hide post type from WPML translatable documents.
     100     *
     101     * @param array $documents Array of translatable documents.
     102     *
     103     * @return array Modified array.
     104     */
     105    public function wpml_hide_from_translation( $documents ): array {
     106        if ( isset( $documents[ Constants::POST_TYPE_PLACEMENT ] ) ) {
     107            unset( $documents[ Constants::POST_TYPE_PLACEMENT ] );
     108        }
     109        return $documents;
     110    }
    91111}
  • advanced-ads/trunk/languages/advanced-ads.pot

    r3350685 r3366446  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Advanced Ads 2.0.10\n"
     5"Project-Id-Version: Advanced Ads 2.0.11\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads\n"
    77"Last-Translator: Thomas Maier <[email protected]>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-08-26T20:07:47+00:00\n"
     12"POT-Creation-Date: 2025-09-23T12:04:42+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    12421242
    12431243#: classes/display-conditions.php:734
    1244 #: includes/abstracts/abstract-ad.php:827
     1244#: includes/abstracts/abstract-ad.php:836
    12451245#: includes/admin/class-groups-list-table.php:362
    12461246#: views/admin/placements/quick-edit.php:16
     
    16171617
    16181618#. translators: %s is a date.
    1619 #: includes/abstracts/abstract-ad.php:804
     1619#: includes/abstracts/abstract-ad.php:813
    16201620#, php-format
    16211621msgid "starts %s"
     
    16231623
    16241624#. translators: %s is a date.
    1625 #: includes/abstracts/abstract-ad.php:816
     1625#: includes/abstracts/abstract-ad.php:825
    16261626#, php-format
    16271627msgid "expires %s"
     
    16291629
    16301630#. translators: %s is a date.
    1631 #: includes/abstracts/abstract-ad.php:822
     1631#: includes/abstracts/abstract-ad.php:831
    16321632#, php-format
    16331633msgid "expired %s"
    16341634msgstr ""
    16351635
    1636 #: includes/abstracts/abstract-ad.php:828
     1636#: includes/abstracts/abstract-ad.php:837
    16371637#: includes/admin/class-placement-quick-edit.php:48
    16381638#: views/admin/placements/edit-modal/fields/status.php:13
     
    16421642msgstr ""
    16431643
    1644 #: includes/abstracts/abstract-ad.php:829
     1644#: includes/abstracts/abstract-ad.php:838
    16451645msgid "Trashed"
    16461646msgstr ""
    16471647
    16481648#. translators: %1$s is a placement name, %2$s is the ads name.
    1649 #: includes/abstracts/abstract-ad.php:1202
     1649#: includes/abstracts/abstract-ad.php:1211
    16501650#, php-format
    16511651msgid "Placement name: %1$s; Ads: %2$s"
  • advanced-ads/trunk/readme.txt

    r3350685 r3366446  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 2.0.11
     7Stable tag: 2.0.12
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    361361== Changelog ==
    362362
     363= 2.0.12 (September 23, 2025) =
     364
     365- Improvement: prevent quotation marks in ad codes being escaped with ACF enabled
     366- Fix: groups now correctly inject ads in header placements
     367- Fix: remove placements from WPML translation options
     368
    363369= 2.0.11 (August 27, 2025) =
    364370
  • advanced-ads/trunk/wp.advads

    r3350685 r3366446  
    33    "name": "Advanced Ads",
    44    "description": "Manage and optimize your ads in WordPress",
    5     "version": "2.0.11",
     5    "version": "2.0.12",
    66    "requireWP": "5.7",
    77    "requirePHP": "7.4",
Note: See TracChangeset for help on using the changeset viewer.