• Resolved RLDD

    (@rermis)


    The use of query_vars for passing of vscf parameters is querying and returning all blog posts on my installation when a vscf form is submitted. The use of query_vars is inherently global and vscf vars aren’t required for the main WP_Query, so it’s not entirely appropriate to use them inside query_vars.

    My workaround is to comment out // add_filter( ‘query_vars’, ‘vscf_add_query_vars_filter’ ); in vscf.php.

    Then at the end of function vscf_shortcode, change get_query_var(‘vscfsp’) || get_query_var(‘vscfep’) to… isset($_GET[‘vscfsp’]) || isset($_GET[‘vscfep’])

    This isn’t perfect, but hopefully this bug can be fixed in a similar way before the next release?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    The use of query_vars for passing of vscf parameters is querying and returning all blog posts on my installation when a vscf form is submitted.

    This should not happen of course. Did quite some testing with the vars before this update and it worked fine. What query string (URL) returns all your blog posts? I would like to try this myself, on my local install.

    I now realise the way I’ve implemented it, the query string generates a query.

    Will fix this asap!

    Guido

    Thread Starter RLDD

    (@rermis)

    Hi Guido,

    I can’t explain exactly how this is happening, but I made sure this was a legit bug by deactivating all plugins except vscf and re-testing submissions, to make sure the bug persisted. I was able to isolate the issue to the query_vars function, and confirm that bypassing it resolved the issue. If it helps, my permalink settings are set to “Post name”.

    Plugin Author Guido

    (@guido07111975)

    Hi,

    I will remove the query vars action and function again, and will use the $_GET() method instead. I now wonder why I didn’t thought of this before. Guess I’ve read somewhere the $_GET() method isn’t the best way to do this, but I think it works just fine.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi @rermis

    I have updated plugin few moments ago, could you please let me know how it works now?

    Guido

    Thread Starter RLDD

    (@rermis)

    Hi Guido, it tested perfectly. Thank you!

    Plugin Author Guido

    (@guido07111975)

    That’s great. Have a nice weekend!

    Guido

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Use of query_vars showing all blogs posts’ is closed to new replies.