Plugin Directory

Changeset 2776029


Ignore:
Timestamp:
08/26/2022 09:54:51 AM (3 years ago)
Author:
andreadegiovine
Message:

3.0.14

Location:
custom-post-types
Files:
24 added
3 edited

Legend:

Unmodified
Added
Removed
  • custom-post-types/trunk/custom-post-types.php

    r2766090 r2776029  
    22/*
    33Plugin Name: Custom post types
    4 Plugin URI: https://totalpress.org/plugins/custom-post-types?utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types
     4Plugin URI: https://totalpress.org/plugins/custom-post-types
    55Description: Create / manage custom post types, custom taxonomies, custom fields and custom templates easily, directly from the WordPress dashboard without writing code.
    66Author: TotalPress.org
    7 Author URI: https://totalpress.org/?utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types
     7Author URI: https://totalpress.org/
    88Text Domain: custom-post-types
    99Domain Path: /languages/
    10 Version: 3.0.13
     10Version: 3.0.14
    1111*/
    1212
     
    1818define('CPT_PATH', plugin_dir_path(__FILE__));
    1919define('CPT_URL', plugin_dir_url(__FILE__));
    20 define('CPT_PLUGIN_URL', 'https://totalpress.org/plugins/custom-post-types?utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types');
    21 define('CPT_PLUGIN_DEV_URL', 'https://www.andreadegiovine.it/?utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types');
    22 define('CPT_PLUGIN_DOC_URL', 'https://totalpress.org/docs/custom-post-types.html?doc&utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types');
    23 define('CPT_PLUGIN_DONATE_URL', 'https://totalpress.org/donate?utm_source=wp-dashboard&utm_medium=installed-plugin&utm_campaign=custom-post-types');
     20define('CPT_PLUGIN_URL', 'https://totalpress.org/plugins/custom-post-types');
     21define('CPT_PLUGIN_DEV_URL', 'https://www.andreadegiovine.it/');
     22define('CPT_PLUGIN_DOC_URL', 'https://totalpress.org/docs/custom-post-types.html');
     23define('CPT_PLUGIN_DONATE_URL', 'https://totalpress.org/donate');
    2424define('CPT_PLUGIN_WP_URL', 'https://wordpress.org/plugin/custom-post-types');
    2525define('CPT_PLUGIN_SUPPORT_URL', 'https://wordpress.org/support/plugin/custom-post-types');
     
    545545        {
    546546            if (!is_admin()) return;
    547             $buttons = [
    548                 [
    549                     'link' => CPT_PLUGIN_URL,
    550                     'label' => __('Get PRO version', 'custom-post-types'),
    551                     'target' => '_blank',
    552                     'cta' => true
    553                 ],
    554                 [
    555                     'link' => CPT_PLUGIN_REVIEW_URL,
    556                     'label' => __('Write a Review', 'custom-post-types'),
    557                     'target' => '_blank'
    558                 ],
    559                 [
    560                     'link' => CPT_PLUGIN_DONATE_URL,
    561                     'label' => __('Make a Donation', 'custom-post-types'),
    562                     'target' => '_blank'
    563                 ],
    564             ];
    565             if ($this->is_pro_version_active()) {
    566                 unset($buttons[0]);
    567             }
    568             (new CPT\Notice)->add(
    569                 'welcome_notice',
    570                 __('Thanks for using this plugin! Do you want to help us grow to add new features?', 'custom-post-types') . '<br><br>' . sprintf(__('The new version %s introduces a lot of new features and improves the core of the plugin.<br>For any problems you can download the previous version %s from the official page of the plugin from WordPress.org (Advanced View > Previous version).', 'custom-post-types'), '<u>' . CPT_VER . '</u>', '<u>2.1.19</u>'),
    571                 'success',
    572                 false,
    573                 30,
    574                 $buttons
    575             );
     547            if (
     548                cpt_is_current_screen($this->cpt_ui_name) ||
     549                cpt_is_current_screen($this->cpt_ui_name . '_tax') ||
     550                cpt_is_current_screen($this->cpt_ui_name . '_field') ||
     551                cpt_is_current_screen($this->cpt_ui_name . '_template')
     552                ) {
     553                $buttons = [
     554                    [
     555                        'link' => CPT_PLUGIN_REVIEW_URL,
     556                        'label' => __('Write a Review', 'custom-post-types'),
     557                        'target' => '_blank',
     558                        'cta' => true
     559                    ],
     560                    [
     561                        'link' => CPT_PLUGIN_DONATE_URL,
     562                        'label' => __('Make a Donation', 'custom-post-types'),
     563                        'target' => '_blank'
     564                    ],
     565                    [
     566                        'link' => CPT_PLUGIN_URL,
     567                        'label' => __('Get PRO version', 'custom-post-types'),
     568                        'target' => '_blank'
     569                    ],
     570                ];
     571                if ($this->is_pro_version_active()) {
     572                    unset($buttons[0]);
     573                }
     574                (new CPT\Notice)->add(
     575                    'welcome_notice',
     576                    __('Thanks for using this plugin! Do you want to help us grow to add new features?', 'custom-post-types') . '<br><br>' . sprintf(__('The new version %s introduces a lot of new features and improves the core of the plugin.<br>For any problems you can download the previous version %s from the official page of the plugin from WordPress.org (Advanced View > Previous version).', 'custom-post-types'), '<u>' . CPT_VER . '</u>', '<u>2.1.19</u>'),
     577                    'success',
     578                    false,
     579                    -1,
     580                    $buttons
     581                );
     582            }
    576583
    577584
  • custom-post-types/trunk/inc/Notice.class.php

    r2627723 r2776029  
    1515    public function dismissed_notices()
    1616    {
    17         return get_option('custom_post_types_dismissed_notices', []);
     17        $dismissed_notices = get_option('custom_post_types_dismissed_notices', []);
     18        return is_array($dismissed_notices) ? $dismissed_notices : [];
    1819    }
    1920    public function dismiss_notice($id, int $days = 2)
    2021    {
    2122        $dismissed_notices = $this->dismissed_notices();
     23        if($days < 0) $days = 36500;
    2224        $dismissed_notices[$id] = strtotime("+$days day", time());
    2325        update_option('custom_post_types_dismissed_notices', $dismissed_notices);
     
    5254        }
    5355        if ($close_btn) {
     56            $button_label = $close_btn < 1 ? __('Dismiss notice', 'custom-post-types') : sprintf(__('Dismiss notice for %s days', 'custom-post-types'), (int) $close_btn);
    5457            $notice_buttons[] = sprintf(
    5558                '<a href="%s">%s</a>',
    56                 add_query_arg(['cpt-action' => 'dismiss', 'notice' => $key, 'days' => intval($close_btn), 'nonce' => wp_create_nonce('cpt-nonce')], $this->current_url()),
    57                 sprintf(__('Dismiss notice for %s days', 'custom-post-types'), intval($close_btn))
     59                add_query_arg(['cpt-action' => 'dismiss', 'notice' => $key, 'days' => (int) $close_btn, 'nonce' => wp_create_nonce('cpt-nonce')], $this->current_url()),
     60                $button_label
    5861            );
    5962        }
  • custom-post-types/trunk/readme.txt

    r2766090 r2776029  
    55Requires at least: 4.0
    66Tested up to: 6.0
    7 Stable tag: 3.0.13
     7Stable tag: 3.0.14
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    206206== Changelog ==
    207207
     208= 3.0.14 =
     209* Fixed wp-admin notices bug;
     210
    208211= 3.0.12 =
    209212* Fixed $ is not a function;
     
    456459== Upgrade Notice ==
    457460
     461= 3.0.14 =
     462Fixed wp-admin notices bug;
     463
    458464= 3.0.13 =
    459465Fixed refuse php
Note: See TracChangeset for help on using the changeset viewer.