(), 'future_actions_tabs'] ); $hook_suffix = add_submenu_page( "edit.php?post_type=" . Module::POST_TYPE_WORKFLOW, __('Scheduled Actions', 'post-expirator'), __('Scheduled Actions', 'post-expirator'), 'manage_options', 'publishpress-future-scheduled-actions', [$this, 'renderScheduledActionsTemplate'] ); $this->hooks->addAction('load-' . $hook_suffix, [$this, 'processAdminUi']); } catch (Throwable $th) { $this->logger->error('Error adding scheduled actions menu: ' . $th->getMessage()); } } public function renderScheduledActionsTemplate() { $table = $this->getListTable(); $table->display_page(); \PostExpirator_Display::getInstance()->publishpress_footer(); } public function onActionSchedulerDeletedAction($actionId) { $factory = $this->actionArgsModelFactory; $actionArgsModel = $factory(); if ($actionArgsModel->loadByActionId($actionId)) { $actionArgsModel->delete(); }; } public function onActionSchedulerDisableAction($actionId) { $factory = $this->actionArgsModelFactory; $actionArgsModel = $factory(); if ($actionArgsModel->loadByActionId($actionId)) { $actionArgsModel->setEnabled(false); $actionArgsModel->save(); }; } /** * @return \PublishPress\Future\Modules\Expirator\Tables\ScheduledActionsTable */ private function getListTable() { if (null === $this->listTable) { $factory = $this->scheduledActionsTableFactory; $this->listTable = $factory(); $this->listTable->process_actions(); } return $this->listTable; } public function processAdminUi() { $this->getListTable(); } public function filterScreenSettings($screenSettings, $screen) { if ($screen->id !== 'future_page_publishpress-future-scheduled-actions') { return $screenSettings; } $userLogFormat = get_user_meta(get_current_user_id(), 'publishpressfuture_actions_log_format', true); if (empty($userLogFormat)) { $userLogFormat = 'list'; } // Add nonce field $screenSettings .= wp_nonce_field( 'publishpressfuture_actions_log_format', 'publishpressfuture_actions_log_format_nonce', true, false ); $screenSettings .= '
'; $screenSettings .= '' . esc_html__('Log format', 'post-expirator') . ''; $screenSettings .= ''; $screenSettings .= ' '; $screenSettings .= ''; $screenSettings .= '
'; return $screenSettings; } public function filterSetScreenOption($status) { if ( ! isset($_POST['publishpressfuture_actions_log_format_nonce']) || ! wp_verify_nonce( sanitize_key($_POST['publishpressfuture_actions_log_format_nonce']), 'publishpressfuture_actions_log_format' ) ) { return $status; } if (isset($_POST['publishpressfuture_actions_log_format'])) { update_user_meta( get_current_user_id(), 'publishpressfuture_actions_log_format', sanitize_key($_POST['publishpressfuture_actions_log_format']) ); } else { delete_user_meta(get_current_user_id(), 'publishpressfuture_actions_log_format'); } return $status; } public function enqueueScripts($screenId) { try { if ('admin_page_publishpress-future-scheduled-actions' === $screenId) { wp_enqueue_style( 'postexpirator-css', Plugin::getAssetUrl('css/style.css'), false, PUBLISHPRESS_FUTURE_VERSION ); wp_enqueue_style( 'pe-footer', Plugin::getAssetUrl('css/footer.css'), false, PUBLISHPRESS_FUTURE_VERSION ); } } catch (Throwable $th) { $this->logger->error('Error enqueuing scripts: ' . $th->getMessage()); } } public function filterActionSchedulerAdminNotice($html, $action, $notification) { if ($action->get_group() !== 'publishpress-future') { return $html; } $hook = $action->get_hook(); if ($hook === HooksAbstract::ACTION_RUN_WORKFLOW) { $args = $action->get_args(); if (isset($args['postId']) && isset($args['workflow']) && 'expire' === $args['workflow']) { $postId = (int)$args['postId']; $post = get_post($postId); $postTitle = $post ? html_entity_decode(get_the_title($post)) : __('Unknown post', 'post-expirator'); $html = sprintf( __('Executed action for: %s (ID: %d)', 'post-expirator'), $postTitle, $postId ); } else { $html = __('Executed scheduled action', 'post-expirator'); } } return $html; } public function onFilterAdminTitle($adminTitle, $title) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No need for nonce verification when just comparing page if (isset($_GET['page']) && $_GET['page'] === 'publishpress-future-scheduled-actions') { return str_replace($title, __('Scheduled Actions', 'post-expirator'), $adminTitle); } return $adminTitle; } } https://www.sparmc.de/sitemap-index-1.xml 2023-12-07T22:04:56Z https://www.sparmc.de/image-sitemap-index-1.xml 2026-05-10T18:24:58Z