• Resolved oct4v3

    (@oct4v3)


    Hey,

    Thanks for the nice plugin.

    I want you to help me with post time eligibility, like i have posts which are newer like 1-3 days old, i want them to auto republish on its own. Where can i replace 30 days to 1 day time please?
    I tried with other localhost setup with older posts than 30 days and choose 30 days time, I wanted to test, so it didnt really auto republish the posts every hour or so.

    What i want to achieve is, setup auto republish with 1-3 days old posts, once eligible posts found, than from thereafter it always do auto republish with like 12 hours delay or so random posts. Please can you guide me a bit where to edit the code?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sayan Datta

    (@infosatech)

    Hi @oct4v3

    Go to wp-content\plugins\wp-auto-republish\admin\settings-fields.php on line 99 and add this line $items = apply_filters( 'wpar_republish_eligibility_age', $items );.

    Before: https://prntscr.com/mfrge4
    After: https://prntscr.com/mfrgzc

    And then add this snippets to the end of your active theme’s functions.php file:

    add_filter( 'wpar_republish_eligibility_age', 'wpar_add_custom_age' );
    
    function wpar_add_custom_age( $items ) {
        $item = array(
            '1' => __( '1 Day', 'wp-auto-republish' ),
            '2' => __( '2 Days', 'wp-auto-republish' ),
            '3' => __( '3 Days', 'wp-auto-republish' )
        );
        return array_unique( array_merge( $item, $items ) );
    }

    This will add options like this: https://prntscr.com/mfrfby. Then select resave changes.

    Thanks!

    • This reply was modified 6 years, 1 month ago by Sayan Datta.
    Thread Starter oct4v3

    (@oct4v3)

    Hey, i have done as you said, Snippet 1 and Snippet 2

    I have added Snippet 2 to functions.php file in current active theme, but unfortunately, i cannot see the dropdown option of 1,2,3 days yet in your plugin options.

    Do i need to maybe add these options of day in your plugin for snippet 2 aswell?

    How does it relate to add snippet to function.php file of active theme?

    Thanks for quick reponse

    Appreciated

    Thread Starter oct4v3

    (@oct4v3)

    On Settings-fields.php files
    I just edited Line 87:

        $items = array(
            '1' => __( '1 Day', 'wp-auto-republish' ),
            '2' => __( '2 Days', 'wp-auto-republish' ),
            '3' => __( '3 Days', 'wp-auto-republish' ),
            '30'   => __( '30 Days (1 month)', 'wp-auto-republish' ),
            '45'   => __( '45 Days (1.5 months)', 'wp-auto-republish' ),
            '60'   => __( '60 Days (2 months)', 'wp-auto-republish' ),
            '90'   => __( '90 Days (3 months)', 'wp-auto-republish' ),
            '120'  => __( '120 Days (4 months)', 'wp-auto-republish' ),
            '180'  => __( '180 Days (6 months)', 'wp-auto-republish' ),
            '240'  => __( '240 Days (8 months)', 'wp-auto-republish' ),
            '365'  => __( '365 Days (1 year)', 'wp-auto-republish' ),
            '730'  => __( '730 Days (2 years)', 'wp-auto-republish' ),
            '1095' => __( '1095 Days (3 years)', 'wp-auto-republish' )
        );

    Is this correct? I didnt add anything in functions.php file of current active theme, will this work?

    Thanks

    Thread Starter oct4v3

    (@oct4v3)

    OK i saw and fixed as you mentioned, its showing there in dropdown all good.

    But its not changing post publish dates which were published like 1-3 days ago

    What setting do i need to use?

    I want to publish each post which were published like 1 or 2 or 3 days ago

    I have resaved the settings with 1 day ago, but it didnt republish

    Please help with screenshot of settings

    I want this setting to work:

    https://prntscr.com/mft3bj

    Minimum Republish Time is 6 hours

    But it isnt working, not republishing post, is it maybe time setting? Or is cron is of an issue? All good on my hosting.

    Thanks

    • This reply was modified 6 years, 1 month ago by oct4v3.
    Plugin Author Sayan Datta

    (@infosatech)

    Hi @oct4v3

    I can suggest you this:

        $items = array(
            '1' => __( '1 Day', 'wp-auto-republish' ),
            '2' => __( '2 Days', 'wp-auto-republish' ),
            '3' => __( '3 Days', 'wp-auto-republish' ),
            '30'   => __( '30 Days (1 month)', 'wp-auto-republish' ),
            '45'   => __( '45 Days (1.5 months)', 'wp-auto-republish' ),
            '60'   => __( '60 Days (2 months)', 'wp-auto-republish' ),
            '90'   => __( '90 Days (3 months)', 'wp-auto-republish' ),
            '120'  => __( '120 Days (4 months)', 'wp-auto-republish' ),
            '180'  => __( '180 Days (6 months)', 'wp-auto-republish' ),
            '240'  => __( '240 Days (8 months)', 'wp-auto-republish' ),
            '365'  => __( '365 Days (1 year)', 'wp-auto-republish' ),
            '730'  => __( '730 Days (2 years)', 'wp-auto-republish' ),
            '1095' => __( '1095 Days (3 years)', 'wp-auto-republish' )
        );

    But if you update this plugin then this customization will be gone.

    I want to publish each post which were published like 1 or 2 or 3 days ago
    I have resaved the settings with 1 day ago, but it didnt republish

    Please check your settings twice as it is working perfectly on my end.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change Post Eligibility Time’ is closed to new replies.