Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • WP Rollback plugin

    There is a bug on the latest version.
    Products no longer get stored properly. I went into the Settings and all the ID’s are missing, if you change the setting then back it works but then boots out the ID’s a little later. Going to revert back to a previous version before the bugs started!

    Thread Starter jdp2002

    (@jdp2002)

    <?php

    namespace PublishPress\Future\Modules\Workflows\Controllers;

    use PublishPress\Future\Core\HookableInterface;
    use PublishPress\Future\Framework\InitializableInterface;
    use PublishPress\Future\Core\HooksAbstract as CoreHooksAbstract;
    use PublishPress\Future\Modules\Workflows\Models\WorkflowsModel;
    use PublishPress\Future\Core\HooksAbstract as FutureCoreHooksAbstract;
    use PublishPress\Future\Core\Plugin;
    use PublishPress\Future\Modules\Workflows\HooksAbstract;
    use PublishPress\Future\Modules\Workflows\Models\PostModel;
    use PublishPress\Future\Modules\Workflows\Models\PostTypesModel;
    use PublishPress\Future\Modules\Workflows\Module;

    class ManualPostTrigger implements InitializableInterface
    {
    /**
    * @var HookableInterface
    */
    private $hooks;

    /**
    * @var boolean
    */
    private $isBlockEditor = false;

    public function __construct(HookableInterface $hooks)
    {
    $this->hooks = $hooks;
    }

    public function initialize()
    {
    // Quick Edit
    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_QUICK_EDIT_CUSTOM_BOX,
    [$this, 'registerQuickEditCustomBox'],
    10,
    2
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_SAVE_POST,
    [$this, 'processQuickEditUpdate']
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADMIN_PRINT_SCRIPTS_EDIT,
    [$this, 'enqueueQuickEditScripts']
    );

    // Block Editor
    $this->hooks->addAction(
    CoreHooksAbstract::ACTION_ENQUEUE_BLOCK_EDITOR_ASSETS,
    [$this, 'enqueueBlockEditorScripts']
    );

    $this->hooks->addAction(
    CoreHooksAbstract::ACTION_REST_API_INIT,
    [$this, 'registerRestField']
    );

    // Classic Editor
    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADD_META_BOXES,
    [$this, 'registerClassicEditorMetabox'],
    10,
    2
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_SAVE_POST,
    [$this, 'processMetaboxUpdate']
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADMIN_ENQUEUE_SCRIPTS,
    [$this, 'enqueueScripts']
    );
    }

    public function registerQuickEditCustomBox($columnName, $postType)
    {
    if ($columnName !== 'expirationdate' || Module::POST_TYPE_WORKFLOW === $postType) {
    return;
    }

    // Check there are workflows with the manual post trigger
    $workflowsModel = new WorkflowsModel();
    $workflows = $workflowsModel->getPublishedWorkflowsWithManualTrigger($postType);

    if (empty($workflows)) {
    return;
    }

    require_once __DIR__ . "/../Views/manual-trigger-quick-edit.html.php";
    }

    public function processQuickEditUpdate($postId)
    {
    // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
    // Don't run if this is an auto save
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    return;
    }

    // Don't update data if the function is called for saving revision.
    $postType = get_post_type((int)$postId);
    if ($postType === 'revision') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $view = $_POST['future_workflow_view'] ?? '';

    if (empty($view) || $view !== 'quick-edit') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel = new PostModel();
    $postModel->load($postId);
    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);
    // phpcs:enable
    }

    private function triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows)
    {
    // Trigger the action to trigger those workflows
    foreach ($manuallyEnabledWorkflows as $workflowId) {
    $this->hooks->doAction(HooksAbstract::ACTION_MANUALLY_TRIGGERED_WORKFLOW, (int)$postId, (int)$workflowId);
    }
    }

    public function enqueueQuickEditScripts()
    {
    // Only enqueue scripts if we are in the post list table

    if (get_current_screen()->base !== 'edit') {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script_quick_edit",
    Plugin::getScriptUrl('workflowManualSelectionQuickEdit'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    wp_localize_script(
    "future_workflow_manual_selection_script_quick_edit",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    ]
    );
    }

    public function enqueueBlockEditorScripts()
    {
    global $post;

    if (! $post || is_null($post->ID)) {
    error_log('Post is null or ID is not set, cannot enqueue block editor scripts.');
    return;
    }

    $this->isBlockEditor = true;

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $workflowsWithManualTrigger = $postModel->getValidWorkflowsWithManualTrigger($post->ID);

    if (empty($workflowsWithManualTrigger)) {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script_block_editor",
    Plugin::getScriptUrl('workflowManualSelectionBlockEditor'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    wp_localize_script(
    "future_workflow_manual_selection_script_block_editor",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    "postId" => $post->ID,
    ]
    );
    }

    public function registerRestField()
    {
    $postTypesModel = new PostTypesModel();
    $postTypes = $postTypesModel->getPostTypes();

    foreach ($postTypes as $postType) {
    register_rest_field(
    $postType->name,
    'publishpress_future_workflow_manual_trigger',
    [
    'get_callback' => function ($post) {
    $post = get_post();

    if (! $post || is_null($post->ID)) {
    return [
    'enabledWorkflows' => []
    ];
    }

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $enabledWorkflows = $postModel->getManuallyEnabledWorkflows();

    return [
    'enabledWorkflows' => $enabledWorkflows,
    ];
    },
    'update_callback' => function ($manualTriggerAttributes, $post) {
    $postModel = new PostModel();
    $postModel->load($post->ID);

    $manuallyEnabledWorkflows = $manualTriggerAttributes['enabledWorkflows'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($post->ID, $manuallyEnabledWorkflows);

    return true;
    },
    'schema' => [
    'description' => 'Workflow Manual Trigger',
    'type' => 'object',
    ]
    ]
    );
    }
    }

    public function registerClassicEditorMetabox($postType, $post)
    {
    if ($this->isBlockEditor || !isset($post) || !is_object($post) || is_null($post->ID)) {
    error_log('Post is null or ID is not set, cannot load workflows.');
    return;
    }

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $workflows = $postModel->getValidWorkflowsWithManualTrigger($post->ID);

    if (empty($workflows)) {
    return;
    }

    add_meta_box(
    'future_workflow_manual_trigger',
    __('Action Workflows', 'post-expirator'),
    [$this, 'renderClassicEditorMetabox'],
    $postType,
    'side',
    'default',
    [$post]
    );
    }

    public function renderClassicEditorMetabox($post)
    {
    require_once __DIR__ . "/../Views/manual-trigger-classic-editor.html.php";
    }

    public function processMetaboxUpdate($postId)
    {
    // phpcs:disable WordPress.Security.NonceVerification.Missing
    // Don't run if this is an auto save
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    return;
    }

    // Don't update data if the function is called for saving revision.
    $postType = get_post_type((int)$postId);
    if ($postType === 'revision') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $view = $_POST['future_workflow_view'] ?? '';

    if (empty($view) || $view !== 'classic-editor') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel = new PostModel();
    $postModel->load($postId);
    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);
    // phpcs:enable
    }

    public function enqueueScripts()
    {
    // Only enqueue scripts if we are in the post edit screen
    if (get_current_screen()->id !== 'post') {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script",
    Plugin::getScriptUrl('workflowManualSelectionClassicEditor'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    $post = get_post();

    wp_localize_script(
    "future_workflow_manual_selection_script",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    "postId" => $post->ID,
    ]
    );
    }
    }

    Resolved file: /post-expirator/src/Modules/Workflows/Controllers/ManualPostTrigger.php

    Thread Starter jdp2002

    (@jdp2002)

    <?php

    namespace PublishPress\Future\Modules\Workflows\Controllers;

    use PublishPress\Future\Core\HookableInterface;
    use PublishPress\Future\Framework\InitializableInterface;
    use PublishPress\Future\Core\HooksAbstract as CoreHooksAbstract;
    use PublishPress\Future\Modules\Workflows\Models\WorkflowsModel;
    use PublishPress\Future\Core\HooksAbstract as FutureCoreHooksAbstract;
    use PublishPress\Future\Core\Plugin;
    use PublishPress\Future\Modules\Workflows\HooksAbstract;
    use PublishPress\Future\Modules\Workflows\Models\PostModel;
    use PublishPress\Future\Modules\Workflows\Models\PostTypesModel;
    use PublishPress\Future\Modules\Workflows\Module;

    class ManualPostTrigger implements InitializableInterface
    {
    /**
    * @var HookableInterface
    */
    private $hooks;

    /**
    * @var boolean
    */
    private $isBlockEditor = false;

    public function __construct(HookableInterface $hooks)
    {
    $this->hooks = $hooks;
    }

    public function initialize()
    {
    // Quick Edit
    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_QUICK_EDIT_CUSTOM_BOX,
    [$this, 'registerQuickEditCustomBox'],
    10,
    2
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_SAVE_POST,
    [$this, 'processQuickEditUpdate']
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADMIN_PRINT_SCRIPTS_EDIT,
    [$this, 'enqueueQuickEditScripts']
    );

    // Block Editor
    $this->hooks->addAction(
    CoreHooksAbstract::ACTION_ENQUEUE_BLOCK_EDITOR_ASSETS,
    [$this, 'enqueueBlockEditorScripts']
    );

    $this->hooks->addAction(
    CoreHooksAbstract::ACTION_REST_API_INIT,
    [$this, 'registerRestField']
    );

    // Classic Editor
    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADD_META_BOXES,
    [$this, 'registerClassicEditorMetabox'],
    10,
    2
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_SAVE_POST,
    [$this, 'processMetaboxUpdate']
    );

    $this->hooks->addAction(
    FutureCoreHooksAbstract::ACTION_ADMIN_ENQUEUE_SCRIPTS,
    [$this, 'enqueueScripts']
    );
    }

    public function registerQuickEditCustomBox($columnName, $postType)
    {
    if ($columnName !== 'expirationdate' || Module::POST_TYPE_WORKFLOW === $postType) {
    return;
    }

    // Check there are workflows with the manual post trigger
    $workflowsModel = new WorkflowsModel();
    $workflows = $workflowsModel->getPublishedWorkflowsWithManualTrigger($postType);

    if (empty($workflows)) {
    return;
    }

    require_once __DIR__ . "/../Views/manual-trigger-quick-edit.html.php";
    }

    public function processQuickEditUpdate($postId)
    {
    // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
    // Don't run if this is an auto save
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    return;
    }

    // Don't update data if the function is called for saving revision.
    $postType = get_post_type((int)$postId);
    if ($postType === 'revision') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $view = $_POST['future_workflow_view'] ?? '';

    if (empty($view) || $view !== 'quick-edit') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel = new PostModel();
    $postModel->load($postId);
    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);
    // phpcs:enable
    }

    private function triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows)
    {
    // Trigger the action to trigger those workflows
    foreach ($manuallyEnabledWorkflows as $workflowId) {
    $this->hooks->doAction(HooksAbstract::ACTION_MANUALLY_TRIGGERED_WORKFLOW, (int)$postId, (int)$workflowId);
    }
    }

    public function enqueueQuickEditScripts()
    {
    // Only enqueue scripts if we are in the post list table

    if (get_current_screen()->base !== 'edit') {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script_quick_edit",
    Plugin::getScriptUrl('workflowManualSelectionQuickEdit'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    wp_localize_script(
    "future_workflow_manual_selection_script_quick_edit",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    ]
    );
    }

    public function enqueueBlockEditorScripts()
    {
    global $post;

    if (! $post || is_null($post->ID)) {
    error_log('Post is null or ID is not set, cannot enqueue block editor scripts.');
    return;
    }

    $this->isBlockEditor = true;

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $workflowsWithManualTrigger = $postModel->getValidWorkflowsWithManualTrigger($post->ID);

    if (empty($workflowsWithManualTrigger)) {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script_block_editor",
    Plugin::getScriptUrl('workflowManualSelectionBlockEditor'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    wp_localize_script(
    "future_workflow_manual_selection_script_block_editor",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    "postId" => $post->ID,
    ]
    );
    }

    public function registerRestField()
    {
    $postTypesModel = new PostTypesModel();
    $postTypes = $postTypesModel->getPostTypes();

    foreach ($postTypes as $postType) {
    register_rest_field(
    $postType->name,
    'publishpress_future_workflow_manual_trigger',
    [
    'get_callback' => function ($post) {
    $post = get_post();

    if (! $post || is_null($post->ID)) {
    return [
    'enabledWorkflows' => []
    ];
    }

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $enabledWorkflows = $postModel->getManuallyEnabledWorkflows();

    return [
    'enabledWorkflows' => $enabledWorkflows,
    ];
    },
    'update_callback' => function ($manualTriggerAttributes, $post) {
    $postModel = new PostModel();
    $postModel->load($post->ID);

    $manuallyEnabledWorkflows = $manualTriggerAttributes['enabledWorkflows'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($post->ID, $manuallyEnabledWorkflows);

    return true;
    },
    'schema' => [
    'description' => 'Workflow Manual Trigger',
    'type' => 'object',
    ]
    ]
    );
    }
    }

    public function registerClassicEditorMetabox($postType, $post)
    {
    if ($this->isBlockEditor || !isset($post) || !is_object($post) || is_null($post->ID)) {
    error_log('Post is null or ID is not set, cannot load workflows.');
    return;
    }

    $postModel = new PostModel();
    $postModel->load($post->ID);

    $workflows = $postModel->getValidWorkflowsWithManualTrigger($post->ID);

    if (empty($workflows)) {
    return;
    }

    add_meta_box(
    'future_workflow_manual_trigger',
    __('Action Workflows', 'post-expirator'),
    [$this, 'renderClassicEditorMetabox'],
    $postType,
    'side',
    'default',
    [$post]
    );
    }

    public function renderClassicEditorMetabox($post)
    {
    require_once __DIR__ . "/../Views/manual-trigger-classic-editor.html.php";
    }

    public function processMetaboxUpdate($postId)
    {
    // phpcs:disable WordPress.Security.NonceVerification.Missing
    // Don't run if this is an auto save
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    return;
    }

    // Don't update data if the function is called for saving revision.
    $postType = get_post_type((int)$postId);
    if ($postType === 'revision') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $view = $_POST['future_workflow_view'] ?? '';

    if (empty($view) || $view !== 'classic-editor') {
    return;
    }

    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];
    $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);

    $postModel = new PostModel();
    $postModel->load($postId);
    $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);

    $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);
    // phpcs:enable
    }

    public function enqueueScripts()
    {
    // Only enqueue scripts if we are in the post edit screen
    if (get_current_screen()->id !== 'post') {
    return;
    }

    wp_enqueue_style("wp-components");

    wp_enqueue_script("wp-components");
    wp_enqueue_script("wp-plugins");
    wp_enqueue_script("wp-element");
    wp_enqueue_script("wp-data");

    wp_enqueue_script(
    "future_workflow_manual_selection_script",
    Plugin::getScriptUrl('workflowManualSelectionClassicEditor'),
    [
    "wp-plugins",
    "wp-components",
    "wp-element",
    "wp-data",
    ],
    PUBLISHPRESS_FUTURE_VERSION,
    true
    );

    $post = get_post();

    wp_localize_script(
    "future_workflow_manual_selection_script",
    "futureWorkflowManualSelection",
    [
    "nonce" => wp_create_nonce("wp_rest"),
    "apiUrl" => rest_url("publishpress-future/v1"),
    "postId" => $post->ID,
    ]
    );
    }
    }

    Resolved file:
    /post-expirator/src/Modules/Workflows/Controllers/ManualPostTrigger.php

    Thread Starter jdp2002

    (@jdp2002)

    Thanks for the reply. It is all setup as per your link but the redirect isn’t working after successfully setting the password.

    Ideally auto login would be preferred but even redirect to the login page would br suitable.

    Thread Starter jdp2002

    (@jdp2002)

    Hi Stef, unfortunately no resolution from above suggestions. Have had to find a different solution for my invoices as I can see others have had issues with similar problems. Thanks for support regardless.

    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
    /**
     * Redirect user after successful login.
     *
     * @param string $redirect_to URL to redirect to.
     * @param string $request URL the user is coming from.
     * @param object $user Logged user's data.
     * @return string
     */
    function my_login_redirect( $redirect_to, $request, $user ) {
    	// is there a user to check?
    	if ( isset( $user->roles ) && is_array( $user->roles ) ) {
    		// check for admins
    		if ( in_array( 'administrator', $user->roles ) ) {
    			// redirect them to the default place
    			return $redirect_to;
    		} else {
    			return site_url( '(CHANGE THIS TO YOUR URL DESTINATION)' );
    		}
    	} else {
    		return $redirect_to;
    	}
    }

    Here’s a code snippet for login redirection if anyone needs.

    Thread Starter jdp2002

    (@jdp2002)

    Yes i shall try to explain better.
    At present when the Post Expiration expires example 1 day a email is generated and sent to the creator of the post.

    The email itself seems to come from “WordPress@{sitedomain}” and not the Site Administrators email as setup in WordPress Settings so a user may think this is potential SPAM and ignore the email.

    The other issue is the Subject of the Email sent to the user which is currently:

    {site title} Your Post Has Been Expired

    This isn’t great english and should be “Your Post Has Expired” or allowing developers to edit their own subject like you can email content itself.

    Additional features could be Post Expiration Schedules for example 3 days before the expiration, a pre alert email to allow someone to renew a post before it expires.

    I obviously could go in and edit your files but thought i’d point out it needs addressing.

    • This reply was modified 1 year, 8 months ago by jdp2002.
    Thread Starter jdp2002

    (@jdp2002)

    Thanks for the response, I don’t think you have understood my query.

    I have the post expire working but the emails to the user to say it has expired doesn’t come from the sites admin email address but a default wordpress email address.

    [email protected] send to the user not using the administrator email address.

    This also means the title in the email is WordPress than an example Support or noreply.

    Plus the poor English in the subject as mentioned.

    • This reply was modified 1 year, 9 months ago by jdp2002.
Viewing 9 replies - 1 through 9 (of 9 total)