Okay
  Public Ticket #3186394
Deleted Posts Included
Closed

Comments

  • Howard started the conversation

    I created a table using your SQL query builder.  I used a custom post type as the data source.  The query results include deleted posts.  Is that by design?

  • Howard replied

    The same query also isn't capturing all the posts.  One post is missing.  The post is shown by WP in the admin.

  • Howard replied

    I figured out the missing post.

    The missing post had no data in a required ACF field.  I don't think the query you build should exclude posts because they have invalid or missing data.

  • Howard replied

    To solve the deleted posts problem, I added:

    AND posts_projects.post_status = 'publish'

    to the SQL query your plugin generated.

  •  1,850
    Miloš replied

    Hi, Howard 

    Sorry for the delay

    -

    Thank you for reaching out to us

    As the custom posts/fields, are a part of the WordPress database;

    pulling this data can only be done through MySQL query-based tables.

    Please note: Using this plugin feature requires at least a basic knowledge of SQL. It is assumed that you can create the table in some MySQL data manager (e.g., PHPMyAdmin, MySQL Workbench), and prepare a SQL query that will return the data you need. 

    -

    A good way to achieve this can be experimenting using our WPDB SQL Query Constructor tool, as you did here.

    - Please note: this tool is not an ultimate query generator.

     It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. 

    Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.

    Please be advised that writing custom SQL Queries or debugging Queries does not fall under what our support covers.

    You can check out this official page of WP codex,  for help with writing custom Queries.

    -

    Thank you for sharing your workaround in this use-case, i will pass it to our developers, i am sure it will be useful for future improvements of our Query Constructor Helper Tool.

    Please don't hesitate to reach out to us if you have any additional questions.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables