• Resolved Sergio Fortini

    (@sfortini)


    Please, what is the format for the “before” and “after” parameters in the shortcode?
    I have made many attempts but without finding the solution.
    Note that I use wpapi = false.
    Can you give some examples?
    Thank you.
    Sergio

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I would recommend using iso 8601 date parameters, e.g. 2021-03-12. It should work that way.

    Thread Starter Sergio Fortini

    (@sfortini)

    Thanks, so I’ve already tried. Does not work.
    In quotes or not.

    [jeherve_post_embed url=”https://www.gattezzadifoligno.it” wpapi=false include_title=false include_images=false include_excerpt=false include_content=true before=”2021-03-03″]

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    hm, that’s odd. I’ll take a closer look next week. In the meantime, and if you feel comfortable editing PHP files, could you try to edit the plugin’s files and see if that fixes your problem? In the rest-api-post-embeds.php file, on line 732, you should see this:

    $before = $this->jeherve_post_embed_convert_date( $atts['before'] );

    Could you try to replace that line with

    $before = $atts['before'];

    Let me know how it goes.

    Thread Starter Sergio Fortini

    (@sfortini)

    Thanks,
    I await your verification.
    Sergio

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’ve just released an update for my plugin, that should fix the issue. Let me know how it goes!

    Thread Starter Sergio Fortini

    (@sfortini)

    Now it works correctly.
    However it is not possible to use “before” and “after” to implement the “beetween” function, for example using the same date for “before” and “after”.
    Maybe in a future update.
    Thank you.
    Sergio

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m afraid that will not be possible. WordPress’ REST API does not allow one to specify the inclusive date query parameter when fetching posts via the API; that option is only available when fetching posts via direct queries on the site.

    That said, if the option becomes available with WordPress one day, I’ll be happy to use it in my plugin!

    Thread Starter Sergio Fortini

    (@sfortini)

    No problem.
    My need is to get a single day which corresponds, in my case, always to a single post.
    To get, for example, the post of the day 2021-03-16, I use this selection:
    before=”2021-03-17″ after=”2021-03-15″ number=”1″
    Thank you.
    Sergio

    (see: https://www.sergiofortini.it wich link to https://www.gattezzadifoligno.it)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Date format for “before” and “after”.’ is closed to new replies.