diff --git a/wp-multi-toolkit.php b/wp-multi-toolkit.php index b46d3d5..a5ea5ec 100644 --- a/wp-multi-toolkit.php +++ b/wp-multi-toolkit.php @@ -3,7 +3,7 @@ * Plugin Name: WP Multi Toolkit * Plugin URI: https://git.viper.ipv64.net/M_Viper/wp-multi-toolkit * Description: Ein umfassendes Toolkit inklusive WP Multi Funktionen und Update-Management für zugehörige Plugins. - * Version: 1.0.2 + * Version: 1.0.3 * Author: M_Viper * Author URI: https://m-viper.de * Requires at least: 6.7.2 @@ -18,14 +18,84 @@ defined('ABSPATH') or die('No direct access allowed.'); +// Funktion, um zukünftige Posts zu veröffentlichen +function pubMissedPosts() { + if (is_front_page() || is_single()) { + + global $wpdb; + $now = gmdate('Y-m-d H:i:00'); + + // Überprüfe, ob benutzerdefinierte Beitragstypen vorhanden sind + $args = array( + 'public' => true, + '_builtin' => false, + ); + + $output = 'names'; // names oder objects, names ist der Standard + $operator = 'and'; // 'and' oder 'or' + $post_types = get_post_types($args, $output, $operator); + + if (count($post_types) === 0) { + $sql = "SELECT ID FROM $wpdb->posts WHERE post_type IN ('post', 'page') AND post_status = 'future' AND post_date_gmt < '$now'"; + } else { + $str = implode('\',\'', $post_types); + $sql = "SELECT ID FROM $wpdb->posts WHERE post_type IN ('page', 'post', '$str') AND post_status = 'future' AND post_date_gmt < '$now'"; + } + + $resulto = $wpdb->get_results($sql); + if ($resulto) { + foreach ($resulto as $thisarr) { + wp_publish_post($thisarr->ID); + } + } + } +} + +// Die Funktion beim Laden der Seite aufrufen +add_action('wp_head', 'pubMissedPosts'); + + +/* + * Abhängigkeitsprüfung: WP Multi Kategorie + */ +function wp_multi_toolkit_check_kategorie_dependency() { + if (!function_exists('is_plugin_active')) { + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); + } + + // Prüfen, ob WP Multi Kategorie installiert und aktiv ist + if (!is_plugin_active('wp-multi-kategorie/wp-multi-kategorie.php')) { + add_action('admin_notices', 'wp_multi_toolkit_kategorie_dependency_notice'); + return false; + } + return true; +} + +// Admin-Hinweis, falls Abhängigkeit fehlt +function wp_multi_toolkit_kategorie_dependency_notice() { + ?> +
+

+ + + + +

+
+ $plugin_name, 'title' => $title, @@ -59,7 +129,7 @@ function send_support_ticket_to_server($plugin_name, $title, $description, $labe } } -// Formular für das Support-Ticket mit Design +// Support-Ticket Formular function support_ticket_form() { ?>
@@ -73,6 +143,7 @@ function support_ticket_form() { +
@@ -108,6 +179,7 @@ function support_ticket_form() { $title = sanitize_text_field($_POST['ticket_title']); $description = sanitize_textarea_field($_POST['ticket_description']); $label = sanitize_text_field($_POST['ticket_label']); + // Übergebe die richtigen Werte an die Ticket-Erstellung $result = send_support_ticket_to_server($plugin_name, $title, $description, $label); echo '
' . $result . '
'; } @@ -116,7 +188,6 @@ function support_ticket_form() { - array( + 'file' => 'wp-multi-toolkit/wp-multi-toolkit.php', + 'name' => 'WP Multi Toolkit', + 'description' => __('Zentrales Toolkit für die WP Multi Plugin-Reihe mit Update-Management und Support-Funktionen.', 'wp-multi-toolkit'), + 'repo' => 'wp-multi-toolkit' + ), + 'wp-multi' => array( + 'file' => 'WP-Multi/wp-multi.php', + 'name' => 'WP Multi', + 'description' => __('Hauptplugin für Multi-Funktionen mit Shortcode-Unterstützung.', 'wp-multi-toolkit'), + 'repo' => 'wp-multi' + ), + 'wp-multi-search' => array( + 'file' => 'wp-multi-search/wp-multi-search.php', + 'name' => 'WP Multi Search', + 'description' => __('Erweiterte Suchfunktionen für WordPress.', 'wp-multi-toolkit'), + 'repo' => 'WP-Multi-Search' + ), + 'wp-multi-comment-notifications' => array( + 'file' => 'wp-multi-comment-notifications/wp-multi-comment-notifications.php', + 'name' => 'WP Multi Comment Notifications', + 'description' => __('Automatische Benachrichtigungen für neue Kommentare.', 'wp-multi-toolkit'), + 'repo' => 'wp-multi-comment-notifications' + ), + 'wp-multi-kategorie' => array( + 'file' => 'wp-multi-kategorie/wp-multi-kategorie.php', + 'name' => 'WP Multi Kategorie', + 'repo' => 'wp-multi-kategorie' + ) + ); + + ?> +
+

+

+ + $plugin) : ?> +
+

+ +

:

+

:

+

:

+

:

+ +

:

+ + +

:

+ + +

:

+

:

+

:

+ +
+ +
+ + + 'wp-multi-comment-notifications/wp-multi-comment-notifications.php', 'name' => 'WP Multi Comment Notifications', 'repo' => 'wp-multi-comment-notifications' + ), + 'wp-multi-kategorie' => array( + 'file' => 'wp-multi-kategorie/wp-multi-kategorie.php', + 'name' => 'WP Multi Kategorie', + 'repo' => 'wp-multi-kategorie' ) ); @@ -535,6 +714,11 @@ function wpmt_update_dashboard_widget_content() { 'file' => 'wp-multi-comment-notifications/wp-multi-comment-notifications.php', 'download_url' => 'https://git.viper.ipv64.net/M_Viper/wp-multi-comment-notifications/releases', 'description' => __('Kommentar-Benachrichtigungen.', 'wp-multi-toolkit') + ), + 'wp-multi-kategorie' => array( + 'file' => 'wp-multi-kategorie/wp-multi-kategorie.php', + 'download_url' => 'https://git.viper.ipv64.net/M_Viper/wp-multi-kategorie/releases', + 'description' => __('Erweiterte Kategorie-Funktionen für WP Multi.', 'wp-multi-toolkit') ) ); @@ -616,4 +800,4 @@ function wpmt_uninstall() { delete_option('wpmt_multi_settings'); wp_clear_scheduled_hook('wpmt_update_check_event'); } -register_uninstall_hook(__FILE__, 'wpmt_uninstall'); \ No newline at end of file +register_uninstall_hook(__FILE__, 'wpmt_uninstall');