Plugin Directory

Changeset 3215459


Ignore:
Timestamp:
12/31/2024 05:54:36 PM (15 months ago)
Author:
service2client
Message:

4.10

*Reverting back to version 4.06*

Location:
dynamic-post/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamic-post/trunk/post-types/post_type_dynamic_post.php

    r3207786 r3215459  
    879879}
    880880
    881 // Update Article Version
    882 function delete_all_posts_by_service2client() {
    883     $plugin_file = WP_PLUGIN_DIR . '/dynamic-post/wp_plugin_dynamic_post.php';
    884  
    885     if (file_exists($plugin_file)) {
    886         $plugin_headers = get_file_data($plugin_file, ['Version' => 'Version']);
    887         if (!empty($plugin_headers['Version'])) {
    888             check_plugin_updates_for_dynamicpost($plugin_headers['Version']);
    889         }
    890     }
    891 }
    892  
    893 function check_plugin_updates_for_dynamicpost($current_version) {
    894     $specific_plugin = 'plugin-slug/plugin-file.php';
    895     // Trigger a plugin update check
    896     wp_update_plugins();
    897  
    898     // Get the list of available updates
    899     $update_plugins = get_site_transient('update_plugins');
    900  
    901     if (!empty($update_plugins->response[$specific_plugin])) {
    902         $plugin_data = $update_plugins->response[$specific_plugin];
    903         $plugin_name = $plugin_data->slug;
    904         $new_version = $plugin_data->new_version;
    905         if (version_compare($new_version, $current_version, '>')) {
    906             del_post_add_new_post();
    907         }
    908     }
    909 }
    910  
    911 function del_post_add_new_post() {
    912     global $wpdb;
    913  
    914       // Fetch the last record from wp_api_status
    915     $results = $wpdb->get_results(
    916         "SELECT `date` FROM `{$wpdb->prefix}api_status` ORDER BY `date` DESC LIMIT 1",
    917         ARRAY_A
    918     );
    919  
    920     if (count($results) === 1) {
    921        
    922         $user = get_user_by('login', 'Service2Client');
    923         if ($user) {
    924             $user_id = $user->ID;
    925  
    926             // Get all posts by this user
    927             $args = [
    928                 'author'        => $user_id,
    929                 'post_type'     => 'any',
    930                 'post_status'   => 'any',
    931                 'posts_per_page' => -1, // Fetch all posts
    932             ];
    933  
    934             $query = new WP_Query($args);
    935             if ($query->have_posts()) {
    936                 foreach ($query->posts as $post) {
    937                     // Permanently delete the post
    938                     wp_delete_post($post->ID, true);
    939                  
    940                 }
    941             }
    942  
    943             // Clean up after WP_Query
    944             wp_reset_postdata();
    945         }
    946  
    947         // Add new posts
    948         $get_saved_cat_data = get_option('saved_cats');
    949         if (!empty($get_saved_cat_data)) {
    950             $pass_saved_cat['data_catgname'] = array_merge(...$get_saved_cat_data);
    951             $instanceOfClass = new Post_Type_Dynamic_Post();
    952             $instanceOfClass->insert_dynamic_posts($pass_saved_cat);
    953         }
    954     }
    955 }
    956 add_action('init', 'delete_all_posts_by_service2client');
    957 
    958881// Hook the functions
    959882add_filter('tiny_mce_before_init', 'allow_iframes_for_editor_and_author');
    960883add_action('init', 'add_editor_and_author_capabilities');
    961884?>
    962 
  • dynamic-post/trunk/readme.txt

    r3207786 r3215459  
    66Requires at least: 3.0
    77Tested up to: 6.7.1
    8 Stable tag: 4.08
     8Stable tag: 4.10
    99License: GPLv2 or later, Contact sales@service2client.com for duel licensing options.
    1010
     
    244244*Update Article Version Number Automatically*
    245245
     246= 4.10 =
     247*Reverting back to version 4.06*
     248
    246249== Upgrade Notice ==
    247250
     
    367370= 4.08 =
    368371Update Article Version Number Automatically
     372
     373= 4.10 =
     374Reverting back to version 4.06
  • dynamic-post/trunk/wp_plugin_dynamic_post.php

    r3207786 r3215459  
    44Plugin URI: https://www.service2client.com/dynamicpost
    55Description: Auto post Service2Clients Dynamic Content articles to your blog on a monthly basis. CPA Content, Tax Content, Accounting Content.
    6 Version: 4.08
     6Version: 4.10
    77Author: Service2Client
    88Author URI: https://www.service2client.com
Note: See TracChangeset for help on using the changeset viewer.