Plugin Directory

Changeset 2945104


Ignore:
Timestamp:
07/30/2023 03:37:17 PM (2 years ago)
Author:
andreadegiovine
Message:

4.0.7

Location:
custom-post-types
Files:
41 added
4 edited

Legend:

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

    r2944690 r2945104  
    1212
    1313use CustomPostTypes\includes\classes\Core;
     14use CustomPostTypes\includes\classes\Utils;
    1415
    1516if (!defined('ABSPATH')) {
     
    4748
    4849do_action('custom_post_types_plugin_loaded');
     50
     51$currentVersion = Utils::getInfo('version');
     52register_activation_hook(__FILE__, function () use ($currentVersion) {
     53    $request_url = add_query_arg(
     54        ['id' => 92, 'action' => 'activate', 'domain' => md5(get_home_url()), 'v' => $currentVersion],
     55        'https://totalpress.org/wp-json/totalpress/v1/plugin-growth'
     56    );
     57    wp_remote_get($request_url);
     58});
     59register_deactivation_hook(__FILE__, function () use ($currentVersion) {
     60    $request_url = add_query_arg(
     61        ['id' => 92, 'action' => 'deactivate', 'domain' => md5(get_home_url()), 'v' => $currentVersion],
     62        'https://totalpress.org/wp-json/totalpress/v1/plugin-growth'
     63    );
     64    wp_remote_get($request_url);
     65});
  • custom-post-types/trunk/includes/classes/Core.php

    r2944690 r2945104  
    4848        $this->ajaxAction();
    4949        $this->applyUpdates();
    50         $this->pluginActions();
    5150        // Lets go
    5251        $this->initRegisteredContents();
     
    773772    }
    774773
    775     private function pluginActions()
    776     {
    777         $currentVersion = Utils::getInfo('version');
    778         register_activation_hook(__FILE__, function () use ($currentVersion) {
    779             $request_url = add_query_arg(
    780                 ['id' => 92, 'action' => 'activate', 'domain' => md5(get_home_url()), 'v' => $currentVersion],
    781                 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth'
    782             );
    783             wp_remote_get($request_url);
    784         });
    785         register_deactivation_hook(__FILE__, function () use ($currentVersion) {
    786             $request_url = add_query_arg(
    787                 ['id' => 92, 'action' => 'deactivate', 'domain' => md5(get_home_url()), 'v' => $currentVersion],
    788                 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth'
    789             );
    790             wp_remote_get($request_url);
    791         });
    792     }
    793 
    794774    /**
    795775     * @return void
  • custom-post-types/trunk/includes/classes/FieldGroups.php

    r2944690 r2945104  
    349349        $groupId = $config['id'];
    350350
    351         if(!empty($config['show_in_rest'])){
    352             $fields = !empty($config['fields']) && is_array($config['fields']) ? $config['fields'] : [];
    353             add_action( 'rest_api_init', function () use ($postType, $groupId, $fields) {
    354                 register_rest_field($postType, $groupId, ['get_callback' => function($item) use ($fields) {
    355                     return $fields;
    356                 }]);
    357             });
    358         }
     351//        if(!empty($config['show_in_rest'])){
     352//            $fields = !empty($config['fields']) && is_array($config['fields']) ? $config['fields'] : [];
     353//            add_action( 'rest_api_init', function () use ($postType, $groupId, $fields) {
     354//                register_rest_field($postType, $groupId, ['get_callback' => function($item) use ($fields) {
     355//                    return $fields;
     356//                }]);
     357//            });
     358//        }
    359359
    360360        add_action('add_meta_boxes', function ($posttype) use ($postType, $config) {
  • custom-post-types/trunk/readme.txt

    r2944690 r2945104  
    55Requires at least: 4.0
    66Tested up to: 6.2
    7 Stable tag: 4.0.6
     7Stable tag: 4.0.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    199199== Changelog ==
    200200
     201= 4.0.7 =
     202*2023-07-30*
     203* Activation/deactivation actions
     204
    201205= 4.0.6 =
    202 *2023-27-28*
     206*2023-07-28*
    203207* Performance improvments
    204208
Note: See TracChangeset for help on using the changeset viewer.