<!-- Generated by SpecStory, Markdown v2.1.0 -->

# 2026-02-12 19:37:14Z

<!-- cursoride Session 28a59af9-c51d-4b3b-9491-11052c01bab3 (2026-02-12 19:37:14Z) -->

_**User**_

i forget what part of the plugin adds vehicle meta fields to searches to help users find vehicles

---

_**Agent (composer-1.5)**_





_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="semantic_search_full">
<details>
<summary>Tool use: **semantic_search_full**</summary>


Parameters:

```json
{
  "explanation": "",
  "includePattern": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "query": "Where are vehicle meta fields added to search to help users find vehicles?",
  "topK": 10
}
```
Result:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "contents": "\t\t * @return string\n\t\t */\n\t\tpublic function cf_search_join( $join ) {\n\t\t\tglobal $wpdb;\n\n\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {\n\t\t\t\treturn $join;\n\t\t\t}\n\n\t\t\t// join to search post meta values like year, make, model, trim, etc.\n\t\t\t$join .= \" LEFT JOIN $wpdb-\u003epostmeta searchmeta ON $wpdb-\u003eposts.ID = searchmeta.post_id \";\n\t\t\treturn $join;\n\t\t}\n\n\t\t/**\n\t\t * Modify the search query with posts_where\n\t\t *\n\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where\n\t\t *\n\t\t * @param  string $where\n\t\t * @return string\n\t\t */\n\t\tpublic function cf_search_where( $where ) {\n\n\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\tglobal $wpdb;\n\t\t\t$where = preg_replace(\n\t\t\t\t\"/\\(\\s*$wpdb-\u003eposts.post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n\t\t\t\t\"($wpdb-\u003eposts.post_title LIKE $1) OR ( searchmeta.meta_value LIKE $1 ) \",\n\t\t\t\t$where\n\t\t\t);\n\n\t\t\treturn $where;\n\t\t}\n\t}\n}",
        "detailedLines": [
          {
            "lineNumber": 64,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 65,
            "text": "\t\t */"
          },
          {
            "lineNumber": 66,
            "text": "\t\tpublic function cf_search_join( $join ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn $join;"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 72
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t// join to search post meta values like year, make, model, trim, etc."
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t$join .= \" LEFT JOIN $wpdb-\u003epostmeta searchmeta ON $wpdb-\u003eposts.ID = searchmeta.post_id \";"
          },
          {
            "lineNumber": 75,
            "text": "\t\t\treturn $join;"
          },
          {
            "lineNumber": 76,
            "text": "\t\t}"
          },
          {
            "lineNumber": 77
          },
          {
            "lineNumber": 78,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * Modify the search query with posts_where"
          },
          {
            "lineNumber": 80,
            "text": "\t\t *"
          },
          {
            "lineNumber": 81,
            "text": "\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where"
          },
          {
            "lineNumber": 82,
            "text": "\t\t *"
          },
          {
            "lineNumber": 83,
            "text": "\t\t * @param  string $where"
          },
          {
            "lineNumber": 84,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 85,
            "text": "\t\t */"
          },
          {
            "lineNumber": 86,
            "text": "\t\tpublic function cf_search_where( $where ) {"
          },
          {
            "lineNumber": 87
          },
          {
            "lineNumber": 88,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\treturn $where;"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 91
          },
          {
            "lineNumber": 92,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t$where = preg_replace("
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t\t\"/\\(\\s*$wpdb-\u003eposts.post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\","
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t\t\"($wpdb-\u003eposts.post_title LIKE $1) OR ( searchmeta.meta_value LIKE $1 ) \","
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t\t$where"
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 98
          },
          {
            "lineNumber": 99,
            "text": "\t\t\treturn $where;"
          },
          {
            "lineNumber": 100,
            "text": "\t\t}"
          },
          {
            "lineNumber": 101,
            "text": "\t}"
          },
          {
            "lineNumber": 102,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 102
          },
          "startPosition": {
            "line": 63
          }
        },
        "relativeWorkspacePath": "./includes/class-add-custom-fields-to-search.php",
        "signatures": {}
      },
      "score": 0.38248929381370544
    },
    {
      "codeBlock": {
        "contents": "\t\t/**\n\t\t * Action hook callback. Prevents vehicles from lingering in the Trash after\n\t\t * they've been deleted if a plugin setting dictates such behavior.\n\t\t *\n\t\t * @param  int $post_id\n\t\t * @return void\n\t\t */\n\t\tpublic function maybe_force_delete( $post_id ) {\n\t\t\t// is the post a vehicle?\n\t\t\tif ( INVP::POST_TYPE !== get_post_type( $post_id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$settings = INVP::settings();\n\t\t\tif ( ! $settings['skip_trash'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// force delete.\n\t\t\twp_delete_post( $post_id, true );\n\t\t}\n\n\t\t/**\n\t\t * Registers all meta fields our custom post type uses to define a vehicle\n\t\t * and its attachments.\n\t\t *\n\t\t * @return void\n\t\t */\n\t\tpublic function register_meta_fields() {\n\t\t\t// Add meta fields to our post type.\n\t\t\tforeach ( INVP::keys_and_types( true ) as $key_arr ) {\n\n\t\t\t\tif ( empty( $key_arr['name'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\n\t\t\t\tregister_post_meta(\n\t\t\t\t\tINVP::POST_TYPE,\n\t\t\t\t\t$key,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'show_in_rest' =\u003e true,\n\t\t\t\t\t\t'single'       =\u003e 'options_array' !== $key_arr['name'],\n\t\t\t\t\t\t'type'         =\u003e $key_arr['type'] ?? 'string',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Add a couple fields that are used on media attachments.\n\t\t\t$attachment_keys   = array();\n\t\t\t$attachment_keys[] = array(\n\t\t\t\t'name' =\u003e 'hash',\n\t\t\t\t'type' =\u003e 'string',\n\t\t\t);\n\t\t\t$attachment_keys[] = array(\n\t\t\t\t'name' =\u003e 'photo_number',\n\t\t\t\t'type' =\u003e 'integer',\n\t\t\t);\n\t\t\t$attachment_keys[] = array(\n\t\t\t\t'name' =\u003e 'vin',\n\t\t\t\t'type' =\u003e 'string',\n\t\t\t);\n\n\t\t\t// Add meta fields to attachments.\n\t\t\tforeach ( $attachment_keys as $key_arr ) {\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\n\t\t\t\tregister_post_meta(\n\t\t\t\t\t'attachment',\n\t\t\t\t\t$key,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sanitize_callback' =\u003e 'sanitize_text_field',\n\t\t\t\t\t\t'show_in_rest'      =\u003e true,\n\t\t\t\t\t\t'single'            =\u003e true,\n\t\t\t\t\t\t'type'              =\u003e $key_arr['type'],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Registers every widget that ships with this plugin.\n\t\t *",
        "detailedLines": [
          {
            "lineNumber": 1676,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 1677,
            "text": "\t\t * Action hook callback. Prevents vehicles from lingering in the Trash after"
          },
          {
            "lineNumber": 1678,
            "text": "\t\t * they've been deleted if a plugin setting dictates such behavior."
          },
          {
            "lineNumber": 1679,
            "text": "\t\t *"
          },
          {
            "lineNumber": 1680,
            "text": "\t\t * @param  int $post_id"
          },
          {
            "lineNumber": 1681,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 1682,
            "text": "\t\t */"
          },
          {
            "lineNumber": 1683,
            "text": "\t\tpublic function maybe_force_delete( $post_id ) {"
          },
          {
            "lineNumber": 1684,
            "text": "\t\t\t// is the post a vehicle?"
          },
          {
            "lineNumber": 1685,
            "text": "\t\t\tif ( INVP::POST_TYPE !== get_post_type( $post_id ) ) {"
          },
          {
            "lineNumber": 1686,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 1687,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1688
          },
          {
            "lineNumber": 1689,
            "text": "\t\t\t$settings = INVP::settings();"
          },
          {
            "lineNumber": 1690,
            "text": "\t\t\tif ( ! $settings['skip_trash'] ) {"
          },
          {
            "lineNumber": 1691,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 1692,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1693
          },
          {
            "lineNumber": 1694,
            "text": "\t\t\t// force delete."
          },
          {
            "lineNumber": 1695,
            "text": "\t\t\twp_delete_post( $post_id, true );"
          },
          {
            "lineNumber": 1696,
            "text": "\t\t}"
          },
          {
            "lineNumber": 1697
          },
          {
            "lineNumber": 1698,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 1699,
            "text": "\t\t * Registers all meta fields our custom post type uses to define a vehicle"
          },
          {
            "lineNumber": 1700,
            "text": "\t\t * and its attachments."
          },
          {
            "lineNumber": 1701,
            "text": "\t\t *"
          },
          {
            "lineNumber": 1702,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 1703,
            "text": "\t\t */"
          },
          {
            "lineNumber": 1704,
            "text": "\t\tpublic function register_meta_fields() {"
          },
          {
            "lineNumber": 1705,
            "text": "\t\t\t// Add meta fields to our post type."
          },
          {
            "lineNumber": 1706,
            "text": "\t\t\tforeach ( INVP::keys_and_types( true ) as $key_arr ) {"
          },
          {
            "lineNumber": 1707
          },
          {
            "lineNumber": 1708,
            "text": "\t\t\t\tif ( empty( $key_arr['name'] ) ) {"
          },
          {
            "lineNumber": 1709,
            "text": "\t\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1710,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 1711,
            "text": "\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );"
          },
          {
            "lineNumber": 1712,
            "text": "\t\t\t\tregister_post_meta("
          },
          {
            "lineNumber": 1713,
            "text": "\t\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 1714,
            "text": "\t\t\t\t\t$key,"
          },
          {
            "lineNumber": 1715,
            "text": "\t\t\t\t\tarray("
          },
          {
            "lineNumber": 1716,
            "text": "\t\t\t\t\t\t'show_in_rest' =\u003e true,"
          },
          {
            "lineNumber": 1717,
            "text": "\t\t\t\t\t\t'single'       =\u003e 'options_array' !== $key_arr['name'],"
          },
          {
            "lineNumber": 1718,
            "text": "\t\t\t\t\t\t'type'         =\u003e $key_arr['type'] ?? 'string',"
          },
          {
            "lineNumber": 1719,
            "text": "\t\t\t\t\t)"
          },
          {
            "lineNumber": 1720,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 1721,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1722
          },
          {
            "lineNumber": 1723,
            "text": "\t\t\t// Add a couple fields that are used on media attachments."
          },
          {
            "lineNumber": 1724,
            "text": "\t\t\t$attachment_keys   = array();"
          },
          {
            "lineNumber": 1725,
            "text": "\t\t\t$attachment_keys[] = array("
          },
          {
            "lineNumber": 1726,
            "text": "\t\t\t\t'name' =\u003e 'hash',"
          },
          {
            "lineNumber": 1727,
            "text": "\t\t\t\t'type' =\u003e 'string',"
          },
          {
            "lineNumber": 1728,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1729,
            "text": "\t\t\t$attachment_keys[] = array("
          },
          {
            "lineNumber": 1730,
            "text": "\t\t\t\t'name' =\u003e 'photo_number',"
          },
          {
            "lineNumber": 1731,
            "text": "\t\t\t\t'type' =\u003e 'integer',"
          },
          {
            "lineNumber": 1732,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1733,
            "text": "\t\t\t$attachment_keys[] = array("
          },
          {
            "lineNumber": 1734,
            "text": "\t\t\t\t'name' =\u003e 'vin',"
          },
          {
            "lineNumber": 1735,
            "text": "\t\t\t\t'type' =\u003e 'string',"
          },
          {
            "lineNumber": 1736,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1737
          },
          {
            "lineNumber": 1738,
            "text": "\t\t\t// Add meta fields to attachments."
          },
          {
            "lineNumber": 1739,
            "text": "\t\t\tforeach ( $attachment_keys as $key_arr ) {"
          },
          {
            "lineNumber": 1740,
            "text": "\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );"
          },
          {
            "lineNumber": 1741,
            "text": "\t\t\t\tregister_post_meta("
          },
          {
            "lineNumber": 1742,
            "text": "\t\t\t\t\t'attachment',"
          },
          {
            "lineNumber": 1743,
            "text": "\t\t\t\t\t$key,"
          },
          {
            "lineNumber": 1744,
            "text": "\t\t\t\t\tarray("
          },
          {
            "lineNumber": 1745,
            "text": "\t\t\t\t\t\t'sanitize_callback' =\u003e 'sanitize_text_field',"
          },
          {
            "lineNumber": 1746,
            "text": "\t\t\t\t\t\t'show_in_rest'      =\u003e true,"
          },
          {
            "lineNumber": 1747,
            "text": "\t\t\t\t\t\t'single'            =\u003e true,"
          },
          {
            "lineNumber": 1748,
            "text": "\t\t\t\t\t\t'type'              =\u003e $key_arr['type'],"
          },
          {
            "lineNumber": 1749,
            "text": "\t\t\t\t\t)"
          },
          {
            "lineNumber": 1750,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 1751,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1752,
            "text": "\t\t}"
          },
          {
            "lineNumber": 1753
          },
          {
            "lineNumber": 1754,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 1755,
            "text": "\t\t * Registers every widget that ships with this plugin."
          },
          {
            "lineNumber": 1756,
            "text": "\t\t *"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1756
          },
          "startPosition": {
            "line": 1675
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.33186984062194824
    },
    {
      "codeBlock": {
        "contents": "\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'year':\n\t\t\t\t\t$query-\u003eset(\n\t\t\t\t\t\t'meta_query',\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$old,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'relation' =\u003e 'AND',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),\n\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Boat fields might not exist on all vehicles. Do not require them.\n\t\t\t\tcase 'beam':\n\t\t\t\tcase 'condition_boat':\n\t\t\t\tcase 'draft':\n\t\t\t\tcase 'engine_count':\n\t\t\t\tcase 'engine_make':\n\t\t\t\tcase 'engine_model':\n\t\t\t\tcase 'horsepower':\n\t\t\t\tcase 'hull_material':\n\t\t\t\tcase 'length':\n\t\t\t\t\t$query-\u003eset( 'meta_key', '' );",
        "detailedLines": [
          {
            "lineNumber": 204,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 205
          },
          {
            "lineNumber": 206,
            "text": "\t\t\t\tcase 'year':"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 208,
            "text": "\t\t\t\t\t\t'meta_query',"
          },
          {
            "lineNumber": 209,
            "text": "\t\t\t\t\t\tarray_merge("
          },
          {
            "lineNumber": 210,
            "text": "\t\t\t\t\t\t\t$old,"
          },
          {
            "lineNumber": 211,
            "text": "\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 212,
            "text": "\t\t\t\t\t\t\t\t'relation' =\u003e 'AND',"
          },
          {
            "lineNumber": 213,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 214,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 215,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 216,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 217,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 218,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 219,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 220,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 221,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 222,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 223,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 224,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 225,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 226,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 227,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 228,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 229,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 230,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 231,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 232,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 233,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 234,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 235,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 236,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 237,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 238,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 239,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 240,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 241,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 242,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 243,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 244,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 245,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 246,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 247,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 248,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 249,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 250,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 251,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 252,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 253,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 254,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 255,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 256,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 257,
            "text": "\t\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 258,
            "text": "\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 259,
            "text": "\t\t\t\t\t);"
          },
          {
            "lineNumber": 260,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 261
          },
          {
            "lineNumber": 262,
            "text": "\t\t\t\t// Boat fields might not exist on all vehicles. Do not require them."
          },
          {
            "lineNumber": 263,
            "text": "\t\t\t\tcase 'beam':"
          },
          {
            "lineNumber": 264,
            "text": "\t\t\t\tcase 'condition_boat':"
          },
          {
            "lineNumber": 265,
            "text": "\t\t\t\tcase 'draft':"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\t\tcase 'engine_count':"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\t\tcase 'engine_make':"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t\tcase 'engine_model':"
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\tcase 'horsepower':"
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\tcase 'hull_material':"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\tcase 'length':"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\t\t$query-\u003eset( 'meta_key', '' );"
          }
        ],
        "range": {
          "endPosition": {
            "line": 272
          },
          "startPosition": {
            "line": 203
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.331102192401886
    },
    {
      "codeBlock": {
        "contents": "\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Modifies the queries with the vehicle post type to include price and\n\t\t * odometer ranges, if they're also provided.\n\t\t *\n\t\t * @param  mixed $query\n\t\t * @return void\n\t\t */\n\t\tpublic static function modify_query_for_price_and_odometer_ranges( $query ) {\n\t\t\t// Is this query for vehicles?\n\t\t\tif ( INVP::POST_TYPE !== $query-\u003eget( 'post_type', '' ) ) {\n\t\t\t\t// No.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only filter the main query unless an override filter.\n\t\t\tif ( ! $query-\u003eis_main_query() \u0026\u0026 apply_filters( 'invp_range_filters_main_query', true ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is there a filter in the query string?\n\t\t\tif ( ! isset( $_GET['min_price'] )\n\t\t\t\t\u0026\u0026 ! isset( $_GET['max_price'] )\n\t\t\t\t\u0026\u0026 ! isset( $_GET['min_odometer'] )\n\t\t\t\t\u0026\u0026 ! isset( $_GET['max_odometer'] )\n\t\t\t\t\u0026\u0026 ! isset( $_GET['min_down'] )\n\t\t\t\t\u0026\u0026 ! isset( $_GET['max_down'] )\n\t\t\t) {\n\t\t\t\t// No.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get original meta query.\n\t\t\t$meta_query = $query-\u003eget( 'meta_query', array() );\n\t\t\tif ( ! is_array( $meta_query ) ) {\n\t\t\t\t$meta_query = array();\n\t\t\t}\n\n\t\t\t$meta_query['relation'] = 'AND';\n\n\t\t\t// Price filters.\n\t\t\tif ( isset( $_GET['max_price'] ) ) {\n\t\t\t\t$meta_query = self::add_meta_query(\n\t\t\t\t\t$meta_query,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),\n\t\t\t\t\t(int) $_GET['max_price'],\n\t\t\t\t\t'\u003c=',\n\t\t\t\t\t'numeric'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $_GET['min_price'] ) ) {\n\t\t\t\t$meta_query = self::add_meta_query(\n\t\t\t\t\t$meta_query,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),\n\t\t\t\t\t(int) $_GET['min_price'],\n\t\t\t\t\t'\u003e=',\n\t\t\t\t\t'numeric'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Odometer filters.\n\t\t\tif ( isset( $_GET['min_odometer'] ) ) {\n\t\t\t\t$meta_query = self::add_meta_query(\n\t\t\t\t\t$meta_query,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'odometer' ),\n\t\t\t\t\t(int) $_GET['min_odometer'],\n\t\t\t\t\t'\u003e=',\n\t\t\t\t\t'numeric'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isset( $_GET['max_odometer'] ) ) {\n\t\t\t\t$meta_query = self::add_meta_query(\n\t\t\t\t\t$meta_query,",
        "detailedLines": [
          {
            "lineNumber": 75,
            "text": "\t\t\treturn null;"
          },
          {
            "lineNumber": 76,
            "text": "\t\t}"
          },
          {
            "lineNumber": 77
          },
          {
            "lineNumber": 78,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * Modifies the queries with the vehicle post type to include price and"
          },
          {
            "lineNumber": 80,
            "text": "\t\t * odometer ranges, if they're also provided."
          },
          {
            "lineNumber": 81,
            "text": "\t\t *"
          },
          {
            "lineNumber": 82,
            "text": "\t\t * @param  mixed $query"
          },
          {
            "lineNumber": 83,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 84,
            "text": "\t\t */"
          },
          {
            "lineNumber": 85,
            "text": "\t\tpublic static function modify_query_for_price_and_odometer_ranges( $query ) {"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t// Is this query for vehicles?"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\tif ( INVP::POST_TYPE !== $query-\u003eget( 'post_type', '' ) ) {"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 91
          },
          {
            "lineNumber": 92,
            "text": "\t\t\tif ( is_admin() ) {"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 95
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t// Only filter the main query unless an override filter."
          },
          {
            "lineNumber": 97,
            "text": "\t\t\tif ( ! $query-\u003eis_main_query() \u0026\u0026 apply_filters( 'invp_range_filters_main_query', true ) ) {"
          },
          {
            "lineNumber": 98,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 99,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 100
          },
          {
            "lineNumber": 101,
            "text": "\t\t\t// Is there a filter in the query string?"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\tif ( ! isset( $_GET['min_price'] )"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_price'] )"
          },
          {
            "lineNumber": 104,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['min_odometer'] )"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_odometer'] )"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['min_down'] )"
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_down'] )"
          },
          {
            "lineNumber": 108,
            "text": "\t\t\t) {"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 112
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t// Get original meta query."
          },
          {
            "lineNumber": 114,
            "text": "\t\t\t$meta_query = $query-\u003eget( 'meta_query', array() );"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\tif ( ! is_array( $meta_query ) ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t$meta_query = array();"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t$meta_query['relation'] = 'AND';"
          },
          {
            "lineNumber": 120
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t// Price filters."
          },
          {
            "lineNumber": 122,
            "text": "\t\t\tif ( isset( $_GET['max_price'] ) ) {"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 125,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),"
          },
          {
            "lineNumber": 126,
            "text": "\t\t\t\t\t(int) $_GET['max_price'],"
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t\t\t'\u003c=',"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 131
          },
          {
            "lineNumber": 132,
            "text": "\t\t\tif ( isset( $_GET['min_price'] ) ) {"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 135,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),"
          },
          {
            "lineNumber": 136,
            "text": "\t\t\t\t\t(int) $_GET['min_price'],"
          },
          {
            "lineNumber": 137,
            "text": "\t\t\t\t\t'\u003e=',"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 141
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t// Odometer filters."
          },
          {
            "lineNumber": 143,
            "text": "\t\t\tif ( isset( $_GET['min_odometer'] ) ) {"
          },
          {
            "lineNumber": 144,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 145,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 146,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'odometer' ),"
          },
          {
            "lineNumber": 147,
            "text": "\t\t\t\t\t(int) $_GET['min_odometer'],"
          },
          {
            "lineNumber": 148,
            "text": "\t\t\t\t\t'\u003e=',"
          },
          {
            "lineNumber": 149,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 150,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 151,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 152
          },
          {
            "lineNumber": 153,
            "text": "\t\t\tif ( isset( $_GET['max_odometer'] ) ) {"
          },
          {
            "lineNumber": 154,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 155,
            "text": "\t\t\t\t\t$meta_query,"
          }
        ],
        "range": {
          "endPosition": {
            "line": 155
          },
          "startPosition": {
            "line": 74
          }
        },
        "relativeWorkspacePath": "./includes/class-range-filters.php",
        "signatures": {}
      },
      "score": 0.3090831935405731
    },
    {
      "codeBlock": {
        "contents": "\tfunction titleStatusOptions()\n\t{\n\t\tvar options = [{label:'',value:''}];\n\t\tfor ( var l = 0; l \u003c invp.title_statuses.length; l++ ) {\n\t\t\toptions.push(\n\t\t\t\t{\n\t\t\t\t\tlabel: invp.title_statuses[l],\n\t\t\t\t\tvalue: invp.title_statuses[l]\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn options;\n\t}\n\n\tfunction ucwords( str )\n\t{\n\t\treturn (str + '').split( ' ' ).map( x =\u003e x.charAt( 0 ).toUpperCase() + x.substring( 1 ) ).join( ' ' );\n\t}\n\n\t// Most text fields.\n\tvar MetaBlockField = compose(\n\t\twithDispatch(\n\t\t\tfunction ( dispatch, props ) {\n\t\t\t\treturn {\n\t\t\t\t\tsetMetaFieldValue: function ( value ) {\n\t\t\t\t\t\t// Is this a numeric meta field? Can't save an empty string in those.\n\t\t\t\t\t\tif ( props.isNumeric \u0026\u0026 '' === value ) {\n\t\t\t\t\t\t\tvalue = '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdispatch( 'core/editor' ).editPost(\n\t\t\t\t\t\t\t{ meta: { [ props.fieldName ]: value } }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t),\n\t\twithSelect(\n\t\t\tfunction ( select, props ) {\n\t\t\t\treturn {\n\t\t\t\t\tmetaFieldValue: select( 'core/editor' )\n\t\t\t\t\t.getEditedPostAttribute( 'meta' )\n\t\t\t\t\t[ props.fieldName ],\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t)(\n\t\tfunction ( props ) {\n\t\t\treturn el(\n\t\t\t\tText,\n\t\t\t\t{\n\t\t\t\t\tlabel: getLabel( props.fieldName ),\n\t\t\t\t\tvalue: props.metaFieldValue,\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tonChange: function ( content ) {\n\t\t\t\t\t\tprops.setMetaFieldValue( content );\n\t\t\t\t\t},\n\t\t\t\t\tonInput: function ( event ) {\n\t\t\t\t\t\t// Is this the VIN field?\n\t\t\t\t\t\tif ( props.fieldName === invp.meta_prefix + 'vin' ) {\n\t\t\t\t\t\t\t// Yes.\n\t\t\t\t\t\t\t// Is the VIN Decoding plugin active?\n\t\t\t\t\t\t\tif ( typeof window.invp_vin_decoder_maybe_decode === 'function' ) {\n\t\t\t\t\t\t\t\t// Yes.\n\t\t\t\t\t\t\t\twindow.invp_vin_decoder_maybe_decode( event );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\t// Text field that allows only digits.",
        "detailedLines": [
          {
            "lineNumber": 148,
            "text": "\tfunction titleStatusOptions()"
          },
          {
            "lineNumber": 149,
            "text": "\t{"
          },
          {
            "lineNumber": 150,
            "text": "\t\tvar options = [{label:'',value:''}];"
          },
          {
            "lineNumber": 151,
            "text": "\t\tfor ( var l = 0; l \u003c invp.title_statuses.length; l++ ) {"
          },
          {
            "lineNumber": 152,
            "text": "\t\t\toptions.push("
          },
          {
            "lineNumber": 153,
            "text": "\t\t\t\t{"
          },
          {
            "lineNumber": 154,
            "text": "\t\t\t\t\tlabel: invp.title_statuses[l],"
          },
          {
            "lineNumber": 155,
            "text": "\t\t\t\t\tvalue: invp.title_statuses[l]"
          },
          {
            "lineNumber": 156,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 157,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 158,
            "text": "\t\t}"
          },
          {
            "lineNumber": 159,
            "text": "\t\treturn options;"
          },
          {
            "lineNumber": 160,
            "text": "\t}"
          },
          {
            "lineNumber": 161
          },
          {
            "lineNumber": 162,
            "text": "\tfunction ucwords( str )"
          },
          {
            "lineNumber": 163,
            "text": "\t{"
          },
          {
            "lineNumber": 164,
            "text": "\t\treturn (str + '').split( ' ' ).map( x =\u003e x.charAt( 0 ).toUpperCase() + x.substring( 1 ) ).join( ' ' );"
          },
          {
            "lineNumber": 165,
            "text": "\t}"
          },
          {
            "lineNumber": 166
          },
          {
            "lineNumber": 167,
            "text": "\t// Most text fields."
          },
          {
            "lineNumber": 168,
            "text": "\tvar MetaBlockField = compose("
          },
          {
            "lineNumber": 169,
            "text": "\t\twithDispatch("
          },
          {
            "lineNumber": 170,
            "text": "\t\t\tfunction ( dispatch, props ) {"
          },
          {
            "lineNumber": 171,
            "text": "\t\t\t\treturn {"
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t\t\tsetMetaFieldValue: function ( value ) {"
          },
          {
            "lineNumber": 173,
            "text": "\t\t\t\t\t\t// Is this a numeric meta field? Can't save an empty string in those."
          },
          {
            "lineNumber": 174,
            "text": "\t\t\t\t\t\tif ( props.isNumeric \u0026\u0026 '' === value ) {"
          },
          {
            "lineNumber": 175,
            "text": "\t\t\t\t\t\t\tvalue = '0';"
          },
          {
            "lineNumber": 176,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 177,
            "text": "\t\t\t\t\t\tdispatch( 'core/editor' ).editPost("
          },
          {
            "lineNumber": 178,
            "text": "\t\t\t\t\t\t\t{ meta: { [ props.fieldName ]: value } }"
          },
          {
            "lineNumber": 179,
            "text": "\t\t\t\t\t\t);"
          },
          {
            "lineNumber": 180,
            "text": "\t\t\t\t\t}"
          },
          {
            "lineNumber": 181,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 182,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 183,
            "text": "\t\t),"
          },
          {
            "lineNumber": 184,
            "text": "\t\twithSelect("
          },
          {
            "lineNumber": 185,
            "text": "\t\t\tfunction ( select, props ) {"
          },
          {
            "lineNumber": 186,
            "text": "\t\t\t\treturn {"
          },
          {
            "lineNumber": 187,
            "text": "\t\t\t\t\tmetaFieldValue: select( 'core/editor' )"
          },
          {
            "lineNumber": 188,
            "text": "\t\t\t\t\t.getEditedPostAttribute( 'meta' )"
          },
          {
            "lineNumber": 189,
            "text": "\t\t\t\t\t[ props.fieldName ],"
          },
          {
            "lineNumber": 190,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 191,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 192,
            "text": "\t\t)"
          },
          {
            "lineNumber": 193,
            "text": "\t)("
          },
          {
            "lineNumber": 194,
            "text": "\t\tfunction ( props ) {"
          },
          {
            "lineNumber": 195,
            "text": "\t\t\treturn el("
          },
          {
            "lineNumber": 196,
            "text": "\t\t\t\tText,"
          },
          {
            "lineNumber": 197,
            "text": "\t\t\t\t{"
          },
          {
            "lineNumber": 198,
            "text": "\t\t\t\t\tlabel: getLabel( props.fieldName ),"
          },
          {
            "lineNumber": 199,
            "text": "\t\t\t\t\tvalue: props.metaFieldValue,"
          },
          {
            "lineNumber": 200,
            "text": "\t\t\t\t\tid: props.id,"
          },
          {
            "lineNumber": 201,
            "text": "\t\t\t\t\tonChange: function ( content ) {"
          },
          {
            "lineNumber": 202,
            "text": "\t\t\t\t\t\tprops.setMetaFieldValue( content );"
          },
          {
            "lineNumber": 203,
            "text": "\t\t\t\t\t},"
          },
          {
            "lineNumber": 204,
            "text": "\t\t\t\t\tonInput: function ( event ) {"
          },
          {
            "lineNumber": 205,
            "text": "\t\t\t\t\t\t// Is this the VIN field?"
          },
          {
            "lineNumber": 206,
            "text": "\t\t\t\t\t\tif ( props.fieldName === invp.meta_prefix + 'vin' ) {"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\t\t\t\t\t// Yes."
          },
          {
            "lineNumber": 208,
            "text": "\t\t\t\t\t\t\t// Is the VIN Decoding plugin active?"
          },
          {
            "lineNumber": 209,
            "text": "\t\t\t\t\t\t\tif ( typeof window.invp_vin_decoder_maybe_decode === 'function' ) {"
          },
          {
            "lineNumber": 210,
            "text": "\t\t\t\t\t\t\t\t// Yes."
          },
          {
            "lineNumber": 211,
            "text": "\t\t\t\t\t\t\t\twindow.invp_vin_decoder_maybe_decode( event );"
          },
          {
            "lineNumber": 212,
            "text": "\t\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 213,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 214,
            "text": "\t\t\t\t\t}"
          },
          {
            "lineNumber": 215,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 216,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 217,
            "text": "\t\t}"
          },
          {
            "lineNumber": 218,
            "text": "\t);"
          },
          {
            "lineNumber": 219
          },
          {
            "lineNumber": 220,
            "text": "\t// Text field that allows only digits."
          }
        ],
        "range": {
          "endPosition": {
            "line": 624
          },
          "startPosition": {
            "line": 75
          }
        },
        "relativeWorkspacePath": "./js/editor-sidebar.js",
        "signatures": {
          "ranges": [
            {
              "endPosition": {
                "column": 1,
                "line": 76
              },
              "startPosition": {
                "column": 1,
                "line": 76
              }
            }
          ]
        }
      },
      "score": 0.30703529715538025
    },
    {
      "codeBlock": {
        "contents": "\t\t\t$post = array(\n\t\t\t\t'post_author'       =\u003e $current_user_id,\n\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,\n\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,\n\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,\n\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,\n\t\t\t\t'post_status'       =\u003e 'publish',\n\t\t\t\t'comment_status'    =\u003e 'closed',\n\t\t\t\t'ping_status'       =\u003e 'closed',\n\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,\n\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,\n\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,\n\t\t\t\t'post_parent'       =\u003e 0,\n\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,\n\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,\n\t\t\t);\n\n\t\t\t$id = wp_insert_post( $post );\n\t\t\tforeach ( $options as $option ) {\n\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );\n\t\t\t}\n\n\t\t\t$endpoint_media = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),\n\t\t\t\t\t'order'   =\u003e 'asc',\n\t\t\t\t),\n\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref\n\t\t\t);\n\t\t\t$response       = wp_remote_get( $endpoint_media );\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$media = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\tif ( ! is_array( $media ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$media_count = count( $media );\n\t\t\tfor ( $m = 0; $m \u003c $media_count; $m++ ) {\n\t\t\t\t// Download a copy of the image.\n\t\t\t\t$media_url = strtok( $media[ $m ]-\u003esource_url, '?' );",
        "detailedLines": [
          {
            "lineNumber": 1025,
            "text": "\t\t\t$post = array("
          },
          {
            "lineNumber": 1026,
            "text": "\t\t\t\t'post_author'       =\u003e $current_user_id,"
          },
          {
            "lineNumber": 1027,
            "text": "\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,"
          },
          {
            "lineNumber": 1028,
            "text": "\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,"
          },
          {
            "lineNumber": 1029,
            "text": "\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,"
          },
          {
            "lineNumber": 1030,
            "text": "\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,"
          },
          {
            "lineNumber": 1031,
            "text": "\t\t\t\t'post_status'       =\u003e 'publish',"
          },
          {
            "lineNumber": 1032,
            "text": "\t\t\t\t'comment_status'    =\u003e 'closed',"
          },
          {
            "lineNumber": 1033,
            "text": "\t\t\t\t'ping_status'       =\u003e 'closed',"
          },
          {
            "lineNumber": 1034,
            "text": "\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,"
          },
          {
            "lineNumber": 1035,
            "text": "\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,"
          },
          {
            "lineNumber": 1036,
            "text": "\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,"
          },
          {
            "lineNumber": 1037,
            "text": "\t\t\t\t'post_parent'       =\u003e 0,"
          },
          {
            "lineNumber": 1038,
            "text": "\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,"
          },
          {
            "lineNumber": 1039,
            "text": "\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,"
          },
          {
            "lineNumber": 1040,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1041
          },
          {
            "lineNumber": 1042,
            "text": "\t\t\t$id = wp_insert_post( $post );"
          },
          {
            "lineNumber": 1043,
            "text": "\t\t\tforeach ( $options as $option ) {"
          },
          {
            "lineNumber": 1044,
            "text": "\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );"
          },
          {
            "lineNumber": 1045,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1046
          },
          {
            "lineNumber": 1047,
            "text": "\t\t\t$endpoint_media = add_query_arg("
          },
          {
            "lineNumber": 1048,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 1049,
            "text": "\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),"
          },
          {
            "lineNumber": 1050,
            "text": "\t\t\t\t\t'order'   =\u003e 'asc',"
          },
          {
            "lineNumber": 1051,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 1052,
            "text": "\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref"
          },
          {
            "lineNumber": 1053,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1054,
            "text": "\t\t\t$response       = wp_remote_get( $endpoint_media );"
          },
          {
            "lineNumber": 1055,
            "text": "\t\t\tif ( is_wp_error( $response ) ) {"
          },
          {
            "lineNumber": 1056,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1057,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1058
          },
          {
            "lineNumber": 1059,
            "text": "\t\t\t$media = json_decode( wp_remote_retrieve_body( $response ) );"
          },
          {
            "lineNumber": 1060,
            "text": "\t\t\tif ( ! is_array( $media ) ) {"
          },
          {
            "lineNumber": 1061,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1062,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1063,
            "text": "\t\t\t$media_count = count( $media );"
          },
          {
            "lineNumber": 1064,
            "text": "\t\t\tfor ( $m = 0; $m \u003c $media_count; $m++ ) {"
          },
          {
            "lineNumber": 1065,
            "text": "\t\t\t\t// Download a copy of the image."
          },
          {
            "lineNumber": 1066,
            "text": "\t\t\t\t$media_url = strtok( $media[ $m ]-\u003esource_url, '?' );"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1066
          },
          "startPosition": {
            "line": 1024
          }
        },
        "relativeWorkspacePath": "./includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.30639341473579407
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\nif ( ! class_exists( 'Add_Custom_Fields_To_Search' ) ) {\n\n\t/**\n\t * Add_Custom_Fields_To_Search\n\t *\n\t * An object that modifies the WordPress search query to include custom fields\n\t *\n\t * @see https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/\n\t *\n\t * @since      1.2.1\n\t * @package    inventory-presser\n\t * @subpackage inventory-presser/includes\n\t * @author     Corey Salzano \u003ccorey@friday.systems\u003e, Adam Balee\n\t */\n\tclass Add_Custom_Fields_To_Search {\n\n\n\t\t/**\n\t\t * Adds hooks\n\t\t *\n\t\t * @return void\n\t\t */\n\t\tpublic function add_hooks() {\n\t\t\tadd_filter( 'posts_distinct', array( $this, 'cf_search_distinct' ) );\n\t\t\tadd_filter( 'posts_join', array( $this, 'cf_search_join' ) );\n\t\t\tadd_filter( 'posts_where', array( $this, 'cf_search_where' ) );\n\t\t}\n\n\t\t/**\n\t\t * Are we looking at the Media Library?\n\t\t *\n\t\t * @return bool\n\t\t */\n\t\tprotected function is_media_library() {\n\t\t\treturn 'upload.php' === basename( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) ), '?' . sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ?? '' ) ) );\n\t\t}\n\n\t\t/**\n\t\t * Prevent duplicate posts from showing up in search results.\n\t\t *\n\t\t * @link https://developer.wordpress.org/reference/hooks/posts_distinct/\n\t\t *\n\t\t * @param  string $distinct The part of the query that contains the word\n\t\t * DISTINCT.\n\t\t * @return string\n\t\t */\n\t\tpublic function cf_search_distinct( $distinct ) {\n\t\t\tif ( is_search() ) {\n\t\t\t\treturn 'DISTINCT';\n\t\t\t}\n\n\t\t\treturn $distinct;\n\t\t}\n\n\t\t/**\n\t\t * Join posts and postmeta tables\n\t\t *\n\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join\n\t\t *\n\t\t * @param  string $join The JOIN clause of the query.\n\t\t * @return string\n\t\t */\n\t\tpublic function cf_search_join( $join ) {\n\t\t\tglobal $wpdb;\n\n\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {\n\t\t\t\t",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "if ( ! class_exists( 'Add_Custom_Fields_To_Search' ) ) {"
          },
          {
            "lineNumber": 5
          },
          {
            "lineNumber": 6,
            "text": "\t/**"
          },
          {
            "lineNumber": 7,
            "text": "\t * Add_Custom_Fields_To_Search"
          },
          {
            "lineNumber": 8,
            "text": "\t *"
          },
          {
            "lineNumber": 9,
            "text": "\t * An object that modifies the WordPress search query to include custom fields"
          },
          {
            "lineNumber": 10,
            "text": "\t *"
          },
          {
            "lineNumber": 11,
            "text": "\t * @see https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/"
          },
          {
            "lineNumber": 12,
            "text": "\t *"
          },
          {
            "lineNumber": 13,
            "text": "\t * @since      1.2.1"
          },
          {
            "lineNumber": 14,
            "text": "\t * @package    inventory-presser"
          },
          {
            "lineNumber": 15,
            "text": "\t * @subpackage inventory-presser/includes"
          },
          {
            "lineNumber": 16,
            "text": "\t * @author     Corey Salzano \u003ccorey@friday.systems\u003e, Adam Balee"
          },
          {
            "lineNumber": 17,
            "text": "\t */"
          },
          {
            "lineNumber": 18,
            "text": "\tclass Add_Custom_Fields_To_Search {"
          },
          {
            "lineNumber": 19
          },
          {
            "lineNumber": 20
          },
          {
            "lineNumber": 21,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 22,
            "text": "\t\t * Adds hooks"
          },
          {
            "lineNumber": 23,
            "text": "\t\t *"
          },
          {
            "lineNumber": 24,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 25,
            "text": "\t\t */"
          },
          {
            "lineNumber": 26,
            "text": "\t\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\tadd_filter( 'posts_distinct', array( $this, 'cf_search_distinct' ) );"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\tadd_filter( 'posts_join', array( $this, 'cf_search_join' ) );"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\tadd_filter( 'posts_where', array( $this, 'cf_search_where' ) );"
          },
          {
            "lineNumber": 30,
            "text": "\t\t}"
          },
          {
            "lineNumber": 31
          },
          {
            "lineNumber": 32,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 33,
            "text": "\t\t * Are we looking at the Media Library?"
          },
          {
            "lineNumber": 34,
            "text": "\t\t *"
          },
          {
            "lineNumber": 35,
            "text": "\t\t * @return bool"
          },
          {
            "lineNumber": 36,
            "text": "\t\t */"
          },
          {
            "lineNumber": 37,
            "text": "\t\tprotected function is_media_library() {"
          },
          {
            "lineNumber": 38,
            "text": "\t\t\treturn 'upload.php' === basename( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) ), '?' . sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ?? '' ) ) );"
          },
          {
            "lineNumber": 39,
            "text": "\t\t}"
          },
          {
            "lineNumber": 40
          },
          {
            "lineNumber": 41,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 42,
            "text": "\t\t * Prevent duplicate posts from showing up in search results."
          },
          {
            "lineNumber": 43,
            "text": "\t\t *"
          },
          {
            "lineNumber": 44,
            "text": "\t\t * @link https://developer.wordpress.org/reference/hooks/posts_distinct/"
          },
          {
            "lineNumber": 45,
            "text": "\t\t *"
          },
          {
            "lineNumber": 46,
            "text": "\t\t * @param  string $distinct The part of the query that contains the word"
          },
          {
            "lineNumber": 47,
            "text": "\t\t * DISTINCT."
          },
          {
            "lineNumber": 48,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 49,
            "text": "\t\t */"
          },
          {
            "lineNumber": 50,
            "text": "\t\tpublic function cf_search_distinct( $distinct ) {"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\tif ( is_search() ) {"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t\treturn 'DISTINCT';"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 54
          },
          {
            "lineNumber": 55,
            "text": "\t\t\treturn $distinct;"
          },
          {
            "lineNumber": 56,
            "text": "\t\t}"
          },
          {
            "lineNumber": 57
          },
          {
            "lineNumber": 58,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 59,
            "text": "\t\t * Join posts and postmeta tables"
          },
          {
            "lineNumber": 60,
            "text": "\t\t *"
          },
          {
            "lineNumber": 61,
            "text": "\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join"
          },
          {
            "lineNumber": 62,
            "text": "\t\t *"
          },
          {
            "lineNumber": 63,
            "text": "\t\t * @param  string $join The JOIN clause of the query."
          },
          {
            "lineNumber": 64,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 65,
            "text": "\t\t */"
          },
          {
            "lineNumber": 66,
            "text": "\t\tpublic function cf_search_join( $join ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 4,
            "line": 69
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-add-custom-fields-to-search.php",
        "signatures": {}
      },
      "score": 0.3053041696548462
    },
    {
      "codeBlock": {
        "contents": "\t\t * @return void\n\t\t */\n\t\tpublic function add_orderby_to_query( $query ) {\n\t\t\t// Do not mess with the query if it's not the main one and our CPT.\n\t\t\tif ( apply_filters( 'invp_apply_orderby_to_main_query_only', true ) \u0026\u0026 ! $query-\u003eis_main_query() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'posts_clauses', array( $this, 'modify_query_orderby' ) );\n\t\t\t$settings = INVP::settings();\n\n\t\t\tif ( empty( $_GET['orderby'] ) \u0026\u0026 empty( $settings['sort_vehicles_by'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * The field we want to order by is either in $_GET['orderby'] when\n\t\t\t * the user has chosen to reorder posts or saved in the plugin\n\t\t\t * settings 'default-sort-key.' The sort direction is in\n\t\t\t * $_GET['order'] or 'sort_vehicles_order.'\n\t\t\t */\n\t\t\t$direction = $settings['sort_vehicles_order'];\n\t\t\tif ( isset( $_GET['order'] ) ) {\n\t\t\t\t$direction = sanitize_text_field( wp_unslash( $_GET['order'] ) );\n\t\t\t}\n\n\t\t\t$key = $settings['sort_vehicles_by'];\n\n\t\t\t// Backwards compatibility for pre 13.7.1 when there was a bug.\n\t\t\tif ( 'date_entered' === $key ) {\n\t\t\t\t$key = 'post_date';\n\t\t\t}\n\t\t\tif ( 'last_modified' === $key ) {\n\t\t\t\t$key = 'post_modified';\n\t\t\t}\n\n\t\t\tif ( isset( $_GET['orderby'] ) ) {\n\t\t\t\t$key = sanitize_text_field( wp_unslash( $_GET['orderby'] ) );\n\t\t\t}\n\n\t\t\t// post_date and post_modified are not meta keys.\n\t\t\tif ( in_array( $key, array( 'post_date', 'post_modified' ), true ) ) {\n\t\t\t\t$query-\u003eset( 'orderby', $key );\n\t\t\t\t$query-\u003eset( 'order', $direction );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure the meta key has the prefix.\n\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key );\n\t\t\t$query-\u003eset( 'meta_key', $key );\n\n\t\t\t/**\n\t\t\t * Maybe append to the meta_query if it is already set. If we are\n\t\t\t * sorting by make, then we want to also add a secondary sort of model\n\t\t\t * and a tertiary sort of trim. That's what users want. Apply the same\n\t\t\t * logic to sorts by year and model.\n\t\t\t */\n\t\t\t$old = $query-\u003eget( 'meta_query', array() );\n\t\t\tswitch ( apply_filters( 'invp_unprefix_meta_key', $query-\u003eget( 'meta_key' ) ) ) {\n\t\t\t\tcase 'make':\n\t\t\t\t\t$query-\u003eset(\n\t\t\t\t\t\t'meta_query',",
        "detailedLines": [
          {
            "lineNumber": 75,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 76,
            "text": "\t\t */"
          },
          {
            "lineNumber": 77,
            "text": "\t\tpublic function add_orderby_to_query( $query ) {"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t// Do not mess with the query if it's not the main one and our CPT."
          },
          {
            "lineNumber": 79,
            "text": "\t\t\tif ( apply_filters( 'invp_apply_orderby_to_main_query_only', true ) \u0026\u0026 ! $query-\u003eis_main_query() ) {"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 81,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 82
          },
          {
            "lineNumber": 83,
            "text": "\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 85,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 86
          },
          {
            "lineNumber": 87,
            "text": "\t\t\tadd_filter( 'posts_clauses', array( $this, 'modify_query_orderby' ) );"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t$settings = INVP::settings();"
          },
          {
            "lineNumber": 89
          },
          {
            "lineNumber": 90,
            "text": "\t\t\tif ( empty( $_GET['orderby'] ) \u0026\u0026 empty( $settings['sort_vehicles_by'] ) ) {"
          },
          {
            "lineNumber": 91,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t * The field we want to order by is either in $_GET['orderby'] when"
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t * the user has chosen to reorder posts or saved in the plugin"
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t * settings 'default-sort-key.' The sort direction is in"
          },
          {
            "lineNumber": 98,
            "text": "\t\t\t * $_GET['order'] or 'sort_vehicles_order.'"
          },
          {
            "lineNumber": 99,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 100,
            "text": "\t\t\t$direction = $settings['sort_vehicles_order'];"
          },
          {
            "lineNumber": 101,
            "text": "\t\t\tif ( isset( $_GET['order'] ) ) {"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\t\t$direction = sanitize_text_field( wp_unslash( $_GET['order'] ) );"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 104
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t$key = $settings['sort_vehicles_by'];"
          },
          {
            "lineNumber": 106
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t// Backwards compatibility for pre 13.7.1 when there was a bug."
          },
          {
            "lineNumber": 108,
            "text": "\t\t\tif ( 'date_entered' === $key ) {"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\t\t$key = 'post_date';"
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\tif ( 'last_modified' === $key ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t\t$key = 'post_modified';"
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 114
          },
          {
            "lineNumber": 115,
            "text": "\t\t\tif ( isset( $_GET['orderby'] ) ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t$key = sanitize_text_field( wp_unslash( $_GET['orderby'] ) );"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t// post_date and post_modified are not meta keys."
          },
          {
            "lineNumber": 120,
            "text": "\t\t\tif ( in_array( $key, array( 'post_date', 'post_modified' ), true ) ) {"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t\t$query-\u003eset( 'orderby', $key );"
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t\t$query-\u003eset( 'order', $direction );"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 125
          },
          {
            "lineNumber": 126,
            "text": "\t\t\t// Make sure the meta key has the prefix."
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key );"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t$query-\u003eset( 'meta_key', $key );"
          },
          {
            "lineNumber": 129
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t * Maybe append to the meta_query if it is already set. If we are"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t * sorting by make, then we want to also add a secondary sort of model"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t * and a tertiary sort of trim. That's what users want. Apply the same"
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t * logic to sorts by year and model."
          },
          {
            "lineNumber": 135,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 136,
            "text": "\t\t\t$old = $query-\u003eget( 'meta_query', array() );"
          },
          {
            "lineNumber": 137,
            "text": "\t\t\tswitch ( apply_filters( 'invp_unprefix_meta_key', $query-\u003eget( 'meta_key' ) ) ) {"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\tcase 'make':"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t\t\t'meta_query',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 140
          },
          "startPosition": {
            "line": 74
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.2913534939289093
    },
    {
      "codeBlock": {
        "contents": "\tpublic function meta_box_html_vehicle( $post, $meta_box ) {\n\t\t// Get the post meta and flatten some of our keys into an array.\n\t\t$custom = get_post_custom( $post-\u003eID );\n\t\t$meta   = array();\n\t\t$keys   = array(\n\t\t\t'body_style',\n\t\t\t'color',\n\t\t\t'color_base',\n\t\t\t'description',\n\t\t\t'engine',\n\t\t\t'interior_color',\n\t\t\t'make',\n\t\t\t'model',\n\t\t\t'odometer',\n\t\t\t'stock_number',\n\t\t\t'trim',\n\t\t\t'vin',\n\t\t\t'year',\n\t\t\t'youtube',\n\t\t\t// Boat fields.\n\t\t\t'beam',\n\t\t\t'condition_boat',\n\t\t\t'draft',\n\t\t\t'engine_count',\n\t\t\t'engine_make',\n\t\t\t'engine_model',\n\t\t\t'horsepower',\n\t\t\t'hull_material',\n\t\t\t'length',\n\t\t);\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t$meta[ $key ] = ( isset( $custom[ apply_filters( 'invp_prefix_meta_key', $key ) ] ) ? $custom[ apply_filters( 'invp_prefix_meta_key', $key ) ][0] : '' );\n\t\t}\n\n\t\tprintf(\n\t\t\t'\u003ctable class=\"form-table\"\u003e\u003ctbody\u003e'\n\n\t\t\t// VIN.\n\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%1$s\"\u003e%2$s\u003c/label\u003e\u003c/th\u003e'\n\t\t\t. '\u003ctd\u003e%3$s\u003c/td\u003e'\n\n\t\t\t// Stock number.\n\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%4$s\"\u003e%5$s\u003c/label\u003e\u003c/th\u003e'\n\t\t\t. '\u003ctd\u003e\u003cinput type=\"text\" name=\"%4$s\" value=\"%6$s\"\u003e\u003c/td\u003e'\n\n\t\t\t// Year.\n\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%7$s\"\u003e%8$s\u003c/label\u003e\u003c/th\u003e'\n\t\t\t. '\u003ctd\u003e\u003cselect name=\"%7$s\"\u003e\u003coption\u003e\u003c/option\u003e',\n\t\t\t/*  1 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'vin' ) ),\n\t\t\t/*  2 */ esc_html__( 'VIN', 'inventory-presser' ),\n\t\t\t/*  3 */ apply_filters(\n\t\t\t\t'invp_edit_control_vin',\n\t\t\t\tsprintf(\n\t\t\t\t\t'\u003cinput type=\"text\" name=\"%s\" maxlength=\"17\" value=\"%s\"\u003e',\n\t\t\t\t\tesc_attr( apply_filters( 'invp_prefix_meta_key', 'vin' ) ),\n\t\t\t\t\tesc_attr( $meta['vin'] )\n\t\t\t\t)\n\t\t\t),\n\t\t\t/*  4 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'stock_number' ) ),\n\t\t\t/*  5 */ esc_html__( 'Stock number', 'inventory-presser' ),\n\t\t\t/*  6 */ esc_attr( $meta['stock_number'] ),\n\t\t\t/*  7 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'year' ) ),\n\t\t\t/*  8 */ esc_html__( 'Year', 'inventory-presser' )\n\t\t);\n\n\t\tfor ( $y = gmdate( 'Y' ) + 2; $y \u003e= 1920; $y-- ) {\n\t\t\tprintf(\n\t\t\t\t'\u003coption%s\u003e%s\u003c/option\u003e',\n\t\t\t\tselected( $y, $meta['year'], false ),",
        "detailedLines": [
          {
            "lineNumber": 499,
            "text": "\tpublic function meta_box_html_vehicle( $post, $meta_box ) {"
          },
          {
            "lineNumber": 500,
            "text": "\t\t// Get the post meta and flatten some of our keys into an array."
          },
          {
            "lineNumber": 501,
            "text": "\t\t$custom = get_post_custom( $post-\u003eID );"
          },
          {
            "lineNumber": 502,
            "text": "\t\t$meta   = array();"
          },
          {
            "lineNumber": 503,
            "text": "\t\t$keys   = array("
          },
          {
            "lineNumber": 504,
            "text": "\t\t\t'body_style',"
          },
          {
            "lineNumber": 505,
            "text": "\t\t\t'color',"
          },
          {
            "lineNumber": 506,
            "text": "\t\t\t'color_base',"
          },
          {
            "lineNumber": 507,
            "text": "\t\t\t'description',"
          },
          {
            "lineNumber": 508,
            "text": "\t\t\t'engine',"
          },
          {
            "lineNumber": 509,
            "text": "\t\t\t'interior_color',"
          },
          {
            "lineNumber": 510,
            "text": "\t\t\t'make',"
          },
          {
            "lineNumber": 511,
            "text": "\t\t\t'model',"
          },
          {
            "lineNumber": 512,
            "text": "\t\t\t'odometer',"
          },
          {
            "lineNumber": 513,
            "text": "\t\t\t'stock_number',"
          },
          {
            "lineNumber": 514,
            "text": "\t\t\t'trim',"
          },
          {
            "lineNumber": 515,
            "text": "\t\t\t'vin',"
          },
          {
            "lineNumber": 516,
            "text": "\t\t\t'year',"
          },
          {
            "lineNumber": 517,
            "text": "\t\t\t'youtube',"
          },
          {
            "lineNumber": 518,
            "text": "\t\t\t// Boat fields."
          },
          {
            "lineNumber": 519,
            "text": "\t\t\t'beam',"
          },
          {
            "lineNumber": 520,
            "text": "\t\t\t'condition_boat',"
          },
          {
            "lineNumber": 521,
            "text": "\t\t\t'draft',"
          },
          {
            "lineNumber": 522,
            "text": "\t\t\t'engine_count',"
          },
          {
            "lineNumber": 523,
            "text": "\t\t\t'engine_make',"
          },
          {
            "lineNumber": 524,
            "text": "\t\t\t'engine_model',"
          },
          {
            "lineNumber": 525,
            "text": "\t\t\t'horsepower',"
          },
          {
            "lineNumber": 526,
            "text": "\t\t\t'hull_material',"
          },
          {
            "lineNumber": 527,
            "text": "\t\t\t'length',"
          },
          {
            "lineNumber": 528,
            "text": "\t\t);"
          },
          {
            "lineNumber": 529
          },
          {
            "lineNumber": 530,
            "text": "\t\tforeach ( $keys as $key ) {"
          },
          {
            "lineNumber": 531,
            "text": "\t\t\t$meta[ $key ] = ( isset( $custom[ apply_filters( 'invp_prefix_meta_key', $key ) ] ) ? $custom[ apply_filters( 'invp_prefix_meta_key', $key ) ][0] : '' );"
          },
          {
            "lineNumber": 532,
            "text": "\t\t}"
          },
          {
            "lineNumber": 533
          },
          {
            "lineNumber": 534,
            "text": "\t\tprintf("
          },
          {
            "lineNumber": 535,
            "text": "\t\t\t'\u003ctable class=\"form-table\"\u003e\u003ctbody\u003e'"
          },
          {
            "lineNumber": 536
          },
          {
            "lineNumber": 537,
            "text": "\t\t\t// VIN."
          },
          {
            "lineNumber": 538,
            "text": "\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%1$s\"\u003e%2$s\u003c/label\u003e\u003c/th\u003e'"
          },
          {
            "lineNumber": 539,
            "text": "\t\t\t. '\u003ctd\u003e%3$s\u003c/td\u003e'"
          },
          {
            "lineNumber": 540
          },
          {
            "lineNumber": 541,
            "text": "\t\t\t// Stock number."
          },
          {
            "lineNumber": 542,
            "text": "\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%4$s\"\u003e%5$s\u003c/label\u003e\u003c/th\u003e'"
          },
          {
            "lineNumber": 543,
            "text": "\t\t\t. '\u003ctd\u003e\u003cinput type=\"text\" name=\"%4$s\" value=\"%6$s\"\u003e\u003c/td\u003e'"
          },
          {
            "lineNumber": 544
          },
          {
            "lineNumber": 545,
            "text": "\t\t\t// Year."
          },
          {
            "lineNumber": 546,
            "text": "\t\t\t. '\u003ctr\u003e\u003cth scope=\"row\"\u003e\u003clabel for=\"%7$s\"\u003e%8$s\u003c/label\u003e\u003c/th\u003e'"
          },
          {
            "lineNumber": 547,
            "text": "\t\t\t. '\u003ctd\u003e\u003cselect name=\"%7$s\"\u003e\u003coption\u003e\u003c/option\u003e',"
          },
          {
            "lineNumber": 548,
            "text": "\t\t\t/*  1 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'vin' ) ),"
          },
          {
            "lineNumber": 549,
            "text": "\t\t\t/*  2 */ esc_html__( 'VIN', 'inventory-presser' ),"
          },
          {
            "lineNumber": 550,
            "text": "\t\t\t/*  3 */ apply_filters("
          },
          {
            "lineNumber": 551,
            "text": "\t\t\t\t'invp_edit_control_vin',"
          },
          {
            "lineNumber": 552,
            "text": "\t\t\t\tsprintf("
          },
          {
            "lineNumber": 553,
            "text": "\t\t\t\t\t'\u003cinput type=\"text\" name=\"%s\" maxlength=\"17\" value=\"%s\"\u003e',"
          },
          {
            "lineNumber": 554,
            "text": "\t\t\t\t\tesc_attr( apply_filters( 'invp_prefix_meta_key', 'vin' ) ),"
          },
          {
            "lineNumber": 555,
            "text": "\t\t\t\t\tesc_attr( $meta['vin'] )"
          },
          {
            "lineNumber": 556,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 557,
            "text": "\t\t\t),"
          },
          {
            "lineNumber": 558,
            "text": "\t\t\t/*  4 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'stock_number' ) ),"
          },
          {
            "lineNumber": 559,
            "text": "\t\t\t/*  5 */ esc_html__( 'Stock number', 'inventory-presser' ),"
          },
          {
            "lineNumber": 560,
            "text": "\t\t\t/*  6 */ esc_attr( $meta['stock_number'] ),"
          },
          {
            "lineNumber": 561,
            "text": "\t\t\t/*  7 */ esc_attr( apply_filters( 'invp_prefix_meta_key', 'year' ) ),"
          },
          {
            "lineNumber": 562,
            "text": "\t\t\t/*  8 */ esc_html__( 'Year', 'inventory-presser' )"
          },
          {
            "lineNumber": 563,
            "text": "\t\t);"
          },
          {
            "lineNumber": 564
          },
          {
            "lineNumber": 565,
            "text": "\t\tfor ( $y = gmdate( 'Y' ) + 2; $y \u003e= 1920; $y-- ) {"
          },
          {
            "lineNumber": 566,
            "text": "\t\t\tprintf("
          },
          {
            "lineNumber": 567,
            "text": "\t\t\t\t'\u003coption%s\u003e%s\u003c/option\u003e',"
          },
          {
            "lineNumber": 568,
            "text": "\t\t\t\tselected( $y, $meta['year'], false ),"
          }
        ],
        "range": {
          "endPosition": {
            "line": 568
          },
          "startPosition": {
            "line": 498
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-classic-editor.php",
        "signatures": {}
      },
      "score": 0.2908298969268799
    },
    {
      "codeBlock": {
        "contents": "\t\t{\n\t\t\trender: function () {\n\t\t\t\t// Check if we're in a post editor context (not widgets editor)\n\t\t\t\tvar editorStore = wp.data.select( 'core/editor' );\n\t\t\t\tif ( ! editorStore ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Check if getCurrentPostType exists and returns the correct post type\n\t\t\t\tif ( ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory_vehicle' ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Additional safety check: verify getEditedPostAttribute works and returns meta\n\t\t\t\tif ( ! editorStore.getEditedPostAttribute ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar testMeta = editorStore.getEditedPostAttribute( 'meta' );\n\t\t\t\tif ( ! testMeta || typeof testMeta !== 'object' ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tvar fields = el(\n\t\t\t\t\twp.element.Fragment,\n\t\t\t\t\t{},\n\t\t\t\t\tel(\n\t\t\t\t\t\t'h2',\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t'Attributes'\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'vin',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'vin',\n\t\t\t\t\t\t\tisNumeric: false,\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'stock_number',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'stock_number',\n\t\t\t\t\t\t\tisNumeric: false,\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'trim',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'trim',\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'engine',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'engine',\n\t\t\t\t\t\t\tisNumeric: false,\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'doors',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'doors',\n\t\t\t\t\t\t\tisNumeric: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'color',\n\t\t\t\t\t\t\tid:        invp.meta_prefix + 'color',\n\t\t\t\t\t\t\tisNumeric: false,\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\tel(\n\t\t\t\t\t\tMetaBlockField,\n\t\t\t\t\t\t{",
        "detailedLines": [
          {
            "lineNumber": 335,
            "text": "\t\t{"
          },
          {
            "lineNumber": 336,
            "text": "\t\t\trender: function () {"
          },
          {
            "lineNumber": 337,
            "text": "\t\t\t\t// Check if we're in a post editor context (not widgets editor)"
          },
          {
            "lineNumber": 338,
            "text": "\t\t\t\tvar editorStore = wp.data.select( 'core/editor' );"
          },
          {
            "lineNumber": 339,
            "text": "\t\t\t\tif ( ! editorStore ) {"
          },
          {
            "lineNumber": 340,
            "text": "\t\t\t\t\treturn null;"
          },
          {
            "lineNumber": 341,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 342
          },
          {
            "lineNumber": 343,
            "text": "\t\t\t\t// Check if getCurrentPostType exists and returns the correct post type"
          },
          {
            "lineNumber": 344,
            "text": "\t\t\t\tif ( ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory_vehicle' ) {"
          },
          {
            "lineNumber": 345,
            "text": "\t\t\t\t\treturn null;"
          },
          {
            "lineNumber": 346,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 347
          },
          {
            "lineNumber": 348,
            "text": "\t\t\t\t// Additional safety check: verify getEditedPostAttribute works and returns meta"
          },
          {
            "lineNumber": 349,
            "text": "\t\t\t\tif ( ! editorStore.getEditedPostAttribute ) {"
          },
          {
            "lineNumber": 350,
            "text": "\t\t\t\t\treturn null;"
          },
          {
            "lineNumber": 351,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 352,
            "text": "\t\t\t\tvar testMeta = editorStore.getEditedPostAttribute( 'meta' );"
          },
          {
            "lineNumber": 353,
            "text": "\t\t\t\tif ( ! testMeta || typeof testMeta !== 'object' ) {"
          },
          {
            "lineNumber": 354,
            "text": "\t\t\t\t\treturn null;"
          },
          {
            "lineNumber": 355,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 356
          },
          {
            "lineNumber": 357,
            "text": "\t\t\t\tvar fields = el("
          },
          {
            "lineNumber": 358,
            "text": "\t\t\t\t\twp.element.Fragment,"
          },
          {
            "lineNumber": 359,
            "text": "\t\t\t\t\t{},"
          },
          {
            "lineNumber": 360,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 361,
            "text": "\t\t\t\t\t\t'h2',"
          },
          {
            "lineNumber": 362,
            "text": "\t\t\t\t\t\t{},"
          },
          {
            "lineNumber": 363,
            "text": "\t\t\t\t\t\t'Attributes'"
          },
          {
            "lineNumber": 364,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 365,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 366,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 367,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 368,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'vin',"
          },
          {
            "lineNumber": 369,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'vin',"
          },
          {
            "lineNumber": 370,
            "text": "\t\t\t\t\t\t\tisNumeric: false,"
          },
          {
            "lineNumber": 371,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 372,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 373,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 374,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 375,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 376,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'stock_number',"
          },
          {
            "lineNumber": 377,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'stock_number',"
          },
          {
            "lineNumber": 378,
            "text": "\t\t\t\t\t\t\tisNumeric: false,"
          },
          {
            "lineNumber": 379,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 380,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 381,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 382,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 383,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 384,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'trim',"
          },
          {
            "lineNumber": 385,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'trim',"
          },
          {
            "lineNumber": 386,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 387,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 388,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 389,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 390,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 391,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'engine',"
          },
          {
            "lineNumber": 392,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'engine',"
          },
          {
            "lineNumber": 393,
            "text": "\t\t\t\t\t\t\tisNumeric: false,"
          },
          {
            "lineNumber": 394,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 395,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 396,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 397,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 398,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 399,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'doors',"
          },
          {
            "lineNumber": 400,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'doors',"
          },
          {
            "lineNumber": 401,
            "text": "\t\t\t\t\t\t\tisNumeric: true,"
          },
          {
            "lineNumber": 402,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 403,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 404,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 405,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 406,
            "text": "\t\t\t\t\t\t{"
          },
          {
            "lineNumber": 407,
            "text": "\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'color',"
          },
          {
            "lineNumber": 408,
            "text": "\t\t\t\t\t\t\tid:        invp.meta_prefix + 'color',"
          },
          {
            "lineNumber": 409,
            "text": "\t\t\t\t\t\t\tisNumeric: false,"
          },
          {
            "lineNumber": 410,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 411,
            "text": "\t\t\t\t\t),"
          },
          {
            "lineNumber": 412,
            "text": "\t\t\t\t\tel("
          },
          {
            "lineNumber": 413,
            "text": "\t\t\t\t\t\tMetaBlockField,"
          },
          {
            "lineNumber": 414,
            "text": "\t\t\t\t\t\t{"
          }
        ],
        "range": {
          "endPosition": {
            "line": 624
          },
          "startPosition": {
            "line": 75
          }
        },
        "relativeWorkspacePath": "./js/editor-sidebar.js",
        "signatures": {
          "ranges": [
            {
              "endPosition": {
                "column": 1,
                "line": 76
              },
              "startPosition": {
                "column": 1,
                "line": 76
              }
            },
            {
              "endPosition": {
                "column": 2,
                "line": 333
              },
              "startPosition": {
                "column": 2,
                "line": 333
              }
            }
          ]
        }
      },
      "score": 0.2898293137550354
    },
    {
      "codeBlock": {
        "contents": "\tpublic function maybe_add_noindex( $robots ) {\n\t\t// Is this a vehicle archive?\n\t\tif ( ! defined( 'INVP::POST_TYPE' ) || ! is_post_type_archive( INVP::POST_TYPE ) ) {\n\t\t\t// No.\n\t\t\treturn $robots;\n\t\t}\n\n\t\t// How many taxonomy filters are in the query?\n\t\t$filter_count = 0;\n\t\tforeach ( self::query_vars_array() as $query_var ) {\n\t\t\t$vars = get_query_var( $query_var );\n\t\t\tif ( '' !== $vars ) {\n\t\t\t\tif ( is_array( $vars ) ) {\n\t\t\t\t\t$filter_count += count( $vars );\n\t\t\t\t} else {\n\t\t\t\t\t++$filter_count;\n\t\t\t\t}\n\n\t\t\t\t// More than one?\n\t\t\t\tif ( $filter_count \u003e 1 ) {\n\t\t\t\t\t$robots['noindex'] = $robots['nofollow'] = true;\n\t\t\t\t\treturn $robots;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $robots;\n\t}\n\n\t/**\n\t * Filter callback. Implements the \"include sold vehicles\" checkbox feature\n\t * in vehicle archives and search results.\n\t *\n\t * @param  WP_Query $query The posts query object.\n\t * @return void\n\t */\n\tpublic function maybe_exclude_sold_vehicles( $query ) {\n\t\tif ( is_admin() || ! $query-\u003eis_main_query()\n\t\t\t|| ! ( is_search() || is_post_type_archive( INVP::POST_TYPE ) )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there is already a tax_query for taxonomy availability, abort.\n\t\tif ( $query-\u003eis_tax( 'availability' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the checkbox to include sold vehicles is checked, abort.\n\t\t$plugin_settings = INVP::settings();\n\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 $plugin_settings['include_sold_vehicles'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$query-\u003eset( 'tax_query', self::tax_query_exclude_sold() );\n\t}\n\n\t/**\n\t * Outputs HTML that renders a meta box in the Classic Editor for all our taxonomies.\n\t *\n\t * @param  WP_Post $post Current post object.\n\t * @param  array   $box  Categories meta box arguments.\n\t * @return void\n\t */\n\tpublic static function meta_box_html( $post, $box ) {\n\t\t$taxonomy = $box['args']['taxonomy'] ?? '';",
        "detailedLines": [
          {
            "lineNumber": 157,
            "text": "\tpublic function maybe_add_noindex( $robots ) {"
          },
          {
            "lineNumber": 158,
            "text": "\t\t// Is this a vehicle archive?"
          },
          {
            "lineNumber": 159,
            "text": "\t\tif ( ! defined( 'INVP::POST_TYPE' ) || ! is_post_type_archive( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\t// No."
          },
          {
            "lineNumber": 161,
            "text": "\t\t\treturn $robots;"
          },
          {
            "lineNumber": 162,
            "text": "\t\t}"
          },
          {
            "lineNumber": 163
          },
          {
            "lineNumber": 164,
            "text": "\t\t// How many taxonomy filters are in the query?"
          },
          {
            "lineNumber": 165,
            "text": "\t\t$filter_count = 0;"
          },
          {
            "lineNumber": 166,
            "text": "\t\tforeach ( self::query_vars_array() as $query_var ) {"
          },
          {
            "lineNumber": 167,
            "text": "\t\t\t$vars = get_query_var( $query_var );"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\tif ( '' !== $vars ) {"
          },
          {
            "lineNumber": 169,
            "text": "\t\t\t\tif ( is_array( $vars ) ) {"
          },
          {
            "lineNumber": 170,
            "text": "\t\t\t\t\t$filter_count += count( $vars );"
          },
          {
            "lineNumber": 171,
            "text": "\t\t\t\t} else {"
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t\t\t++$filter_count;"
          },
          {
            "lineNumber": 173,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 174
          },
          {
            "lineNumber": 175,
            "text": "\t\t\t\t// More than one?"
          },
          {
            "lineNumber": 176,
            "text": "\t\t\t\tif ( $filter_count \u003e 1 ) {"
          },
          {
            "lineNumber": 177,
            "text": "\t\t\t\t\t$robots['noindex'] = $robots['nofollow'] = true;"
          },
          {
            "lineNumber": 178,
            "text": "\t\t\t\t\treturn $robots;"
          },
          {
            "lineNumber": 179,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 180,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 181,
            "text": "\t\t}"
          },
          {
            "lineNumber": 182,
            "text": "\t\treturn $robots;"
          },
          {
            "lineNumber": 183,
            "text": "\t}"
          },
          {
            "lineNumber": 184
          },
          {
            "lineNumber": 185,
            "text": "\t/**"
          },
          {
            "lineNumber": 186,
            "text": "\t * Filter callback. Implements the \"include sold vehicles\" checkbox feature"
          },
          {
            "lineNumber": 187,
            "text": "\t * in vehicle archives and search results."
          },
          {
            "lineNumber": 188,
            "text": "\t *"
          },
          {
            "lineNumber": 189,
            "text": "\t * @param  WP_Query $query The posts query object."
          },
          {
            "lineNumber": 190,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 191,
            "text": "\t */"
          },
          {
            "lineNumber": 192,
            "text": "\tpublic function maybe_exclude_sold_vehicles( $query ) {"
          },
          {
            "lineNumber": 193,
            "text": "\t\tif ( is_admin() || ! $query-\u003eis_main_query()"
          },
          {
            "lineNumber": 194,
            "text": "\t\t\t|| ! ( is_search() || is_post_type_archive( INVP::POST_TYPE ) )"
          },
          {
            "lineNumber": 195,
            "text": "\t\t) {"
          },
          {
            "lineNumber": 196,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 197,
            "text": "\t\t}"
          },
          {
            "lineNumber": 198
          },
          {
            "lineNumber": 199,
            "text": "\t\t// If there is already a tax_query for taxonomy availability, abort."
          },
          {
            "lineNumber": 200,
            "text": "\t\tif ( $query-\u003eis_tax( 'availability' ) ) {"
          },
          {
            "lineNumber": 201,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 202,
            "text": "\t\t}"
          },
          {
            "lineNumber": 203
          },
          {
            "lineNumber": 204,
            "text": "\t\t// If the checkbox to include sold vehicles is checked, abort."
          },
          {
            "lineNumber": 205,
            "text": "\t\t$plugin_settings = INVP::settings();"
          },
          {
            "lineNumber": 206,
            "text": "\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 $plugin_settings['include_sold_vehicles'] ) {"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 208,
            "text": "\t\t}"
          },
          {
            "lineNumber": 209
          },
          {
            "lineNumber": 210,
            "text": "\t\t$query-\u003eset( 'tax_query', self::tax_query_exclude_sold() );"
          },
          {
            "lineNumber": 211,
            "text": "\t}"
          },
          {
            "lineNumber": 212
          },
          {
            "lineNumber": 213,
            "text": "\t/**"
          },
          {
            "lineNumber": 214,
            "text": "\t * Outputs HTML that renders a meta box in the Classic Editor for all our taxonomies."
          },
          {
            "lineNumber": 215,
            "text": "\t *"
          },
          {
            "lineNumber": 216,
            "text": "\t * @param  WP_Post $post Current post object."
          },
          {
            "lineNumber": 217,
            "text": "\t * @param  array   $box  Categories meta box arguments."
          },
          {
            "lineNumber": 218,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 219,
            "text": "\t */"
          },
          {
            "lineNumber": 220,
            "text": "\tpublic static function meta_box_html( $post, $box ) {"
          },
          {
            "lineNumber": 221,
            "text": "\t\t$taxonomy = $box['args']['taxonomy'] ?? '';"
          }
        ],
        "range": {
          "endPosition": {
            "line": 221
          },
          "startPosition": {
            "line": 156
          }
        },
        "relativeWorkspacePath": "./includes/class-taxonomies.php",
        "signatures": {}
      },
      "score": 0.2885845899581909
    },
    {
      "codeBlock": {
        "contents": "$options[] = $value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// String data.\n\t\t\t\t\t\t$value = sanitize_text_field( wp_unslash( $_POST[ $key ] ) );\n\n\t\t\t\t\t\t// Some values exist in post meta and taxonomy terms.\n\t\t\t\t\t\t// Check $_POST['tax_input'] in case the user checked a term box.\n\t\t\t\t\t\tif ( '' === $value \u0026\u0026 isset( $_POST['tax_input'] ) ) {\n\t\t\t\t\t\t\t$tax_input = $_POST['tax_input'];\n\t\t\t\t\t\t\tif ( isset( $overlapping_keys[ $unprefixed_key ] ) \u0026\u0026 isset( $tax_input[ $overlapping_keys[ $unprefixed_key ] ] ) ) {\n\t\t\t\t\t\t\t\t$term_id = intval( array_values( array_filter( $tax_input[ $overlapping_keys[ $unprefixed_key ] ] ) )[0] ?? '0' );\n\t\t\t\t\t\t\t\t$term    = get_term_by( 'term_taxonomy_id', $term_id, $overlapping_keys[ $unprefixed_key ] );\n\t\t\t\t\t\t\t\tif ( false !== $term ) {\n\t\t\t\t\t\t\t\t\t$value = $term-\u003ename;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The values for keys with overlapping taxonomies might be slugs instead of term names.\n\t\t\t\t\t\t// inventory_presser_availability might arrive with a value of \"for-sale\" but we want to save \"For Sale\".\n\t\t\t\t\t\t$overlapping_keys = Inventory_Presser_Taxonomy_Overlapper::overlapping_meta_keys();\n\t\t\t\t\t\tif ( isset( $overlapping_keys[ $unprefixed_key ] ) ) {\n\t\t\t\t\t\t\t$term = get_term_by( 'slug', $value, $overlapping_keys[ $unprefixed_key ] );\n\t\t\t\t\t\t\tif ( false !== $term ) {\n\t\t\t\t\t\t\t\t$value = $term-\u003ename;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdate_post_meta( $post-\u003eID, $key, sanitize_text_field( $value ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Adds a contact form to single vehicle pages if a form is saved in the\n\t\t * setting.\n\t\t *\n\t\t * @param  array $sections\n\t\t * @return array\n\t\t */\n\t\tpublic function single_sections_add_form( $sections ) {\n\t\t\t// Does this setting have a value?\n\t\t\t$settings = INVP::settings();",
        "detailedLines": [
          {
            "lineNumber": 1889,
            "text": "$options[] = $value;"
          },
          {
            "lineNumber": 1890,
            "text": "\t\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1891,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1892,
            "text": "\t\t\t\t\t} else {"
          },
          {
            "lineNumber": 1893,
            "text": "\t\t\t\t\t\t// String data."
          },
          {
            "lineNumber": 1894,
            "text": "\t\t\t\t\t\t$value = sanitize_text_field( wp_unslash( $_POST[ $key ] ) );"
          },
          {
            "lineNumber": 1895
          },
          {
            "lineNumber": 1896,
            "text": "\t\t\t\t\t\t// Some values exist in post meta and taxonomy terms."
          },
          {
            "lineNumber": 1897,
            "text": "\t\t\t\t\t\t// Check $_POST['tax_input'] in case the user checked a term box."
          },
          {
            "lineNumber": 1898,
            "text": "\t\t\t\t\t\tif ( '' === $value \u0026\u0026 isset( $_POST['tax_input'] ) ) {"
          },
          {
            "lineNumber": 1899,
            "text": "\t\t\t\t\t\t\t$tax_input = $_POST['tax_input'];"
          },
          {
            "lineNumber": 1900,
            "text": "\t\t\t\t\t\t\tif ( isset( $overlapping_keys[ $unprefixed_key ] ) \u0026\u0026 isset( $tax_input[ $overlapping_keys[ $unprefixed_key ] ] ) ) {"
          },
          {
            "lineNumber": 1901,
            "text": "\t\t\t\t\t\t\t\t$term_id = intval( array_values( array_filter( $tax_input[ $overlapping_keys[ $unprefixed_key ] ] ) )[0] ?? '0' );"
          },
          {
            "lineNumber": 1902,
            "text": "\t\t\t\t\t\t\t\t$term    = get_term_by( 'term_taxonomy_id', $term_id, $overlapping_keys[ $unprefixed_key ] );"
          },
          {
            "lineNumber": 1903,
            "text": "\t\t\t\t\t\t\t\tif ( false !== $term ) {"
          },
          {
            "lineNumber": 1904,
            "text": "\t\t\t\t\t\t\t\t\t$value = $term-\u003ename;"
          },
          {
            "lineNumber": 1905,
            "text": "\t\t\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1906,
            "text": "\t\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1907,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1908
          },
          {
            "lineNumber": 1909,
            "text": "\t\t\t\t\t\t// The values for keys with overlapping taxonomies might be slugs instead of term names."
          },
          {
            "lineNumber": 1910,
            "text": "\t\t\t\t\t\t// inventory_presser_availability might arrive with a value of \"for-sale\" but we want to save \"For Sale\"."
          },
          {
            "lineNumber": 1911,
            "text": "\t\t\t\t\t\t$overlapping_keys = Inventory_Presser_Taxonomy_Overlapper::overlapping_meta_keys();"
          },
          {
            "lineNumber": 1912,
            "text": "\t\t\t\t\t\tif ( isset( $overlapping_keys[ $unprefixed_key ] ) ) {"
          },
          {
            "lineNumber": 1913,
            "text": "\t\t\t\t\t\t\t$term = get_term_by( 'slug', $value, $overlapping_keys[ $unprefixed_key ] );"
          },
          {
            "lineNumber": 1914,
            "text": "\t\t\t\t\t\t\tif ( false !== $term ) {"
          },
          {
            "lineNumber": 1915,
            "text": "\t\t\t\t\t\t\t\t$value = $term-\u003ename;"
          },
          {
            "lineNumber": 1916,
            "text": "\t\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1917,
            "text": "\t\t\t\t\t\t}"
          },
          {
            "lineNumber": 1918,
            "text": "\t\t\t\t\t\tupdate_post_meta( $post-\u003eID, $key, sanitize_text_field( $value ) );"
          },
          {
            "lineNumber": 1919,
            "text": "\t\t\t\t\t}"
          },
          {
            "lineNumber": 1920,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 1921,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1922,
            "text": "\t\t}"
          },
          {
            "lineNumber": 1923
          },
          {
            "lineNumber": 1924,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 1925,
            "text": "\t\t * Adds a contact form to single vehicle pages if a form is saved in the"
          },
          {
            "lineNumber": 1926,
            "text": "\t\t * setting."
          },
          {
            "lineNumber": 1927,
            "text": "\t\t *"
          },
          {
            "lineNumber": 1928,
            "text": "\t\t * @param  array $sections"
          },
          {
            "lineNumber": 1929,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 1930,
            "text": "\t\t */"
          },
          {
            "lineNumber": 1931,
            "text": "\t\tpublic function single_sections_add_form( $sections ) {"
          },
          {
            "lineNumber": 1932,
            "text": "\t\t\t// Does this setting have a value?"
          },
          {
            "lineNumber": 1933,
            "text": "\t\t\t$settings = INVP::settings();"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1933
          },
          "startPosition": {
            "column": 8,
            "line": 1888
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.28103554248809814
    },
    {
      "codeBlock": {
        "contents": "\t\tif ( $args['newest_first'] ) {\n\t\t\t// Change the order to last_modified date.\n\t\t\t$post_args['meta_key'] = apply_filters( 'invp_prefix_meta_key', 'last_modified' );\n\t\t\tglobal $wpdb;\n\t\t\t$post_args['orderby'] = \"STR_TO_DATE( {$wpdb-\u003epostmeta}.meta_value, '%a, %d %b %Y %T' )\";\n\t\t\t$post_args['order']   = 'DESC';\n\t\t}\n\n\t\t// Do we want featured vehicles only?\n\t\tif ( $args['featured_only'] ) {\n\t\t\t$post_args['meta_query'][] = array(\n\t\t\t\t'key'   =\u003e apply_filters( 'invp_prefix_meta_key', 'featured' ),\n\t\t\t\t'value' =\u003e '1',\n\t\t\t);\n\t\t}\n\n\t\t// Are we only showing 1 make?\n\t\tif ( ! empty( $args['make'] ) ) {\n\t\t\t$post_args['tax_query'][] = array(\n\t\t\t\t'taxonomy' =\u003e 'make',\n\t\t\t\t'field'    =\u003e 'slug',\n\t\t\t\t'terms'    =\u003e $args['make'],\n\t\t\t);\n\t\t}\n\n\t\t// Are we only showing 1 model?\n\t\tif ( ! empty( $args['model'] ) ) {\n\t\t\t$post_args['meta_query'][] = array(\n\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),\n\t\t\t\t'value'   =\u003e $args['model'],\n\t\t\t\t'compare' =\u003e 'LIKE',\n\t\t\t);\n\t\t}\n\n\t\t// Should we exclude sold vehicles?\n\t\t$plugin_settings = INVP::settings();\n\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 ! $plugin_settings['include_sold_vehicles'] ) {\n\t\t\t$post_args['tax_query'][] = Inventory_Presser_Taxonomies::tax_query_exclude_sold();\n\t\t}\n\n\t\t$inventory_ids = get_posts( $post_args );\n\t\tif ( empty( $inventory_ids ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do we want priced vehicles first?\n\t\tif ( $args['priced_first'] ) {\n\t\t\t// Yes. Scan the results for vehicles without prices.\n\t\t\t$ids_without_prices = array();\n\t\t\tforeach ( $inventory_ids as $inventory_id ) {\n\t\t\t\tif ( empty( get_post_meta( $inventory_id, apply_filters( 'invp_prefix_meta_key', 'price' ) ) ) ) {\n\t\t\t\t\t$ids_without_prices[] = $inventory_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! empty( $ids_without_prices ) ) {\n\t\t\t\t// Remove IDs and then add them to the end of the array.\n\t\t\t\t$inventory_ids = array_merge( array_diff( $inventory_ids, $ids_without_prices ), $ids_without_prices );\n\t\t\t}\n\t\t}\n\n\t\t$grid_html = sprintf(\n\t\t\t'\u003cdiv class=\"invp-grid\"\u003e\u003cul class=\"grid-slides columns-%s\"\u003e',",
        "detailedLines": [
          {
            "lineNumber": 111,
            "text": "\t\tif ( $args['newest_first'] ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t// Change the order to last_modified date."
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t$post_args['meta_key'] = apply_filters( 'invp_prefix_meta_key', 'last_modified' );"
          },
          {
            "lineNumber": 114,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\t$post_args['orderby'] = \"STR_TO_DATE( {$wpdb-\u003epostmeta}.meta_value, '%a, %d %b %Y %T' )\";"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t$post_args['order']   = 'DESC';"
          },
          {
            "lineNumber": 117,
            "text": "\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t// Do we want featured vehicles only?"
          },
          {
            "lineNumber": 120,
            "text": "\t\tif ( $args['featured_only'] ) {"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t$post_args['meta_query'][] = array("
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t\t'key'   =\u003e apply_filters( 'invp_prefix_meta_key', 'featured' ),"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\t'value' =\u003e '1',"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 125,
            "text": "\t\t}"
          },
          {
            "lineNumber": 126
          },
          {
            "lineNumber": 127,
            "text": "\t\t// Are we only showing 1 make?"
          },
          {
            "lineNumber": 128,
            "text": "\t\tif ( ! empty( $args['make'] ) ) {"
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t$post_args['tax_query'][] = array("
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t\t'taxonomy' =\u003e 'make',"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t\t'field'    =\u003e 'slug',"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t\t'terms'    =\u003e $args['make'],"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 134,
            "text": "\t\t}"
          },
          {
            "lineNumber": 135
          },
          {
            "lineNumber": 136,
            "text": "\t\t// Are we only showing 1 model?"
          },
          {
            "lineNumber": 137,
            "text": "\t\tif ( ! empty( $args['model'] ) ) {"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t$post_args['meta_query'][] = array("
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t'value'   =\u003e $args['model'],"
          },
          {
            "lineNumber": 141,
            "text": "\t\t\t\t'compare' =\u003e 'LIKE',"
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 143,
            "text": "\t\t}"
          },
          {
            "lineNumber": 144
          },
          {
            "lineNumber": 145,
            "text": "\t\t// Should we exclude sold vehicles?"
          },
          {
            "lineNumber": 146,
            "text": "\t\t$plugin_settings = INVP::settings();"
          },
          {
            "lineNumber": 147,
            "text": "\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 ! $plugin_settings['include_sold_vehicles'] ) {"
          },
          {
            "lineNumber": 148,
            "text": "\t\t\t$post_args['tax_query'][] = Inventory_Presser_Taxonomies::tax_query_exclude_sold();"
          },
          {
            "lineNumber": 149,
            "text": "\t\t}"
          },
          {
            "lineNumber": 150
          },
          {
            "lineNumber": 151,
            "text": "\t\t$inventory_ids = get_posts( $post_args );"
          },
          {
            "lineNumber": 152,
            "text": "\t\tif ( empty( $inventory_ids ) ) {"
          },
          {
            "lineNumber": 153,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 154,
            "text": "\t\t}"
          },
          {
            "lineNumber": 155
          },
          {
            "lineNumber": 156,
            "text": "\t\t// Do we want priced vehicles first?"
          },
          {
            "lineNumber": 157,
            "text": "\t\tif ( $args['priced_first'] ) {"
          },
          {
            "lineNumber": 158,
            "text": "\t\t\t// Yes. Scan the results for vehicles without prices."
          },
          {
            "lineNumber": 159,
            "text": "\t\t\t$ids_without_prices = array();"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\tforeach ( $inventory_ids as $inventory_id ) {"
          },
          {
            "lineNumber": 161,
            "text": "\t\t\t\tif ( empty( get_post_meta( $inventory_id, apply_filters( 'invp_prefix_meta_key', 'price' ) ) ) ) {"
          },
          {
            "lineNumber": 162,
            "text": "\t\t\t\t\t$ids_without_prices[] = $inventory_id;"
          },
          {
            "lineNumber": 163,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 164,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 165,
            "text": "\t\t\tif ( ! empty( $ids_without_prices ) ) {"
          },
          {
            "lineNumber": 166,
            "text": "\t\t\t\t// Remove IDs and then add them to the end of the array."
          },
          {
            "lineNumber": 167,
            "text": "\t\t\t\t$inventory_ids = array_merge( array_diff( $inventory_ids, $ids_without_prices ), $ids_without_prices );"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 169,
            "text": "\t\t}"
          },
          {
            "lineNumber": 170
          },
          {
            "lineNumber": 171,
            "text": "\t\t$grid_html = sprintf("
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t'\u003cdiv class=\"invp-grid\"\u003e\u003cul class=\"grid-slides columns-%s\"\u003e',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 172
          },
          "startPosition": {
            "line": 110
          }
        },
        "relativeWorkspacePath": "./includes/widget/class-widget-inventory-grid.php",
        "signatures": {}
      },
      "score": 0.2772420048713684
    },
    {
      "codeBlock": {
        "contents": "\t * @return void\n\t */\n\tpublic function add_meta_boxes_to_cpt() {\n\t\t// Add a meta box to the New/Edit post page.\n\t\tadd_meta_box( 'vehicle-meta', 'Attributes', array( $this, 'meta_box_html_vehicle' ), INVP::POST_TYPE, 'normal', 'high' );\n\n\t\t// And another for prices.\n\t\tadd_meta_box( 'prices-meta', 'Prices', array( $this, 'meta_box_html_prices' ), INVP::POST_TYPE, 'normal', 'high' );\n\n\t\t// Add another meta box to the New/Edit post page.\n\t\tadd_meta_box( 'options-meta', 'Optional equipment', array( $this, 'meta_box_html_options' ), INVP::POST_TYPE, 'normal', 'high' );\n\n\t\t// Add a meta box to the side column for a featured vehicle checkbox.\n\t\tadd_meta_box( 'featured', 'Featured Vehicle', array( $this, 'meta_box_html_featured' ), INVP::POST_TYPE, 'side', 'low' );\n\t}\n\n\t/**\n\t * Don't add media HTML to the post body when the Add Media button is used\n\t * to attach a photo to a vehicle.\n\t *\n\t * @param string $html HTML markup for a media item sent to the editor.\n\t * @param int    $id The first key from the $_POST['send'] data.\n\t * @return string\n\t */\n\tpublic function erase_add_media_html( $html, $id ) {\n\t\t$parent = get_post_parent( $id );\n\t\tif ( ! empty( $parent-\u003epost_type ) \u0026\u0026 INVP::POST_TYPE !== $parent-\u003epost_type ) {\n\t\t\treturn $html;\n\t\t}\n\t\treturn '';\n\t}\n\n\t/**\n\t * Adds HTML near the Add Media button on the classic editor.\n\t *\n\t * @param  mixed $editor_id\n\t * @return void\n\t */\n\tpublic function annotate_add_media_button( $editor_id ) {\n\t\tif ( 'content' !== $editor_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'%s\u003cspan id=\"media-annotation\" class=\"annotation\"\u003e%s\u003c/span\u003e',\n\t\t\t$this-\u003ecreate_delete_all_post_attachments_button(),\n\t\t\t$this-\u003ecreate_add_media_button_annotation()\n\t\t);\n\t}\n\n\t/**\n\t * Computes the number of attachments on vehicles so the number can be\n\t * shown in the classic editor near the Add Media button.\n\t *\n\t * @return string\n\t */\n\tprotected function create_add_media_button_annotation() {\n\t\tglobal $post;\n\t\t$the_post = $post;\n\t\tif ( ! is_object( $the_post ) \u0026\u0026 isset( $_POST['post_ID'] ) ) {\n\t\t\t",
        "detailedLines": [
          {
            "lineNumber": 85,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 86,
            "text": "\t */"
          },
          {
            "lineNumber": 87,
            "text": "\tpublic function add_meta_boxes_to_cpt() {"
          },
          {
            "lineNumber": 88,
            "text": "\t\t// Add a meta box to the New/Edit post page."
          },
          {
            "lineNumber": 89,
            "text": "\t\tadd_meta_box( 'vehicle-meta', 'Attributes', array( $this, 'meta_box_html_vehicle' ), INVP::POST_TYPE, 'normal', 'high' );"
          },
          {
            "lineNumber": 90
          },
          {
            "lineNumber": 91,
            "text": "\t\t// And another for prices."
          },
          {
            "lineNumber": 92,
            "text": "\t\tadd_meta_box( 'prices-meta', 'Prices', array( $this, 'meta_box_html_prices' ), INVP::POST_TYPE, 'normal', 'high' );"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\t// Add another meta box to the New/Edit post page."
          },
          {
            "lineNumber": 95,
            "text": "\t\tadd_meta_box( 'options-meta', 'Optional equipment', array( $this, 'meta_box_html_options' ), INVP::POST_TYPE, 'normal', 'high' );"
          },
          {
            "lineNumber": 96
          },
          {
            "lineNumber": 97,
            "text": "\t\t// Add a meta box to the side column for a featured vehicle checkbox."
          },
          {
            "lineNumber": 98,
            "text": "\t\tadd_meta_box( 'featured', 'Featured Vehicle', array( $this, 'meta_box_html_featured' ), INVP::POST_TYPE, 'side', 'low' );"
          },
          {
            "lineNumber": 99,
            "text": "\t}"
          },
          {
            "lineNumber": 100
          },
          {
            "lineNumber": 101,
            "text": "\t/**"
          },
          {
            "lineNumber": 102,
            "text": "\t * Don't add media HTML to the post body when the Add Media button is used"
          },
          {
            "lineNumber": 103,
            "text": "\t * to attach a photo to a vehicle."
          },
          {
            "lineNumber": 104,
            "text": "\t *"
          },
          {
            "lineNumber": 105,
            "text": "\t * @param string $html HTML markup for a media item sent to the editor."
          },
          {
            "lineNumber": 106,
            "text": "\t * @param int    $id The first key from the $_POST['send'] data."
          },
          {
            "lineNumber": 107,
            "text": "\t * @return string"
          },
          {
            "lineNumber": 108,
            "text": "\t */"
          },
          {
            "lineNumber": 109,
            "text": "\tpublic function erase_add_media_html( $html, $id ) {"
          },
          {
            "lineNumber": 110,
            "text": "\t\t$parent = get_post_parent( $id );"
          },
          {
            "lineNumber": 111,
            "text": "\t\tif ( ! empty( $parent-\u003epost_type ) \u0026\u0026 INVP::POST_TYPE !== $parent-\u003epost_type ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\treturn $html;"
          },
          {
            "lineNumber": 113,
            "text": "\t\t}"
          },
          {
            "lineNumber": 114,
            "text": "\t\treturn '';"
          },
          {
            "lineNumber": 115,
            "text": "\t}"
          },
          {
            "lineNumber": 116
          },
          {
            "lineNumber": 117,
            "text": "\t/**"
          },
          {
            "lineNumber": 118,
            "text": "\t * Adds HTML near the Add Media button on the classic editor."
          },
          {
            "lineNumber": 119,
            "text": "\t *"
          },
          {
            "lineNumber": 120,
            "text": "\t * @param  mixed $editor_id"
          },
          {
            "lineNumber": 121,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 122,
            "text": "\t */"
          },
          {
            "lineNumber": 123,
            "text": "\tpublic function annotate_add_media_button( $editor_id ) {"
          },
          {
            "lineNumber": 124,
            "text": "\t\tif ( 'content' !== $editor_id ) {"
          },
          {
            "lineNumber": 125,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 126,
            "text": "\t\t}"
          },
          {
            "lineNumber": 127
          },
          {
            "lineNumber": 128,
            "text": "\t\tprintf("
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t'%s\u003cspan id=\"media-annotation\" class=\"annotation\"\u003e%s\u003c/span\u003e',"
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t$this-\u003ecreate_delete_all_post_attachments_button(),"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t$this-\u003ecreate_add_media_button_annotation()"
          },
          {
            "lineNumber": 132,
            "text": "\t\t);"
          },
          {
            "lineNumber": 133,
            "text": "\t}"
          },
          {
            "lineNumber": 134
          },
          {
            "lineNumber": 135,
            "text": "\t/**"
          },
          {
            "lineNumber": 136,
            "text": "\t * Computes the number of attachments on vehicles so the number can be"
          },
          {
            "lineNumber": 137,
            "text": "\t * shown in the classic editor near the Add Media button."
          },
          {
            "lineNumber": 138,
            "text": "\t *"
          },
          {
            "lineNumber": 139,
            "text": "\t * @return string"
          },
          {
            "lineNumber": 140,
            "text": "\t */"
          },
          {
            "lineNumber": 141,
            "text": "\tprotected function create_add_media_button_annotation() {"
          },
          {
            "lineNumber": 142,
            "text": "\t\tglobal $post;"
          },
          {
            "lineNumber": 143,
            "text": "\t\t$the_post = $post;"
          },
          {
            "lineNumber": 144,
            "text": "\t\tif ( ! is_object( $the_post ) \u0026\u0026 isset( $_POST['post_ID'] ) ) {"
          },
          {
            "lineNumber": 145,
            "text": "\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 3,
            "line": 144
          },
          "startPosition": {
            "line": 84
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-classic-editor.php",
        "signatures": {}
      },
      "score": 0.2767673134803772
    },
    {
      "codeBlock": {
        "contents": "\t */\n\tpublic static function keys_and_types() {\n\t\treturn apply_filters(\n\t\t\t'invp_meta_fields',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'label'  =\u003e __( 'Availability', 'inventory-presser' ),\n\t\t\t\t\t'name'   =\u003e 'availability',\n\t\t\t\t\t'sample' =\u003e __( 'For Sale', 'inventory-presser' ),\n\t\t\t\t\t'type'   =\u003e 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Beam', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'beam', // for boats.\n\t\t\t\t\t'type'  =\u003e 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label'  =\u003e __( 'Body Style', 'inventory-presser' ),\n\t\t\t\t\t'name'   =\u003e 'body_style',\n\t\t\t\t\t'sample' =\u003e __( 'EXTENDED CAB PICKUP', 'inventory-presser' ),\n\t\t\t\t\t'type'   =\u003e 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label'  =\u003e __( 'KBB Book Value', 'inventory-presser' ), // Kelley Blue Book.\n\t\t\t\t\t'name'   =\u003e 'book_value_kbb',\n\t\t\t\t\t'sample' =\u003e 13500,\n\t\t\t\t\t'type'   =\u003e 'number',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label'  =\u003e __( 'NADA Book Value', 'inventory-presser' ), // NADA Guides.\n\t\t\t\t\t'name'   =\u003e 'book_value_nada',\n\t\t\t\t\t'sample' =\u003e 13500,\n\t\t\t\t\t'type'   =\u003e 'number',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Car ID', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'car_id', // unique identifier.\n\t\t\t\t\t'type'  =\u003e 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax Accident Free', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'carfax_accident_free',\n\t\t\t\t\t'type'  =\u003e 'boolean',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax Have Report', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'carfax_have_report',\n\t\t\t\t\t'type'  =\u003e 'boolean',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax One Owner', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'carfax_one_owner',\n\t\t\t\t\t'type'  =\u003e 'boolean',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax Top Condition', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'carfax_top_condition',\n\t\t\t\t\t'type'  =\u003e 'boolean',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax Icon URL', 'inventory-presser' ),\n\t\t\t\t\t'name'  =\u003e 'carfax_url_icon',\n\t\t\t\t\t'type'  =\u003e 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'label' =\u003e __( 'Carfax Accident-Free Badge URL', 'inventory-presser' ),",
        "detailedLines": [
          {
            "lineNumber": 497,
            "text": "\t */"
          },
          {
            "lineNumber": 498,
            "text": "\tpublic static function keys_and_types() {"
          },
          {
            "lineNumber": 499,
            "text": "\t\treturn apply_filters("
          },
          {
            "lineNumber": 500,
            "text": "\t\t\t'invp_meta_fields',"
          },
          {
            "lineNumber": 501,
            "text": "\t\t\tarray("
          },
          {
            "lineNumber": 502,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 503,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'Availability', 'inventory-presser' ),"
          },
          {
            "lineNumber": 504,
            "text": "\t\t\t\t\t'name'   =\u003e 'availability',"
          },
          {
            "lineNumber": 505,
            "text": "\t\t\t\t\t'sample' =\u003e __( 'For Sale', 'inventory-presser' ),"
          },
          {
            "lineNumber": 506,
            "text": "\t\t\t\t\t'type'   =\u003e 'string',"
          },
          {
            "lineNumber": 507,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 508,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 509,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Beam', 'inventory-presser' ),"
          },
          {
            "lineNumber": 510,
            "text": "\t\t\t\t\t'name'  =\u003e 'beam', // for boats."
          },
          {
            "lineNumber": 511,
            "text": "\t\t\t\t\t'type'  =\u003e 'string',"
          },
          {
            "lineNumber": 512,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 513,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 514,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'Body Style', 'inventory-presser' ),"
          },
          {
            "lineNumber": 515,
            "text": "\t\t\t\t\t'name'   =\u003e 'body_style',"
          },
          {
            "lineNumber": 516,
            "text": "\t\t\t\t\t'sample' =\u003e __( 'EXTENDED CAB PICKUP', 'inventory-presser' ),"
          },
          {
            "lineNumber": 517,
            "text": "\t\t\t\t\t'type'   =\u003e 'string',"
          },
          {
            "lineNumber": 518,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 519,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 520,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'KBB Book Value', 'inventory-presser' ), // Kelley Blue Book."
          },
          {
            "lineNumber": 521,
            "text": "\t\t\t\t\t'name'   =\u003e 'book_value_kbb',"
          },
          {
            "lineNumber": 522,
            "text": "\t\t\t\t\t'sample' =\u003e 13500,"
          },
          {
            "lineNumber": 523,
            "text": "\t\t\t\t\t'type'   =\u003e 'number',"
          },
          {
            "lineNumber": 524,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 525,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 526,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'NADA Book Value', 'inventory-presser' ), // NADA Guides."
          },
          {
            "lineNumber": 527,
            "text": "\t\t\t\t\t'name'   =\u003e 'book_value_nada',"
          },
          {
            "lineNumber": 528,
            "text": "\t\t\t\t\t'sample' =\u003e 13500,"
          },
          {
            "lineNumber": 529,
            "text": "\t\t\t\t\t'type'   =\u003e 'number',"
          },
          {
            "lineNumber": 530,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 531,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 532,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Car ID', 'inventory-presser' ),"
          },
          {
            "lineNumber": 533,
            "text": "\t\t\t\t\t'name'  =\u003e 'car_id', // unique identifier."
          },
          {
            "lineNumber": 534,
            "text": "\t\t\t\t\t'type'  =\u003e 'string',"
          },
          {
            "lineNumber": 535,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 536,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 537,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Accident Free', 'inventory-presser' ),"
          },
          {
            "lineNumber": 538,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_accident_free',"
          },
          {
            "lineNumber": 539,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',"
          },
          {
            "lineNumber": 540,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 541,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 542,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Have Report', 'inventory-presser' ),"
          },
          {
            "lineNumber": 543,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_have_report',"
          },
          {
            "lineNumber": 544,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',"
          },
          {
            "lineNumber": 545,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 546,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 547,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax One Owner', 'inventory-presser' ),"
          },
          {
            "lineNumber": 548,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_one_owner',"
          },
          {
            "lineNumber": 549,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',"
          },
          {
            "lineNumber": 550,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 551,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 552,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Top Condition', 'inventory-presser' ),"
          },
          {
            "lineNumber": 553,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_top_condition',"
          },
          {
            "lineNumber": 554,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',"
          },
          {
            "lineNumber": 555,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 556,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 557,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Icon URL', 'inventory-presser' ),"
          },
          {
            "lineNumber": 558,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_url_icon',"
          },
          {
            "lineNumber": 559,
            "text": "\t\t\t\t\t'type'  =\u003e 'string',"
          },
          {
            "lineNumber": 560,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 561,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 562,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Accident-Free Badge URL', 'inventory-presser' ),"
          }
        ],
        "range": {
          "endPosition": {
            "line": 562
          },
          "startPosition": {
            "line": 496
          }
        },
        "relativeWorkspacePath": "./includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.275723397731781
    },
    {
      "codeBlock": {
        "contents": "\t\t * @return void\n\t\t */\n\t\tpublic function handler_vehicle( $tag ) {\n\t\t\t$validation_error = wpcf7_get_validation_error( $tag-\u003ename );\n\t\t\t$atts             = array(\n\t\t\t\t'id' =\u003e '',\n\t\t\t);\n\n\t\t\tif ( ! empty( $tag-\u003eoptions ) ) {\n\t\t\t\tarray_walk(\n\t\t\t\t\t$tag-\u003eoptions,\n\t\t\t\t\tfunction ( $item ) use ( \u0026$atts ) {\n\t\t\t\t\t\tlist( $key, $val ) = explode( ':', $item );\n\t\t\t\t\t\t$atts[ $key ]      = $val;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Is this a vehicle details page?\n\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {\n\t\t\t\t// Yes. Return two hidden fields.\n\n\t\t\t\t// Vehicle field.\n\t\t\t\t// \u003cinput type=\"hidden\" name=\"vehicle\" value=\"2022 KTM 890 DUKE R, K30451\" /\u003e.\n\t\t\t\t$input_atts = array(\n\t\t\t\t\t'type'  =\u003e 'hidden',\n\t\t\t\t\t'name'  =\u003e $tag-\u003ename,\n\t\t\t\t\t'value' =\u003e $this-\u003eprepare_value(),\n\t\t\t\t);\n\t\t\t\tif ( ! empty( $atts['id'] ) ) {\n\t\t\t\t\t$input_atts['id'] = $atts['id'];\n\t\t\t\t}\n\t\t\t\t$html = sprintf(\n\t\t\t\t\t'\u003cinput %s /\u003e',\n\t\t\t\t\twpcf7_format_atts( $input_atts )\n\t\t\t\t);\n\n\t\t\t\t// Post ID field.\n\t\t\t\t// \u003cinput type=\"hidden\" name=\"post_id\" value=\"257\" /\u003e.\n\t\t\t\t$input_atts = array(\n\t\t\t\t\t'type'  =\u003e 'hidden',\n\t\t\t\t\t'name'  =\u003e 'post_id',\n\t\t\t\t\t'value' =\u003e get_the_ID(),\n\t\t\t\t);\n\t\t\t\t$html      .= sprintf(\n\t\t\t\t\t'\u003cinput %s /\u003e',\n\t\t\t\t\twpcf7_format_atts( $input_atts )\n\t\t\t\t);\n\n\t\t\t\treturn apply_filters( 'invp_cf7_field_vehicle_html', $html . $validation_error, $atts );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Here's a query to get the post IDs of the vehicles we want\n\t\t\t * in the order we want. The reason we are not using get_posts\n\t\t\t * is because we want to sort by 3 post meta values\n\t\t\t */\n\t\t\tglobal $wpdb;\n\t\t\t$post_ids = $wpdb-\u003eget_col(\n\t\t\t\t$wpdb-\u003eprepare(\n\t\t\t\t\t\"\n\t\t\t\t",
        "detailedLines": [
          {
            "lineNumber": 210,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 211,
            "text": "\t\t */"
          },
          {
            "lineNumber": 212,
            "text": "\t\tpublic function handler_vehicle( $tag ) {"
          },
          {
            "lineNumber": 213,
            "text": "\t\t\t$validation_error = wpcf7_get_validation_error( $tag-\u003ename );"
          },
          {
            "lineNumber": 214,
            "text": "\t\t\t$atts             = array("
          },
          {
            "lineNumber": 215,
            "text": "\t\t\t\t'id' =\u003e '',"
          },
          {
            "lineNumber": 216,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 217
          },
          {
            "lineNumber": 218,
            "text": "\t\t\tif ( ! empty( $tag-\u003eoptions ) ) {"
          },
          {
            "lineNumber": 219,
            "text": "\t\t\t\tarray_walk("
          },
          {
            "lineNumber": 220,
            "text": "\t\t\t\t\t$tag-\u003eoptions,"
          },
          {
            "lineNumber": 221,
            "text": "\t\t\t\t\tfunction ( $item ) use ( \u0026$atts ) {"
          },
          {
            "lineNumber": 222,
            "text": "\t\t\t\t\t\tlist( $key, $val ) = explode( ':', $item );"
          },
          {
            "lineNumber": 223,
            "text": "\t\t\t\t\t\t$atts[ $key ]      = $val;"
          },
          {
            "lineNumber": 224,
            "text": "\t\t\t\t\t}"
          },
          {
            "lineNumber": 225,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 226,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 227
          },
          {
            "lineNumber": 228,
            "text": "\t\t\t// Is this a vehicle details page?"
          },
          {
            "lineNumber": 229,
            "text": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 230,
            "text": "\t\t\t\t// Yes. Return two hidden fields."
          },
          {
            "lineNumber": 231
          },
          {
            "lineNumber": 232,
            "text": "\t\t\t\t// Vehicle field."
          },
          {
            "lineNumber": 233,
            "text": "\t\t\t\t// \u003cinput type=\"hidden\" name=\"vehicle\" value=\"2022 KTM 890 DUKE R, K30451\" /\u003e."
          },
          {
            "lineNumber": 234,
            "text": "\t\t\t\t$input_atts = array("
          },
          {
            "lineNumber": 235,
            "text": "\t\t\t\t\t'type'  =\u003e 'hidden',"
          },
          {
            "lineNumber": 236,
            "text": "\t\t\t\t\t'name'  =\u003e $tag-\u003ename,"
          },
          {
            "lineNumber": 237,
            "text": "\t\t\t\t\t'value' =\u003e $this-\u003eprepare_value(),"
          },
          {
            "lineNumber": 238,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 239,
            "text": "\t\t\t\tif ( ! empty( $atts['id'] ) ) {"
          },
          {
            "lineNumber": 240,
            "text": "\t\t\t\t\t$input_atts['id'] = $atts['id'];"
          },
          {
            "lineNumber": 241,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 242,
            "text": "\t\t\t\t$html = sprintf("
          },
          {
            "lineNumber": 243,
            "text": "\t\t\t\t\t'\u003cinput %s /\u003e',"
          },
          {
            "lineNumber": 244,
            "text": "\t\t\t\t\twpcf7_format_atts( $input_atts )"
          },
          {
            "lineNumber": 245,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 246
          },
          {
            "lineNumber": 247,
            "text": "\t\t\t\t// Post ID field."
          },
          {
            "lineNumber": 248,
            "text": "\t\t\t\t// \u003cinput type=\"hidden\" name=\"post_id\" value=\"257\" /\u003e."
          },
          {
            "lineNumber": 249,
            "text": "\t\t\t\t$input_atts = array("
          },
          {
            "lineNumber": 250,
            "text": "\t\t\t\t\t'type'  =\u003e 'hidden',"
          },
          {
            "lineNumber": 251,
            "text": "\t\t\t\t\t'name'  =\u003e 'post_id',"
          },
          {
            "lineNumber": 252,
            "text": "\t\t\t\t\t'value' =\u003e get_the_ID(),"
          },
          {
            "lineNumber": 253,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 254,
            "text": "\t\t\t\t$html      .= sprintf("
          },
          {
            "lineNumber": 255,
            "text": "\t\t\t\t\t'\u003cinput %s /\u003e',"
          },
          {
            "lineNumber": 256,
            "text": "\t\t\t\t\twpcf7_format_atts( $input_atts )"
          },
          {
            "lineNumber": 257,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 258
          },
          {
            "lineNumber": 259,
            "text": "\t\t\t\treturn apply_filters( 'invp_cf7_field_vehicle_html', $html . $validation_error, $atts );"
          },
          {
            "lineNumber": 260,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 261
          },
          {
            "lineNumber": 262,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 263,
            "text": "\t\t\t * Here's a query to get the post IDs of the vehicles we want"
          },
          {
            "lineNumber": 264,
            "text": "\t\t\t * in the order we want. The reason we are not using get_posts"
          },
          {
            "lineNumber": 265,
            "text": "\t\t\t * is because we want to sort by 3 post meta values"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t$post_ids = $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\t\t\""
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 4,
            "line": 270
          },
          "startPosition": {
            "line": 209
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-contact-form-7.php",
        "signatures": {}
      },
      "score": 0.2746056318283081
    },
    {
      "codeBlock": {
        "contents": "\t\t *\n\t\t * @return array\n\t\t */\n\t\tprotected function get_vehicle_post_ids() {\n\t\t\tglobal $wpdb;\n\t\t\treturn $wpdb-\u003eget_col(\n\t\t\t\t$wpdb-\u003eprepare(\n\t\t\t\t\t\"\n\t\t\t\t\tSELECT \t\tID\n\n\t\t\t\t\tFROM\t\t$wpdb-\u003eposts\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id\n\n\t\t\t\t\tWHERE \t\tpost_type = %s\n\t\t\t\t\t\t\t\tAND post_status = 'publish'\n\t\t\t\t\t\t\t\tAND meta1.meta_key = %s\n\t\t\t\t\t\t\t\tAND meta2.meta_key = %s\n\t\t\t\t\t\t\t\tAND meta3.meta_key = %s\n\n\t\t\t\t\tORDER BY\tmeta1.meta_value DESC,\n\t\t\t\t\t\t\t\tmeta2.meta_value ASC,\n\t\t\t\t\t\t\t\tmeta3.meta_value ASC;\n\t\t\t\t\",\n\t\t\t\t\tINVP::POST_TYPE,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}",
        "detailedLines": [
          {
            "lineNumber": 244,
            "text": "\t\t *"
          },
          {
            "lineNumber": 245,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 246,
            "text": "\t\t */"
          },
          {
            "lineNumber": 247,
            "text": "\t\tprotected function get_vehicle_post_ids() {"
          },
          {
            "lineNumber": 248,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 249,
            "text": "\t\t\treturn $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 250,
            "text": "\t\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 251,
            "text": "\t\t\t\t\t\""
          },
          {
            "lineNumber": 252,
            "text": "\t\t\t\t\tSELECT \t\tID"
          },
          {
            "lineNumber": 253
          },
          {
            "lineNumber": 254,
            "text": "\t\t\t\t\tFROM\t\t$wpdb-\u003eposts"
          },
          {
            "lineNumber": 255,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id"
          },
          {
            "lineNumber": 256,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id"
          },
          {
            "lineNumber": 257,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id"
          },
          {
            "lineNumber": 258
          },
          {
            "lineNumber": 259,
            "text": "\t\t\t\t\tWHERE \t\tpost_type = %s"
          },
          {
            "lineNumber": 260,
            "text": "\t\t\t\t\t\t\t\tAND post_status = 'publish'"
          },
          {
            "lineNumber": 261,
            "text": "\t\t\t\t\t\t\t\tAND meta1.meta_key = %s"
          },
          {
            "lineNumber": 262,
            "text": "\t\t\t\t\t\t\t\tAND meta2.meta_key = %s"
          },
          {
            "lineNumber": 263,
            "text": "\t\t\t\t\t\t\t\tAND meta3.meta_key = %s"
          },
          {
            "lineNumber": 264
          },
          {
            "lineNumber": 265,
            "text": "\t\t\t\t\tORDER BY\tmeta1.meta_value DESC,"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\t\t\t\t\t\tmeta2.meta_value ASC,"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\t\t\t\t\t\tmeta3.meta_value ASC;"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t\t\","
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 273,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 274,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 275,
            "text": "\t\t}"
          },
          {
            "lineNumber": 276,
            "text": "\t}"
          },
          {
            "lineNumber": 277,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 277
          },
          "startPosition": {
            "line": 243
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-gravityforms-field-vehicle.php",
        "signatures": {}
      },
      "score": 0.2736510932445526
    },
    {
      "codeBlock": {
        "contents": "\t\t */\n\t\tpublic function add_mail_tags( $output, $name, $html, $mail_tag = null ) {\n\t\t\t$name       = preg_replace( '/^wpcf7\\./', '_', $name ); // for back-compat.\n\t\t\t$submission = WPCF7_Submission::get_instance();\n\t\t\tif ( ! $submission ) {\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t// [invp_adf_timestamp] handler\n\t\t\tif ( 'invp_adf_timestamp' === $name\n\t\t\t\t\u0026\u0026 $timestamp = $submission-\u003eget_meta( 'timestamp' )\n\t\t\t) {\n\t\t\t\treturn wp_date( 'c', $timestamp );\n\t\t\t}\n\n\t\t\t// [invp_adf_vehicle] handler\n\t\t\tif ( 'invp_adf_vehicle' === $name ) {\n\t\t\t\tif ( ! has_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) ) ) {\n\t\t\t\t\tadd_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) );\n\t\t\t\t}\n\n\t\t\t\t// What name in posted_data is the vehicle field?\n\t\t\t\t$post_id = $this-\u003eget_submission_vehicle_post_id();\n\t\t\t\tif ( false === $post_id ) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\treturn sprintf(\n\t\t\t\t\t'\u003cvehicle\u003e'\n\t\t\t\t\t. '\u003cid\u003e%s\u003c/id\u003e'\n\t\t\t\t\t. '\u003cyear\u003e%s\u003c/year\u003e'\n\t\t\t\t\t. '\u003cmake\u003e%s\u003c/make\u003e'\n\t\t\t\t\t. '\u003cmodel\u003e%s\u003c/model\u003e'\n\t\t\t\t\t. '\u003cvin\u003e%s\u003c/vin\u003e'\n\t\t\t\t\t. '\u003cstock\u003e%s\u003c/stock\u003e'\n\t\t\t\t\t. '\u003c/vehicle\u003e',\n\t\t\t\t\tINVP::get_meta( 'car_id', $post_id ),\n\t\t\t\t\tinvp_get_the_year( $post_id ),\n\t\t\t\t\tinvp_get_the_make( $post_id ),\n\t\t\t\t\tinvp_get_the_model( $post_id ),\n\t\t\t\t\tinvp_get_the_vin( $post_id ),\n\t\t\t\t\tinvp_get_the_stock_number( $post_id )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// [invp_adf_vendor] handler\n\t\t\tif ( 'invp_adf_vendor' === $name ) {\n\t\t\t\tif ( ! has_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) ) ) {\n\t\t\t\t\t",
        "detailedLines": [
          {
            "lineNumber": 49,
            "text": "\t\t */"
          },
          {
            "lineNumber": 50,
            "text": "\t\tpublic function add_mail_tags( $output, $name, $html, $mail_tag = null ) {"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t$name       = preg_replace( '/^wpcf7\\./', '_', $name ); // for back-compat."
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t$submission = WPCF7_Submission::get_instance();"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\tif ( ! $submission ) {"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\t\treturn $output;"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 56
          },
          {
            "lineNumber": 57,
            "text": "\t\t\t// [invp_adf_timestamp] handler"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\tif ( 'invp_adf_timestamp' === $name"
          },
          {
            "lineNumber": 59,
            "text": "\t\t\t\t\u0026\u0026 $timestamp = $submission-\u003eget_meta( 'timestamp' )"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t) {"
          },
          {
            "lineNumber": 61,
            "text": "\t\t\t\treturn wp_date( 'c', $timestamp );"
          },
          {
            "lineNumber": 62,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 63
          },
          {
            "lineNumber": 64,
            "text": "\t\t\t// [invp_adf_vehicle] handler"
          },
          {
            "lineNumber": 65,
            "text": "\t\t\tif ( 'invp_adf_vehicle' === $name ) {"
          },
          {
            "lineNumber": 66,
            "text": "\t\t\t\tif ( ! has_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) ) ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t\t\tadd_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) );"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 69
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\t// What name in posted_data is the vehicle field?"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t\t$post_id = $this-\u003eget_submission_vehicle_post_id();"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\t\tif ( false === $post_id ) {"
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t\t\treturn '';"
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 75
          },
          {
            "lineNumber": 76,
            "text": "\t\t\t\treturn sprintf("
          },
          {
            "lineNumber": 77,
            "text": "\t\t\t\t\t'\u003cvehicle\u003e'"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t\t\t. '\u003cid\u003e%s\u003c/id\u003e'"
          },
          {
            "lineNumber": 79,
            "text": "\t\t\t\t\t. '\u003cyear\u003e%s\u003c/year\u003e'"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t\t\t. '\u003cmake\u003e%s\u003c/make\u003e'"
          },
          {
            "lineNumber": 81,
            "text": "\t\t\t\t\t. '\u003cmodel\u003e%s\u003c/model\u003e'"
          },
          {
            "lineNumber": 82,
            "text": "\t\t\t\t\t. '\u003cvin\u003e%s\u003c/vin\u003e'"
          },
          {
            "lineNumber": 83,
            "text": "\t\t\t\t\t. '\u003cstock\u003e%s\u003c/stock\u003e'"
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t\t\t. '\u003c/vehicle\u003e',"
          },
          {
            "lineNumber": 85,
            "text": "\t\t\t\t\tINVP::get_meta( 'car_id', $post_id ),"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t\t\tinvp_get_the_year( $post_id ),"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\t\t\tinvp_get_the_make( $post_id ),"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t\t\tinvp_get_the_model( $post_id ),"
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\t\tinvp_get_the_vin( $post_id ),"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t\t\tinvp_get_the_stock_number( $post_id )"
          },
          {
            "lineNumber": 91,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t// [invp_adf_vendor] handler"
          },
          {
            "lineNumber": 95,
            "text": "\t\t\tif ( 'invp_adf_vendor' === $name ) {"
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t\tif ( ! has_filter( 'wp_mail_content_type', array( $this, 'html_mail_content_type' ) ) ) {"
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 5,
            "line": 96
          },
          "startPosition": {
            "line": 48
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-contact-form-7.php",
        "signatures": {}
      },
      "score": 0.2704257071018219
    },
    {
      "codeBlock": {
        "contents": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {\n\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();\n\t\t\t\t$location_meta-\u003eadd_hooks();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Some custom rewrite rules are created and destroyed\n\t\t\t */\n\n\t\t\t// Add custom rewrite rules.\n\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );\n\n\t\t\t/**\n\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are\n\t\t\t * flushed to add and remove our custom rewrite rules\n\t\t\t */\n\n\t\t\t// Flush rewrite rules when the plugin is activated.\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );\n\n\t\t\t// Set default settings values.\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );\n\n\t\t\t// Delete an option during deactivation.\n\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );\n\n\t\t\t// Register some widgets included with this plugin.\n\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );\n\n\t\t\t/**\n\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of\n\t\t\t * the query that's fetching post objects.\n\t\t\t */\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );\n\t\t\t}\n\n\t\t\t// Register scripts and styles.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\n\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );\n\n\t\t\t// Allow custom fields to be searched.\n\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {\n\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();\n\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();\n\t\t\t}\n\n\t\t\t// Redirect URLs by VINs to proper vehicle permalinks.\n\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {\n\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();",
        "detailedLines": [
          {
            "lineNumber": 675,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {"
          },
          {
            "lineNumber": 676,
            "text": "\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();"
          },
          {
            "lineNumber": 677,
            "text": "\t\t\t\t$location_meta-\u003eadd_hooks();"
          },
          {
            "lineNumber": 678,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 679
          },
          {
            "lineNumber": 680,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 681,
            "text": "\t\t\t * Some custom rewrite rules are created and destroyed"
          },
          {
            "lineNumber": 682,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 683
          },
          {
            "lineNumber": 684,
            "text": "\t\t\t// Add custom rewrite rules."
          },
          {
            "lineNumber": 685,
            "text": "\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );"
          },
          {
            "lineNumber": 686
          },
          {
            "lineNumber": 687,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 688,
            "text": "\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are"
          },
          {
            "lineNumber": 689,
            "text": "\t\t\t * flushed to add and remove our custom rewrite rules"
          },
          {
            "lineNumber": 690,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 691
          },
          {
            "lineNumber": 692,
            "text": "\t\t\t// Flush rewrite rules when the plugin is activated."
          },
          {
            "lineNumber": 693,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );"
          },
          {
            "lineNumber": 694
          },
          {
            "lineNumber": 695,
            "text": "\t\t\t// Set default settings values."
          },
          {
            "lineNumber": 696,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );"
          },
          {
            "lineNumber": 697
          },
          {
            "lineNumber": 698,
            "text": "\t\t\t// Delete an option during deactivation."
          },
          {
            "lineNumber": 699,
            "text": "\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );"
          },
          {
            "lineNumber": 700
          },
          {
            "lineNumber": 701,
            "text": "\t\t\t// Register some widgets included with this plugin."
          },
          {
            "lineNumber": 702,
            "text": "\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );"
          },
          {
            "lineNumber": 703
          },
          {
            "lineNumber": 704,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 705,
            "text": "\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of"
          },
          {
            "lineNumber": 706,
            "text": "\t\t\t * the query that's fetching post objects."
          },
          {
            "lineNumber": 707,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 708,
            "text": "\t\t\tif ( ! is_admin() ) {"
          },
          {
            "lineNumber": 709,
            "text": "\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );"
          },
          {
            "lineNumber": 710,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 711
          },
          {
            "lineNumber": 712,
            "text": "\t\t\t// Register scripts and styles."
          },
          {
            "lineNumber": 713,
            "text": "\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 714,
            "text": "\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 715,
            "text": "\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 716
          },
          {
            "lineNumber": 717,
            "text": "\t\t\t// Allow custom fields to be searched."
          },
          {
            "lineNumber": 718,
            "text": "\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {"
          },
          {
            "lineNumber": 719,
            "text": "\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();"
          },
          {
            "lineNumber": 720,
            "text": "\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();"
          },
          {
            "lineNumber": 721,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 722
          },
          {
            "lineNumber": 723,
            "text": "\t\t\t// Redirect URLs by VINs to proper vehicle permalinks."
          },
          {
            "lineNumber": 724,
            "text": "\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {"
          },
          {
            "lineNumber": 725,
            "text": "\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();"
          }
        ],
        "range": {
          "endPosition": {
            "line": 725
          },
          "startPosition": {
            "line": 674
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.26691070199012756
    },
    {
      "codeBlock": {
        "contents": "\t\t * @return string\n\t\t */\n\t\tprotected function adf_vehicle_xml() {\n\t\t\t$form_post_id = intval( $_POST['wpforms']['id'] ?? '' );\n\t\t\t$fields       = wpforms_get_form_fields( $form_post_id );\n\n\t\t\t$field_id = 0;\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\tif ( 'vehicle' !== $field['type'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$field_id = $field['id'];\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( 0 === $field_id ) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t$value   = sanitize_text_field( wp_unslash( $_POST['wpforms']['fields'][ $field_id ] ?? '' ) );\n\t\t\t$post_id = $this-\u003eextract_post_id_from_value( $value );\n\n\t\t\tif ( empty( $post_id ) ) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t'\u003cvehicle\u003e\u003cid\u003e%s\u003c/id\u003e\u003cyear\u003e%s\u003c/year\u003e\u003cmake\u003e%s\u003c/make\u003e\u003cmodel\u003e%s\u003c/model\u003e\u003cvin\u003e%s\u003c/vin\u003e\u003cstock\u003e%s\u003c/stock\u003e\u003c/vehicle\u003e',\n\t\t\t\tINVP::get_meta( 'car_id', $post_id ),\n\t\t\t\tinvp_get_the_year( $post_id ),\n\t\t\t\tinvp_get_the_make( $post_id ),\n\t\t\t\tinvp_get_the_model( $post_id ),\n\t\t\t\tinvp_get_the_vin( $post_id ),\n\t\t\t\tinvp_get_the_stock_number( $post_id )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Register Smart Tags with the form builder.\n\t\t *\n\t\t * @link   https://wpforms.com/developers/how-to-create-a-custom-smart-tag/\n\t\t *\n\t\t * @param  array $tags\n\t\t * @return array\n\t\t */\n\t\tpublic function smart_tags_register( $tags ) {\n\t\t\t// Key is the tag, item is the tag name.\n\t\t\tforeach ( $this-\u003etags() as $tag =\u003e $name ) {\n\t\t\t\t$tags[ $tag ] = $name;\n\t\t\t}\n\t\t\treturn $tags;\n\t\t}\n\n\t\t/**\n\t\t * Process the Smart Tags when rendering entries.\n\t\t *\n\t\t * @link   https://wpforms.com/developers/how-to-create-a-custom-smart-tag/\n\t\t */\n\t\tpublic function smart_tags_process( $content, $tag ) {\n\t\t\t$our_tags = array_keys( $this-\u003etags() );\n\t\t\tif ( ! in_array( $tag, $our_tags, true ) ) {\n\t\t\t\treturn $content;\n\t\t\t}\n\t\t\tswitch ( $tag ) {\n\t\t\t\tcase 'invp_adf_vehicle':\n\t\t\t\t\t$content = str_replace( '{invp_adf_vehicle}', $this-\u003eadf_vehicle_xml(), $content );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'invp_site_url':\n\t\t\t\t\t$content = str_replace( '{invp_site_url}', site_url(), $content );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $content;\n\t\t}\n\n\t\t/**\n\t\t * Returns an array of WP Forms Smart Tags we support.",
        "detailedLines": [
          {
            "lineNumber": 47,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 48,
            "text": "\t\t */"
          },
          {
            "lineNumber": 49,
            "text": "\t\tprotected function adf_vehicle_xml() {"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t$form_post_id = intval( $_POST['wpforms']['id'] ?? '' );"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t$fields       = wpforms_get_form_fields( $form_post_id );"
          },
          {
            "lineNumber": 52
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t$field_id = 0;"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\tforeach ( $fields as $field ) {"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\t\tif ( 'vehicle' !== $field['type'] ) {"
          },
          {
            "lineNumber": 56,
            "text": "\t\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 57,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t\t$field_id = $field['id'];"
          },
          {
            "lineNumber": 59,
            "text": "\t\t\t\tbreak;"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 61
          },
          {
            "lineNumber": 62,
            "text": "\t\t\tif ( 0 === $field_id ) {"
          },
          {
            "lineNumber": 63,
            "text": "\t\t\t\treturn '';"
          },
          {
            "lineNumber": 64,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 65
          },
          {
            "lineNumber": 66,
            "text": "\t\t\t$value   = sanitize_text_field( wp_unslash( $_POST['wpforms']['fields'][ $field_id ] ?? '' ) );"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t$post_id = $this-\u003eextract_post_id_from_value( $value );"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( empty( $post_id ) ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn '';"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\treturn sprintf("
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t\t'\u003cvehicle\u003e\u003cid\u003e%s\u003c/id\u003e\u003cyear\u003e%s\u003c/year\u003e\u003cmake\u003e%s\u003c/make\u003e\u003cmodel\u003e%s\u003c/model\u003e\u003cvin\u003e%s\u003c/vin\u003e\u003cstock\u003e%s\u003c/stock\u003e\u003c/vehicle\u003e',"
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t\tINVP::get_meta( 'car_id', $post_id ),"
          },
          {
            "lineNumber": 75,
            "text": "\t\t\t\tinvp_get_the_year( $post_id ),"
          },
          {
            "lineNumber": 76,
            "text": "\t\t\t\tinvp_get_the_make( $post_id ),"
          },
          {
            "lineNumber": 77,
            "text": "\t\t\t\tinvp_get_the_model( $post_id ),"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t\tinvp_get_the_vin( $post_id ),"
          },
          {
            "lineNumber": 79,
            "text": "\t\t\t\tinvp_get_the_stock_number( $post_id )"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 81,
            "text": "\t\t}"
          },
          {
            "lineNumber": 82
          },
          {
            "lineNumber": 83,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 84,
            "text": "\t\t * Register Smart Tags with the form builder."
          },
          {
            "lineNumber": 85,
            "text": "\t\t *"
          },
          {
            "lineNumber": 86,
            "text": "\t\t * @link   https://wpforms.com/developers/how-to-create-a-custom-smart-tag/"
          },
          {
            "lineNumber": 87,
            "text": "\t\t *"
          },
          {
            "lineNumber": 88,
            "text": "\t\t * @param  array $tags"
          },
          {
            "lineNumber": 89,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 90,
            "text": "\t\t */"
          },
          {
            "lineNumber": 91,
            "text": "\t\tpublic function smart_tags_register( $tags ) {"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t// Key is the tag, item is the tag name."
          },
          {
            "lineNumber": 93,
            "text": "\t\t\tforeach ( $this-\u003etags() as $tag =\u003e $name ) {"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t\t$tags[ $tag ] = $name;"
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 96,
            "text": "\t\t\treturn $tags;"
          },
          {
            "lineNumber": 97,
            "text": "\t\t}"
          },
          {
            "lineNumber": 98
          },
          {
            "lineNumber": 99,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 100,
            "text": "\t\t * Process the Smart Tags when rendering entries."
          },
          {
            "lineNumber": 101,
            "text": "\t\t *"
          },
          {
            "lineNumber": 102,
            "text": "\t\t * @link   https://wpforms.com/developers/how-to-create-a-custom-smart-tag/"
          },
          {
            "lineNumber": 103,
            "text": "\t\t */"
          },
          {
            "lineNumber": 104,
            "text": "\t\tpublic function smart_tags_process( $content, $tag ) {"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t$our_tags = array_keys( $this-\u003etags() );"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\tif ( ! in_array( $tag, $our_tags, true ) ) {"
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t\treturn $content;"
          },
          {
            "lineNumber": 108,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\tswitch ( $tag ) {"
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t\tcase 'invp_adf_vehicle':"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\t\t\t$content = str_replace( '{invp_adf_vehicle}', $this-\u003eadf_vehicle_xml(), $content );"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t\tcase 'invp_site_url':"
          },
          {
            "lineNumber": 114,
            "text": "\t\t\t\t\t$content = str_replace( '{invp_site_url}', site_url(), $content );"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\treturn $content;"
          },
          {
            "lineNumber": 118,
            "text": "\t\t}"
          },
          {
            "lineNumber": 119
          },
          {
            "lineNumber": 120,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 121,
            "text": "\t\t * Returns an array of WP Forms Smart Tags we support."
          }
        ],
        "range": {
          "endPosition": {
            "line": 121
          },
          "startPosition": {
            "line": 46
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-wpforms.php",
        "signatures": {}
      },
      "score": 0.2650744318962097
    },
    {
      "codeBlock": {
        "contents": "\t\t * @return string\n\t\t */\n\t\tprotected function create_option_label( $post_id ) {\n\t\t\treturn sprintf(\n\t\t\t\t'%s %s %s %s, %s, #%s',\n\t\t\t\tinvp_get_the_year( $post_id ),\n\t\t\t\tinvp_get_the_make( $post_id ),\n\t\t\t\tinvp_get_the_model( $post_id ),\n\t\t\t\tinvp_get_the_trim( $post_id ),\n\t\t\t\tinvp_get_the_color( $post_id ),\n\t\t\t\tinvp_get_the_stock_number( $post_id )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Takes a vehicle post ID, returns a string like \"2016 Toyota Corolla L,\n\t\t * P03013\"\n\t\t *\n\t\t * @param  int $post_id Vehicle post ID.\n\t\t * @return string\n\t\t */\n\t\tprotected function create_option_value( $post_id ) {\n\t\t\treturn sprintf(\n\t\t\t\t'%s %s %s %s, %s',\n\t\t\t\tinvp_get_the_year( $post_id ),\n\t\t\t\tinvp_get_the_make( $post_id ),\n\t\t\t\tinvp_get_the_model( $post_id ),\n\t\t\t\tinvp_get_the_trim( $post_id ),\n\t\t\t\tinvp_get_the_stock_number( $post_id )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Get the post IDs of vehicles sorted by year, then make, then model.\n\t\t *\n\t\t * @return array\n\t\t */\n\t\tprotected function get_vehicle_post_ids() {\n\t\t\tglobal $wpdb;\n\t\t\treturn $wpdb-\u003eget_col(\n\t\t\t\t$wpdb-\u003eprepare(\n\t\t\t\t\t\"\n\t\t\t\t\tSELECT \t\tID\n\n\t\t\t\t\tFROM\t\t$wpdb-\u003eposts\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id\n\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id\n\n\t\t\t\t\tWHERE \t\tpost_type = %s\n\t\t\t\t\t\t\t\tAND post_status = 'publish'\n\t\t\t\t\t\t\t\tAND meta1.meta_key = %s\n\t\t\t\t\t\t\t\tAND meta2.meta_key = %s\n\t\t\t\t\t\t\t\tAND meta3.meta_key = %s\n\n\t\t\t\t\tORDER BY\tmeta1.meta_value DESC,\n\t\t\t\t\t\t\t\tmeta2.meta_value ASC,\n\t\t\t\t\t\t\t\tmeta3.meta_value ASC;\n\t\t\t\t\",\n\t\t\t\t\tINVP::POST_TYPE,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Form frontend CSS enqueues.\n\t\t *\n\t\t * @since 1.6.1\n\t\t *\n\t\t * @param array $forms Forms on the current page.\n\t\t */\n\t\tpublic function enqueue_frontend_css( $forms ) {\n\n\t\t\t$has_modern_select = false;\n\n\t\t\tforeach ( $forms as $form ) {\n\t\t\t\t",
        "detailedLines": [
          {
            "lineNumber": 571,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 572,
            "text": "\t\t */"
          },
          {
            "lineNumber": 573,
            "text": "\t\tprotected function create_option_label( $post_id ) {"
          },
          {
            "lineNumber": 574,
            "text": "\t\t\treturn sprintf("
          },
          {
            "lineNumber": 575,
            "text": "\t\t\t\t'%s %s %s %s, %s, #%s',"
          },
          {
            "lineNumber": 576,
            "text": "\t\t\t\tinvp_get_the_year( $post_id ),"
          },
          {
            "lineNumber": 577,
            "text": "\t\t\t\tinvp_get_the_make( $post_id ),"
          },
          {
            "lineNumber": 578,
            "text": "\t\t\t\tinvp_get_the_model( $post_id ),"
          },
          {
            "lineNumber": 579,
            "text": "\t\t\t\tinvp_get_the_trim( $post_id ),"
          },
          {
            "lineNumber": 580,
            "text": "\t\t\t\tinvp_get_the_color( $post_id ),"
          },
          {
            "lineNumber": 581,
            "text": "\t\t\t\tinvp_get_the_stock_number( $post_id )"
          },
          {
            "lineNumber": 582,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 583,
            "text": "\t\t}"
          },
          {
            "lineNumber": 584
          },
          {
            "lineNumber": 585,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 586,
            "text": "\t\t * Takes a vehicle post ID, returns a string like \"2016 Toyota Corolla L,"
          },
          {
            "lineNumber": 587,
            "text": "\t\t * P03013\""
          },
          {
            "lineNumber": 588,
            "text": "\t\t *"
          },
          {
            "lineNumber": 589,
            "text": "\t\t * @param  int $post_id Vehicle post ID."
          },
          {
            "lineNumber": 590,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 591,
            "text": "\t\t */"
          },
          {
            "lineNumber": 592,
            "text": "\t\tprotected function create_option_value( $post_id ) {"
          },
          {
            "lineNumber": 593,
            "text": "\t\t\treturn sprintf("
          },
          {
            "lineNumber": 594,
            "text": "\t\t\t\t'%s %s %s %s, %s',"
          },
          {
            "lineNumber": 595,
            "text": "\t\t\t\tinvp_get_the_year( $post_id ),"
          },
          {
            "lineNumber": 596,
            "text": "\t\t\t\tinvp_get_the_make( $post_id ),"
          },
          {
            "lineNumber": 597,
            "text": "\t\t\t\tinvp_get_the_model( $post_id ),"
          },
          {
            "lineNumber": 598,
            "text": "\t\t\t\tinvp_get_the_trim( $post_id ),"
          },
          {
            "lineNumber": 599,
            "text": "\t\t\t\tinvp_get_the_stock_number( $post_id )"
          },
          {
            "lineNumber": 600,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 601,
            "text": "\t\t}"
          },
          {
            "lineNumber": 602
          },
          {
            "lineNumber": 603,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 604,
            "text": "\t\t * Get the post IDs of vehicles sorted by year, then make, then model."
          },
          {
            "lineNumber": 605,
            "text": "\t\t *"
          },
          {
            "lineNumber": 606,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 607,
            "text": "\t\t */"
          },
          {
            "lineNumber": 608,
            "text": "\t\tprotected function get_vehicle_post_ids() {"
          },
          {
            "lineNumber": 609,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 610,
            "text": "\t\t\treturn $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 611,
            "text": "\t\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 612,
            "text": "\t\t\t\t\t\""
          },
          {
            "lineNumber": 613,
            "text": "\t\t\t\t\tSELECT \t\tID"
          },
          {
            "lineNumber": 614
          },
          {
            "lineNumber": 615,
            "text": "\t\t\t\t\tFROM\t\t$wpdb-\u003eposts"
          },
          {
            "lineNumber": 616,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id"
          },
          {
            "lineNumber": 617,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id"
          },
          {
            "lineNumber": 618,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id"
          },
          {
            "lineNumber": 619
          },
          {
            "lineNumber": 620,
            "text": "\t\t\t\t\tWHERE \t\tpost_type = %s"
          },
          {
            "lineNumber": 621,
            "text": "\t\t\t\t\t\t\t\tAND post_status = 'publish'"
          },
          {
            "lineNumber": 622,
            "text": "\t\t\t\t\t\t\t\tAND meta1.meta_key = %s"
          },
          {
            "lineNumber": 623,
            "text": "\t\t\t\t\t\t\t\tAND meta2.meta_key = %s"
          },
          {
            "lineNumber": 624,
            "text": "\t\t\t\t\t\t\t\tAND meta3.meta_key = %s"
          },
          {
            "lineNumber": 625
          },
          {
            "lineNumber": 626,
            "text": "\t\t\t\t\tORDER BY\tmeta1.meta_value DESC,"
          },
          {
            "lineNumber": 627,
            "text": "\t\t\t\t\t\t\t\tmeta2.meta_value ASC,"
          },
          {
            "lineNumber": 628,
            "text": "\t\t\t\t\t\t\t\tmeta3.meta_value ASC;"
          },
          {
            "lineNumber": 629,
            "text": "\t\t\t\t\","
          },
          {
            "lineNumber": 630,
            "text": "\t\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 631,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 632,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 633,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 634,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 635,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 636,
            "text": "\t\t}"
          },
          {
            "lineNumber": 637
          },
          {
            "lineNumber": 638,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 639,
            "text": "\t\t * Form frontend CSS enqueues."
          },
          {
            "lineNumber": 640,
            "text": "\t\t *"
          },
          {
            "lineNumber": 641,
            "text": "\t\t * @since 1.6.1"
          },
          {
            "lineNumber": 642,
            "text": "\t\t *"
          },
          {
            "lineNumber": 643,
            "text": "\t\t * @param array $forms Forms on the current page."
          },
          {
            "lineNumber": 644,
            "text": "\t\t */"
          },
          {
            "lineNumber": 645,
            "text": "\t\tpublic function enqueue_frontend_css( $forms ) {"
          },
          {
            "lineNumber": 646
          },
          {
            "lineNumber": 647,
            "text": "\t\t\t$has_modern_select = false;"
          },
          {
            "lineNumber": 648
          },
          {
            "lineNumber": 649,
            "text": "\t\t\tforeach ( $forms as $form ) {"
          },
          {
            "lineNumber": 650,
            "text": "\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 4,
            "line": 649
          },
          "startPosition": {
            "line": 570
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-wpforms-field-vehicle.php",
        "signatures": {}
      },
      "score": 0.2614513635635376
    },
    {
      "codeBlock": {
        "contents": "* [Added] Adds meta fields to hold EPA Fuel Economy stats &#96;fuel_economy_annual_consumption&#96;, &#96;fuel_economy_annual_cost&#96;, &#96;fuel_economy_annual_emissions&#96;, &#96;fuel_economy_city&#96;, &#96;fuel_economy_combined&#96;, and &#96;fuel_economy_highway&#96;.\n* [Changed] No longer stores vehicle options as a serialized array in a meta field &#96;option_array&#96;.\n* [Added] A new meta field &#96;options&#96; contains a CSV string of vehicle options.\n* [Changed] No longer stores the vehicle description in post_content of the custom post type. This breaking change must occur so that we can being using the editor blocks provided by this plugin to define the appearance of posts regardless of a site's theme.\n* [Added] A new meta field &#96;description&#96; holds the sentence-form vehicle description.\n* [Fixed] Fixes a bug that prevented Attachments from being deleted when Vehicles were deleted.\n* [Fixed] Fixes a bug in the EPA Fuel Economy widget that prevents the entire widget from showing if a critical stat like the city or highway mileage is missing.\n* [Changed] Changes the dashboard \"all\" link from Inventory to All Vehicles\n\n= 10.13.0 =\n* [Added] Adds a public method to the additional listings class to make it easier for other plugins to modify queries to satisfy additional listings filter rules.\n\n= 10.12.1 =\n* [Fixed] Fixes a bug when injecting stock numbers into Carfax icon CSS class names where characters that are allowed in stock numbers but not in CSS class names were breaking this hack that lets us show more than one Carfax icon inline on the same page.\n\n= 10.12.0 =\n* [Added] Builds on a the feature launched in 10.11.0 to allow more than additional listing page to be created. Creates a table to manage additional listing page rules on the options page.\n* [Fixed] Fixes a bug in our Vehicle class where requesting a list of the post meta keys without the ones that contain serialized values returned those very keys that contain serialized values.\n\n= 10.11.1 =\n* [Fixed] Fixes a bug where our post meta keys for both vehicles and photos were being registered on the vehicle post type instead of on our post type and on the post type 'attachment'.\n\n= 10.11.0 =\n* [Added] Adds the ability to create a second inventory listing page with a vehicle attribute filter. This new feature makes it easy to create a separate listing page containing only vehicles that have a value for down payment or a boat field like hull material.",
        "detailedLines": [
          {
            "lineNumber": 488,
            "text": "* [Added] Adds meta fields to hold EPA Fuel Economy stats &#96;fuel_economy_annual_consumption&#96;, &#96;fuel_economy_annual_cost&#96;, &#96;fuel_economy_annual_emissions&#96;, &#96;fuel_economy_city&#96;, &#96;fuel_economy_combined&#96;, and &#96;fuel_economy_highway&#96;."
          },
          {
            "lineNumber": 489,
            "text": "* [Changed] No longer stores vehicle options as a serialized array in a meta field &#96;option_array&#96;."
          },
          {
            "lineNumber": 490,
            "text": "* [Added] A new meta field &#96;options&#96; contains a CSV string of vehicle options."
          },
          {
            "lineNumber": 491,
            "text": "* [Changed] No longer stores the vehicle description in post_content of the custom post type. This breaking change must occur so that we can being using the editor blocks provided by this plugin to define the appearance of posts regardless of a site's theme."
          },
          {
            "lineNumber": 492,
            "text": "* [Added] A new meta field &#96;description&#96; holds the sentence-form vehicle description."
          },
          {
            "lineNumber": 493,
            "text": "* [Fixed] Fixes a bug that prevented Attachments from being deleted when Vehicles were deleted."
          },
          {
            "lineNumber": 494,
            "text": "* [Fixed] Fixes a bug in the EPA Fuel Economy widget that prevents the entire widget from showing if a critical stat like the city or highway mileage is missing."
          },
          {
            "lineNumber": 495,
            "text": "* [Changed] Changes the dashboard \"all\" link from Inventory to All Vehicles"
          },
          {
            "lineNumber": 496
          },
          {
            "lineNumber": 497,
            "text": "= 10.13.0 ="
          },
          {
            "lineNumber": 498,
            "text": "* [Added] Adds a public method to the additional listings class to make it easier for other plugins to modify queries to satisfy additional listings filter rules."
          },
          {
            "lineNumber": 499
          },
          {
            "lineNumber": 500,
            "text": "= 10.12.1 ="
          },
          {
            "lineNumber": 501,
            "text": "* [Fixed] Fixes a bug when injecting stock numbers into Carfax icon CSS class names where characters that are allowed in stock numbers but not in CSS class names were breaking this hack that lets us show more than one Carfax icon inline on the same page."
          },
          {
            "lineNumber": 502
          },
          {
            "lineNumber": 503,
            "text": "= 10.12.0 ="
          },
          {
            "lineNumber": 504,
            "text": "* [Added] Builds on a the feature launched in 10.11.0 to allow more than additional listing page to be created. Creates a table to manage additional listing page rules on the options page."
          },
          {
            "lineNumber": 505,
            "text": "* [Fixed] Fixes a bug in our Vehicle class where requesting a list of the post meta keys without the ones that contain serialized values returned those very keys that contain serialized values."
          },
          {
            "lineNumber": 506
          },
          {
            "lineNumber": 507,
            "text": "= 10.11.1 ="
          },
          {
            "lineNumber": 508,
            "text": "* [Fixed] Fixes a bug where our post meta keys for both vehicles and photos were being registered on the vehicle post type instead of on our post type and on the post type 'attachment'."
          },
          {
            "lineNumber": 509
          },
          {
            "lineNumber": 510,
            "text": "= 10.11.0 ="
          },
          {
            "lineNumber": 511,
            "text": "* [Added] Adds the ability to create a second inventory listing page with a vehicle attribute filter. This new feature makes it easy to create a separate listing page containing only vehicles that have a value for down payment or a boat field like hull material."
          }
        ],
        "range": {
          "endPosition": {
            "line": 511
          },
          "startPosition": {
            "line": 487
          }
        },
        "relativeWorkspacePath": "./changelog.txt",
        "signatures": {}
      },
      "score": 0.2607615888118744
    },
    {
      "codeBlock": {
        "contents": "\t\t\t$post_ids = $wpdb-\u003eget_col(\n\t\t\t\t$wpdb-\u003eprepare(\n\t\t\t\t\t\"\n\t\t\t\tSELECT \t\tDISTINCT ID\n\t\t\t\tFROM\t\t$wpdb-\u003eposts\n\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id\n\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id\n\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id\n\t\t\t\tWHERE \t\tpost_type = %s\n\t\t\t\t\t\t\tAND post_status = 'publish'\n\t\t\t\t\t\t\tAND meta1.meta_key = %s\n\t\t\t\t\t\t\tAND meta2.meta_key = %s\n\t\t\t\t\t\t\tAND meta3.meta_key = %s\n\t\t\t\tORDER BY\tmeta1.meta_value DESC,\n\t\t\t\t\t\t\tmeta2.meta_value ASC,\n\t\t\t\t\t\t\tmeta3.meta_value ASC\n\t\t\t\t\",\n\t\t\t\t\tINVP::POST_TYPE,\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),\n\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// no results? no HTML.\n\t\t\tif ( empty( $post_ids ) ) {\n\t\t\t\treturn apply_filters( 'invp_cf7_field_vehicle_html', '' . $validation_error, $atts );\n\t\t\t}\n\n\t\t\t// build a drop down select.\n\t\t\t$select_atts = array(\n\t\t\t\t'name'  =\u003e $tag-\u003ename,\n\t\t\t\t'class' =\u003e wpcf7_form_controls_class( 'select' ),\n\t\t\t);\n\t\t\tif ( ! empty( $atts['id'] ) ) {\n\t\t\t\t$select_atts['id'] = $atts['id'];\n\t\t\t}\n\t\t\t$html = sprintf(\n\t\t\t\t'\u003cspan class=\"wpcf7-form-control-wrap\" data-name=\"%s\"\u003e\u003cselect %s\u003e\u003coption value=\"\"\u003e%s\u003c/option\u003e',\n\t\t\t\tesc_attr( $tag-\u003ename ),\n\t\t\t\twpcf7_format_atts( $select_atts ),\n\t\t\t\t__( 'Please choose a vehicle...', 'inventory-presser' )\n\t\t\t);\n\t\t\tforeach ( $post_ids as $post_id ) {\n\t\t\t\t// is this vehicle sold?",
        "detailedLines": [
          {
            "lineNumber": 268,
            "text": "\t\t\t$post_ids = $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\t\t\""
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\tSELECT \t\tDISTINCT ID"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\tFROM\t\t$wpdb-\u003eposts"
          },
          {
            "lineNumber": 273,
            "text": "\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id"
          },
          {
            "lineNumber": 274,
            "text": "\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id"
          },
          {
            "lineNumber": 275,
            "text": "\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id"
          },
          {
            "lineNumber": 276,
            "text": "\t\t\t\tWHERE \t\tpost_type = %s"
          },
          {
            "lineNumber": 277,
            "text": "\t\t\t\t\t\t\tAND post_status = 'publish'"
          },
          {
            "lineNumber": 278,
            "text": "\t\t\t\t\t\t\tAND meta1.meta_key = %s"
          },
          {
            "lineNumber": 279,
            "text": "\t\t\t\t\t\t\tAND meta2.meta_key = %s"
          },
          {
            "lineNumber": 280,
            "text": "\t\t\t\t\t\t\tAND meta3.meta_key = %s"
          },
          {
            "lineNumber": 281,
            "text": "\t\t\t\tORDER BY\tmeta1.meta_value DESC,"
          },
          {
            "lineNumber": 282,
            "text": "\t\t\t\t\t\t\tmeta2.meta_value ASC,"
          },
          {
            "lineNumber": 283,
            "text": "\t\t\t\t\t\t\tmeta3.meta_value ASC"
          },
          {
            "lineNumber": 284,
            "text": "\t\t\t\t\","
          },
          {
            "lineNumber": 285,
            "text": "\t\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 286,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 287,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 288,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' )"
          },
          {
            "lineNumber": 289,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 290,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 291
          },
          {
            "lineNumber": 292,
            "text": "\t\t\t// no results? no HTML."
          },
          {
            "lineNumber": 293,
            "text": "\t\t\tif ( empty( $post_ids ) ) {"
          },
          {
            "lineNumber": 294,
            "text": "\t\t\t\treturn apply_filters( 'invp_cf7_field_vehicle_html', '' . $validation_error, $atts );"
          },
          {
            "lineNumber": 295,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 296
          },
          {
            "lineNumber": 297,
            "text": "\t\t\t// build a drop down select."
          },
          {
            "lineNumber": 298,
            "text": "\t\t\t$select_atts = array("
          },
          {
            "lineNumber": 299,
            "text": "\t\t\t\t'name'  =\u003e $tag-\u003ename,"
          },
          {
            "lineNumber": 300,
            "text": "\t\t\t\t'class' =\u003e wpcf7_form_controls_class( 'select' ),"
          },
          {
            "lineNumber": 301,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 302,
            "text": "\t\t\tif ( ! empty( $atts['id'] ) ) {"
          },
          {
            "lineNumber": 303,
            "text": "\t\t\t\t$select_atts['id'] = $atts['id'];"
          },
          {
            "lineNumber": 304,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 305,
            "text": "\t\t\t$html = sprintf("
          },
          {
            "lineNumber": 306,
            "text": "\t\t\t\t'\u003cspan class=\"wpcf7-form-control-wrap\" data-name=\"%s\"\u003e\u003cselect %s\u003e\u003coption value=\"\"\u003e%s\u003c/option\u003e',"
          },
          {
            "lineNumber": 307,
            "text": "\t\t\t\tesc_attr( $tag-\u003ename ),"
          },
          {
            "lineNumber": 308,
            "text": "\t\t\t\twpcf7_format_atts( $select_atts ),"
          },
          {
            "lineNumber": 309,
            "text": "\t\t\t\t__( 'Please choose a vehicle...', 'inventory-presser' )"
          },
          {
            "lineNumber": 310,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 311,
            "text": "\t\t\tforeach ( $post_ids as $post_id ) {"
          },
          {
            "lineNumber": 312,
            "text": "\t\t\t\t// is this vehicle sold?"
          }
        ],
        "range": {
          "endPosition": {
            "line": 312
          },
          "startPosition": {
            "line": 267
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-contact-form-7.php",
        "signatures": {}
      },
      "score": 0.2601217031478882
    },
    {
      "codeBlock": {
        "contents": "public static function load_sample_vehicles() {\n\t\t$response = wp_remote_get( 'https://demo.inventorypresser.com/wp-json/wp/v2/inventory?orderby=rand' );\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$vehicles = json_decode( wp_remote_retrieve_body( $response ) );\n\t\tshuffle( $vehicles );\n\t\t$current_user_id = wp_get_current_user()-\u003eID;\n\n\t\t// Do not insert duplicates.\n\t\tglobal $wpdb;\n\t\t/**\n\t\t * Each photo has a VIN meta key, so this might return hundreds of\n\t\t * duplicate VINs on just a few vehicles with double digit photos each.\n\t\t */\n\t\t$current_vins = $wpdb-\u003eget_col(\n\t\t\t$wpdb-\u003eprepare(\n\t\t\t\t\"SELECT DISTINCT meta_value FROM $wpdb-\u003epostmeta WHERE meta_key = %s\",\n\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'vin' )\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $vehicles as $vehicle ) {\n\n\t\t\t// Obscure 17 digit VINs.\n\t\t\t$vin = '';\n\t\t\tif ( 17 === strlen( $vehicle-\u003emeta-\u003einventory_presser_vin ) ) {\n\t\t\t\t$vin                                  = $vehicle-\u003emeta-\u003einventory_presser_vin;\n\t\t\t\t$vehicle-\u003emeta-\u003einventory_presser_vin = substr( $vehicle-\u003emeta-\u003einventory_presser_vin, 0, 10 ) . 'EXAMPLE';\n\t\t\t}\n\n\t\t\t// Is this VIN already in inventory?\n\t\t\tif ( in_array( $vehicle-\u003emeta-\u003einventory_presser_vin, $current_vins, true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$options = $vehicle-\u003emeta-\u003einventory_presser_options_array;\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_options_array );\n\t\t\t// Remove dealer-specific data.\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_accident_free );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_one_owner );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_top_condition );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_report );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_dealer_id );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_leads_id );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_location );\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_nextgear_inspection_url );\n\n\t\t\t$post = array(\n\t\t\t\t'post_author'       =\u003e $current_user_id,",
        "detailedLines": [
          {
            "lineNumber": 976,
            "text": "public static function load_sample_vehicles() {"
          },
          {
            "lineNumber": 977,
            "text": "\t\t$response = wp_remote_get( 'https://demo.inventorypresser.com/wp-json/wp/v2/inventory?orderby=rand' );"
          },
          {
            "lineNumber": 978,
            "text": "\t\tif ( is_wp_error( $response ) ) {"
          },
          {
            "lineNumber": 979,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 980,
            "text": "\t\t}"
          },
          {
            "lineNumber": 981,
            "text": "\t\t$vehicles = json_decode( wp_remote_retrieve_body( $response ) );"
          },
          {
            "lineNumber": 982,
            "text": "\t\tshuffle( $vehicles );"
          },
          {
            "lineNumber": 983,
            "text": "\t\t$current_user_id = wp_get_current_user()-\u003eID;"
          },
          {
            "lineNumber": 984
          },
          {
            "lineNumber": 985,
            "text": "\t\t// Do not insert duplicates."
          },
          {
            "lineNumber": 986,
            "text": "\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 987,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 988,
            "text": "\t\t * Each photo has a VIN meta key, so this might return hundreds of"
          },
          {
            "lineNumber": 989,
            "text": "\t\t * duplicate VINs on just a few vehicles with double digit photos each."
          },
          {
            "lineNumber": 990,
            "text": "\t\t */"
          },
          {
            "lineNumber": 991,
            "text": "\t\t$current_vins = $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 992,
            "text": "\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 993,
            "text": "\t\t\t\t\"SELECT DISTINCT meta_value FROM $wpdb-\u003epostmeta WHERE meta_key = %s\","
          },
          {
            "lineNumber": 994,
            "text": "\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'vin' )"
          },
          {
            "lineNumber": 995,
            "text": "\t\t\t)"
          },
          {
            "lineNumber": 996,
            "text": "\t\t);"
          },
          {
            "lineNumber": 997
          },
          {
            "lineNumber": 998,
            "text": "\t\tforeach ( $vehicles as $vehicle ) {"
          },
          {
            "lineNumber": 999
          },
          {
            "lineNumber": 1000,
            "text": "\t\t\t// Obscure 17 digit VINs."
          },
          {
            "lineNumber": 1001,
            "text": "\t\t\t$vin = '';"
          },
          {
            "lineNumber": 1002,
            "text": "\t\t\tif ( 17 === strlen( $vehicle-\u003emeta-\u003einventory_presser_vin ) ) {"
          },
          {
            "lineNumber": 1003,
            "text": "\t\t\t\t$vin                                  = $vehicle-\u003emeta-\u003einventory_presser_vin;"
          },
          {
            "lineNumber": 1004,
            "text": "\t\t\t\t$vehicle-\u003emeta-\u003einventory_presser_vin = substr( $vehicle-\u003emeta-\u003einventory_presser_vin, 0, 10 ) . 'EXAMPLE';"
          },
          {
            "lineNumber": 1005,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1006
          },
          {
            "lineNumber": 1007,
            "text": "\t\t\t// Is this VIN already in inventory?"
          },
          {
            "lineNumber": 1008,
            "text": "\t\t\tif ( in_array( $vehicle-\u003emeta-\u003einventory_presser_vin, $current_vins, true ) ) {"
          },
          {
            "lineNumber": 1009,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1010,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1011
          },
          {
            "lineNumber": 1012,
            "text": "\t\t\t$options = $vehicle-\u003emeta-\u003einventory_presser_options_array;"
          },
          {
            "lineNumber": 1013,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_options_array );"
          },
          {
            "lineNumber": 1014,
            "text": "\t\t\t// Remove dealer-specific data."
          },
          {
            "lineNumber": 1015,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon );"
          },
          {
            "lineNumber": 1016,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_accident_free );"
          },
          {
            "lineNumber": 1017,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_one_owner );"
          },
          {
            "lineNumber": 1018,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_top_condition );"
          },
          {
            "lineNumber": 1019,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_report );"
          },
          {
            "lineNumber": 1020,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_dealer_id );"
          },
          {
            "lineNumber": 1021,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_leads_id );"
          },
          {
            "lineNumber": 1022,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_location );"
          },
          {
            "lineNumber": 1023,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_nextgear_inspection_url );"
          },
          {
            "lineNumber": 1024
          },
          {
            "lineNumber": 1025,
            "text": "\t\t\t$post = array("
          },
          {
            "lineNumber": 1026,
            "text": "\t\t\t\t'post_author'       =\u003e $current_user_id,"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1026
          },
          "startPosition": {
            "column": 1,
            "line": 975
          }
        },
        "relativeWorkspacePath": "./includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.25921154022216797
    },
    {
      "codeBlock": {
        "contents": "\t * @return void\n\t */\n\tpublic function maintain_taxonomy_terms_during_meta_updates( $meta_id, $object_id, $meta_key, $meta_value ) {\n\t\t// Skip private meta keys like _edit_lock, _wp_trash_meta_status, _wp_trash_meta_time, etc.\n\t\tif ( '_' === $meta_key[0] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// These are the unprefixed meta keys that have overlapping taxonomies.\n\t\t$overlapping_keys = self::overlapping_meta_keys();\n\t\t// unprefix the meta key.\n\t\t$unprefixed = apply_filters( 'invp_unprefix_meta_key', $meta_key );\n\n\t\t// does $meta_key have a corresponding taxonomy?\n\t\tif ( ! in_array( $unprefixed, array_keys( $overlapping_keys ), true ) ) {\n\t\t\t// No.\n\t\t\treturn;\n\t\t}\n\n\t\t$taxonomy = $overlapping_keys[ $unprefixed ];\n\n\t\t/**\n\t\t * If we are in the Availability taxonomy, the end of this method\n\t\t * appends terms instead of replacing so that a vehicle can be both\n\t\t * For Sale and Wholesale. If the $meta_value is For Sale, Sold or Sale\n\t\t * Pending, we need to remove the other of these terms.\n\t\t */\n\t\tif ( 'availability' === strtolower( $unprefixed )\n\t\t\t\u0026\u0026 ! empty( $meta_value )\n\t\t\t\u0026\u0026 in_array( INVP::sluggify( $meta_value ), array( 'for-sale', 'sold', 'sale-pending' ), true )\n\t\t) {\n\t\t\t$remove_term_ids = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' =\u003e $taxonomy,\n\t\t\t\t\t'fields'   =\u003e 'ids',\n\t\t\t\t\t'slug'     =\u003e array_diff( array( 'for-sale', 'sold', 'sale-pending' ), array( INVP::sluggify( $meta_value ) ) ),\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this-\u003ehooks_remove();\n\t\t\twp_remove_object_terms( $object_id, $remove_term_ids, $taxonomy );\n\t\t\t$this-\u003ehooks_add();\n\t\t}\n\n\t\t// if $meta_value is empty or we have deleted a meta value, remove a term.\n\t\tglobal $action;\n\t\tif ( empty( $meta_value ) || 'delete-meta' === $action ) {\n\t\t\t// remove a term actually.\n\t\t\t$terms = array();",
        "detailedLines": [
          {
            "lineNumber": 185,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 186,
            "text": "\t */"
          },
          {
            "lineNumber": 187,
            "text": "\tpublic function maintain_taxonomy_terms_during_meta_updates( $meta_id, $object_id, $meta_key, $meta_value ) {"
          },
          {
            "lineNumber": 188,
            "text": "\t\t// Skip private meta keys like _edit_lock, _wp_trash_meta_status, _wp_trash_meta_time, etc."
          },
          {
            "lineNumber": 189,
            "text": "\t\tif ( '_' === $meta_key[0] ) {"
          },
          {
            "lineNumber": 190,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 191,
            "text": "\t\t}"
          },
          {
            "lineNumber": 192
          },
          {
            "lineNumber": 193,
            "text": "\t\t// These are the unprefixed meta keys that have overlapping taxonomies."
          },
          {
            "lineNumber": 194,
            "text": "\t\t$overlapping_keys = self::overlapping_meta_keys();"
          },
          {
            "lineNumber": 195,
            "text": "\t\t// unprefix the meta key."
          },
          {
            "lineNumber": 196,
            "text": "\t\t$unprefixed = apply_filters( 'invp_unprefix_meta_key', $meta_key );"
          },
          {
            "lineNumber": 197
          },
          {
            "lineNumber": 198,
            "text": "\t\t// does $meta_key have a corresponding taxonomy?"
          },
          {
            "lineNumber": 199,
            "text": "\t\tif ( ! in_array( $unprefixed, array_keys( $overlapping_keys ), true ) ) {"
          },
          {
            "lineNumber": 200,
            "text": "\t\t\t// No."
          },
          {
            "lineNumber": 201,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 202,
            "text": "\t\t}"
          },
          {
            "lineNumber": 203
          },
          {
            "lineNumber": 204,
            "text": "\t\t$taxonomy = $overlapping_keys[ $unprefixed ];"
          },
          {
            "lineNumber": 205
          },
          {
            "lineNumber": 206,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 207,
            "text": "\t\t * If we are in the Availability taxonomy, the end of this method"
          },
          {
            "lineNumber": 208,
            "text": "\t\t * appends terms instead of replacing so that a vehicle can be both"
          },
          {
            "lineNumber": 209,
            "text": "\t\t * For Sale and Wholesale. If the $meta_value is For Sale, Sold or Sale"
          },
          {
            "lineNumber": 210,
            "text": "\t\t * Pending, we need to remove the other of these terms."
          },
          {
            "lineNumber": 211,
            "text": "\t\t */"
          },
          {
            "lineNumber": 212,
            "text": "\t\tif ( 'availability' === strtolower( $unprefixed )"
          },
          {
            "lineNumber": 213,
            "text": "\t\t\t\u0026\u0026 ! empty( $meta_value )"
          },
          {
            "lineNumber": 214,
            "text": "\t\t\t\u0026\u0026 in_array( INVP::sluggify( $meta_value ), array( 'for-sale', 'sold', 'sale-pending' ), true )"
          },
          {
            "lineNumber": 215,
            "text": "\t\t) {"
          },
          {
            "lineNumber": 216,
            "text": "\t\t\t$remove_term_ids = get_terms("
          },
          {
            "lineNumber": 217,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 218,
            "text": "\t\t\t\t\t'taxonomy' =\u003e $taxonomy,"
          },
          {
            "lineNumber": 219,
            "text": "\t\t\t\t\t'fields'   =\u003e 'ids',"
          },
          {
            "lineNumber": 220,
            "text": "\t\t\t\t\t'slug'     =\u003e array_diff( array( 'for-sale', 'sold', 'sale-pending' ), array( INVP::sluggify( $meta_value ) ) ),"
          },
          {
            "lineNumber": 221,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 222,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 223,
            "text": "\t\t\t$this-\u003ehooks_remove();"
          },
          {
            "lineNumber": 224,
            "text": "\t\t\twp_remove_object_terms( $object_id, $remove_term_ids, $taxonomy );"
          },
          {
            "lineNumber": 225,
            "text": "\t\t\t$this-\u003ehooks_add();"
          },
          {
            "lineNumber": 226,
            "text": "\t\t}"
          },
          {
            "lineNumber": 227
          },
          {
            "lineNumber": 228,
            "text": "\t\t// if $meta_value is empty or we have deleted a meta value, remove a term."
          },
          {
            "lineNumber": 229,
            "text": "\t\tglobal $action;"
          },
          {
            "lineNumber": 230,
            "text": "\t\tif ( empty( $meta_value ) || 'delete-meta' === $action ) {"
          },
          {
            "lineNumber": 231,
            "text": "\t\t\t// remove a term actually."
          },
          {
            "lineNumber": 232,
            "text": "\t\t\t$terms = array();"
          }
        ],
        "range": {
          "endPosition": {
            "line": 232
          },
          "startPosition": {
            "line": 184
          }
        },
        "relativeWorkspacePath": "./includes/class-taxonomy-overlapper.php",
        "signatures": {}
      },
      "score": 0.2577042877674103
    }
  ]
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="semantic_search_full"><details>
<summary>Tool use: **semantic_search_full**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_


That behavior comes from the **Add Custom Fields to Search** class in `includes/class-add-custom-fields-to-search.php`.

It hooks into the main search query and includes vehicle meta fields (year, make, model, trim, etc.) in search by:

1. **`cf_search_join`** – adding a `LEFT JOIN` on `wp_postmeta` so meta values are available in the query.
2. **`cf_search_where`** – changing the `WHERE` clause so results can match either the post title or meta values via a `LIKE` condition.

That way searches like “Toyota Camry” or “2020 Honda” can match vehicles by their meta fields, not only by the post title.

---

_**User**_

does it already add every meta field? i forget

---

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-add-custom-fields-to-search.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

Yes. It searches across all post meta for each post. There’s no `meta_key` restriction.

The join is:

```74:74:includes/class-add-custom-fields-to-search.php
			$join .= " LEFT JOIN $wpdb->postmeta searchmeta ON $wpdb->posts.ID = searchmeta.post_id ";
```

So every postmeta row for a post is joined. The `WHERE` clause then checks `searchmeta.meta_value` against the search term, so any meta field that matches can return that post. `cf_search_distinct` adds `DISTINCT` so a post only appears once when several of its meta values match.

---

_**User**_

i'm seeing different results for the taxonomy term search /inventory/drive-type/awd/ and ?s=awd

the term relationship to AWD and the inventory_presser_drive_type field should be in sync, so what explains the discrepancy?

---

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Comparing search results**

I'm investigating why taxonomy term search and WordPress search return different results for the same field. I found that taxonomy search uses tax_query while WordPress search scans post_title and postmeta fields. I found that taxonomy and meta field searches may be out of sync, with potential discrepancies in vehicle data between taxonomy terms and meta field values. </details></think>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="semantic_search_full">
<details>
<summary>Tool use: **semantic_search_full**</summary>


Parameters:

```json
{
  "explanation": "",
  "includePattern": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "query": "Where does search query include vehicle post type or modify post_type for search?",
  "topK": 10
}
```
Result:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 64,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 65,
            "text": "\t\t */"
          },
          {
            "lineNumber": 66,
            "text": "\t\tpublic function cf_search_join( $join ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn $join;"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 72
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t// join to search post meta values like year, make, model, trim, etc."
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t$join .= \" LEFT JOIN $wpdb-\u003epostmeta searchmeta ON $wpdb-\u003eposts.ID = searchmeta.post_id \";"
          },
          {
            "lineNumber": 75,
            "text": "\t\t\treturn $join;"
          },
          {
            "lineNumber": 76,
            "text": "\t\t}"
          },
          {
            "lineNumber": 77
          },
          {
            "lineNumber": 78,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * Modify the search query with posts_where"
          },
          {
            "lineNumber": 80,
            "text": "\t\t *"
          },
          {
            "lineNumber": 81,
            "text": "\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where"
          },
          {
            "lineNumber": 82,
            "text": "\t\t *"
          },
          {
            "lineNumber": 83,
            "text": "\t\t * @param  string $where"
          },
          {
            "lineNumber": 84,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 85,
            "text": "\t\t */"
          },
          {
            "lineNumber": 86,
            "text": "\t\tpublic function cf_search_where( $where ) {"
          },
          {
            "lineNumber": 87
          },
          {
            "lineNumber": 88,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\treturn $where;"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 91
          },
          {
            "lineNumber": 92,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t$where = preg_replace("
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t\t\"/\\(\\s*$wpdb-\u003eposts.post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\","
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t\t\"($wpdb-\u003eposts.post_title LIKE $1) OR ( searchmeta.meta_value LIKE $1 ) \","
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t\t$where"
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 98
          },
          {
            "lineNumber": 99,
            "text": "\t\t\treturn $where;"
          },
          {
            "lineNumber": 100,
            "text": "\t\t}"
          },
          {
            "lineNumber": 101,
            "text": "\t}"
          },
          {
            "lineNumber": 102,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 102
          },
          "startPosition": {
            "line": 63
          }
        },
        "relativeWorkspacePath": "./includes/class-add-custom-fields-to-search.php",
        "signatures": {}
      },
      "score": 0.43764451146125793
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 75,
            "text": "\t\t\treturn null;"
          },
          {
            "lineNumber": 76,
            "text": "\t\t}"
          },
          {
            "lineNumber": 77
          },
          {
            "lineNumber": 78,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * Modifies the queries with the vehicle post type to include price and"
          },
          {
            "lineNumber": 80,
            "text": "\t\t * odometer ranges, if they're also provided."
          },
          {
            "lineNumber": 81,
            "text": "\t\t *"
          },
          {
            "lineNumber": 82,
            "text": "\t\t * @param  mixed $query"
          },
          {
            "lineNumber": 83,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 84,
            "text": "\t\t */"
          },
          {
            "lineNumber": 85,
            "text": "\t\tpublic static function modify_query_for_price_and_odometer_ranges( $query ) {"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t// Is this query for vehicles?"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\tif ( INVP::POST_TYPE !== $query-\u003eget( 'post_type', '' ) ) {"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 91
          },
          {
            "lineNumber": 92,
            "text": "\t\t\tif ( is_admin() ) {"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 95
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t// Only filter the main query unless an override filter."
          },
          {
            "lineNumber": 97,
            "text": "\t\t\tif ( ! $query-\u003eis_main_query() \u0026\u0026 apply_filters( 'invp_range_filters_main_query', true ) ) {"
          },
          {
            "lineNumber": 98,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 99,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 100
          },
          {
            "lineNumber": 101,
            "text": "\t\t\t// Is there a filter in the query string?"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\tif ( ! isset( $_GET['min_price'] )"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_price'] )"
          },
          {
            "lineNumber": 104,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['min_odometer'] )"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_odometer'] )"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['min_down'] )"
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t\t\u0026\u0026 ! isset( $_GET['max_down'] )"
          },
          {
            "lineNumber": 108,
            "text": "\t\t\t) {"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 112
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t// Get original meta query."
          },
          {
            "lineNumber": 114,
            "text": "\t\t\t$meta_query = $query-\u003eget( 'meta_query', array() );"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\tif ( ! is_array( $meta_query ) ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t$meta_query = array();"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t$meta_query['relation'] = 'AND';"
          },
          {
            "lineNumber": 120
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t// Price filters."
          },
          {
            "lineNumber": 122,
            "text": "\t\t\tif ( isset( $_GET['max_price'] ) ) {"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 125,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),"
          },
          {
            "lineNumber": 126,
            "text": "\t\t\t\t\t(int) $_GET['max_price'],"
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t\t\t'\u003c=',"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 131
          },
          {
            "lineNumber": 132,
            "text": "\t\t\tif ( isset( $_GET['min_price'] ) ) {"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 135,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'price' ),"
          },
          {
            "lineNumber": 136,
            "text": "\t\t\t\t\t(int) $_GET['min_price'],"
          },
          {
            "lineNumber": 137,
            "text": "\t\t\t\t\t'\u003e=',"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 141
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t// Odometer filters."
          },
          {
            "lineNumber": 143,
            "text": "\t\t\tif ( isset( $_GET['min_odometer'] ) ) {"
          },
          {
            "lineNumber": 144,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 145,
            "text": "\t\t\t\t\t$meta_query,"
          },
          {
            "lineNumber": 146,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'odometer' ),"
          },
          {
            "lineNumber": 147,
            "text": "\t\t\t\t\t(int) $_GET['min_odometer'],"
          },
          {
            "lineNumber": 148,
            "text": "\t\t\t\t\t'\u003e=',"
          },
          {
            "lineNumber": 149,
            "text": "\t\t\t\t\t'numeric'"
          },
          {
            "lineNumber": 150,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 151,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 152
          },
          {
            "lineNumber": 153,
            "text": "\t\t\tif ( isset( $_GET['max_odometer'] ) ) {"
          },
          {
            "lineNumber": 154,
            "text": "\t\t\t\t$meta_query = self::add_meta_query("
          },
          {
            "lineNumber": 155,
            "text": "\t\t\t\t\t$meta_query,"
          }
        ],
        "range": {
          "endPosition": {
            "line": 155
          },
          "startPosition": {
            "line": 74
          }
        },
        "relativeWorkspacePath": "./includes/class-range-filters.php",
        "signatures": {}
      },
      "score": 0.42081910371780396
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "if ( ! class_exists( 'Add_Custom_Fields_To_Search' ) ) {"
          },
          {
            "lineNumber": 5
          },
          {
            "lineNumber": 6,
            "text": "\t/**"
          },
          {
            "lineNumber": 7,
            "text": "\t * Add_Custom_Fields_To_Search"
          },
          {
            "lineNumber": 8,
            "text": "\t *"
          },
          {
            "lineNumber": 9,
            "text": "\t * An object that modifies the WordPress search query to include custom fields"
          },
          {
            "lineNumber": 10,
            "text": "\t *"
          },
          {
            "lineNumber": 11,
            "text": "\t * @see https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/"
          },
          {
            "lineNumber": 12,
            "text": "\t *"
          },
          {
            "lineNumber": 13,
            "text": "\t * @since      1.2.1"
          },
          {
            "lineNumber": 14,
            "text": "\t * @package    inventory-presser"
          },
          {
            "lineNumber": 15,
            "text": "\t * @subpackage inventory-presser/includes"
          },
          {
            "lineNumber": 16,
            "text": "\t * @author     Corey Salzano \u003ccorey@friday.systems\u003e, Adam Balee"
          },
          {
            "lineNumber": 17,
            "text": "\t */"
          },
          {
            "lineNumber": 18,
            "text": "\tclass Add_Custom_Fields_To_Search {"
          },
          {
            "lineNumber": 19
          },
          {
            "lineNumber": 20
          },
          {
            "lineNumber": 21,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 22,
            "text": "\t\t * Adds hooks"
          },
          {
            "lineNumber": 23,
            "text": "\t\t *"
          },
          {
            "lineNumber": 24,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 25,
            "text": "\t\t */"
          },
          {
            "lineNumber": 26,
            "text": "\t\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\tadd_filter( 'posts_distinct', array( $this, 'cf_search_distinct' ) );"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\tadd_filter( 'posts_join', array( $this, 'cf_search_join' ) );"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\tadd_filter( 'posts_where', array( $this, 'cf_search_where' ) );"
          },
          {
            "lineNumber": 30,
            "text": "\t\t}"
          },
          {
            "lineNumber": 31
          },
          {
            "lineNumber": 32,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 33,
            "text": "\t\t * Are we looking at the Media Library?"
          },
          {
            "lineNumber": 34,
            "text": "\t\t *"
          },
          {
            "lineNumber": 35,
            "text": "\t\t * @return bool"
          },
          {
            "lineNumber": 36,
            "text": "\t\t */"
          },
          {
            "lineNumber": 37,
            "text": "\t\tprotected function is_media_library() {"
          },
          {
            "lineNumber": 38,
            "text": "\t\t\treturn 'upload.php' === basename( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '' ) ), '?' . sanitize_text_field( wp_unslash( $_SERVER['QUERY_STRING'] ?? '' ) ) );"
          },
          {
            "lineNumber": 39,
            "text": "\t\t}"
          },
          {
            "lineNumber": 40
          },
          {
            "lineNumber": 41,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 42,
            "text": "\t\t * Prevent duplicate posts from showing up in search results."
          },
          {
            "lineNumber": 43,
            "text": "\t\t *"
          },
          {
            "lineNumber": 44,
            "text": "\t\t * @link https://developer.wordpress.org/reference/hooks/posts_distinct/"
          },
          {
            "lineNumber": 45,
            "text": "\t\t *"
          },
          {
            "lineNumber": 46,
            "text": "\t\t * @param  string $distinct The part of the query that contains the word"
          },
          {
            "lineNumber": 47,
            "text": "\t\t * DISTINCT."
          },
          {
            "lineNumber": 48,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 49,
            "text": "\t\t */"
          },
          {
            "lineNumber": 50,
            "text": "\t\tpublic function cf_search_distinct( $distinct ) {"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\tif ( is_search() ) {"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t\treturn 'DISTINCT';"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 54
          },
          {
            "lineNumber": 55,
            "text": "\t\t\treturn $distinct;"
          },
          {
            "lineNumber": 56,
            "text": "\t\t}"
          },
          {
            "lineNumber": 57
          },
          {
            "lineNumber": 58,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 59,
            "text": "\t\t * Join posts and postmeta tables"
          },
          {
            "lineNumber": 60,
            "text": "\t\t *"
          },
          {
            "lineNumber": 61,
            "text": "\t\t * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join"
          },
          {
            "lineNumber": 62,
            "text": "\t\t *"
          },
          {
            "lineNumber": 63,
            "text": "\t\t * @param  string $join The JOIN clause of the query."
          },
          {
            "lineNumber": 64,
            "text": "\t\t * @return string"
          },
          {
            "lineNumber": 65,
            "text": "\t\t */"
          },
          {
            "lineNumber": 66,
            "text": "\t\tpublic function cf_search_join( $join ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( ! is_search() || $this-\u003eis_media_library() ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 4,
            "line": 69
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-add-custom-fields-to-search.php",
        "signatures": {}
      },
      "score": 0.4093221127986908
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 111,
            "text": "\t\tif ( $args['newest_first'] ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t// Change the order to last_modified date."
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t$post_args['meta_key'] = apply_filters( 'invp_prefix_meta_key', 'last_modified' );"
          },
          {
            "lineNumber": 114,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\t$post_args['orderby'] = \"STR_TO_DATE( {$wpdb-\u003epostmeta}.meta_value, '%a, %d %b %Y %T' )\";"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t$post_args['order']   = 'DESC';"
          },
          {
            "lineNumber": 117,
            "text": "\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t// Do we want featured vehicles only?"
          },
          {
            "lineNumber": 120,
            "text": "\t\tif ( $args['featured_only'] ) {"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t$post_args['meta_query'][] = array("
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t\t'key'   =\u003e apply_filters( 'invp_prefix_meta_key', 'featured' ),"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\t'value' =\u003e '1',"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 125,
            "text": "\t\t}"
          },
          {
            "lineNumber": 126
          },
          {
            "lineNumber": 127,
            "text": "\t\t// Are we only showing 1 make?"
          },
          {
            "lineNumber": 128,
            "text": "\t\tif ( ! empty( $args['make'] ) ) {"
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t$post_args['tax_query'][] = array("
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t\t'taxonomy' =\u003e 'make',"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t\t'field'    =\u003e 'slug',"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t\t'terms'    =\u003e $args['make'],"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 134,
            "text": "\t\t}"
          },
          {
            "lineNumber": 135
          },
          {
            "lineNumber": 136,
            "text": "\t\t// Are we only showing 1 model?"
          },
          {
            "lineNumber": 137,
            "text": "\t\tif ( ! empty( $args['model'] ) ) {"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t$post_args['meta_query'][] = array("
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t'value'   =\u003e $args['model'],"
          },
          {
            "lineNumber": 141,
            "text": "\t\t\t\t'compare' =\u003e 'LIKE',"
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 143,
            "text": "\t\t}"
          },
          {
            "lineNumber": 144
          },
          {
            "lineNumber": 145,
            "text": "\t\t// Should we exclude sold vehicles?"
          },
          {
            "lineNumber": 146,
            "text": "\t\t$plugin_settings = INVP::settings();"
          },
          {
            "lineNumber": 147,
            "text": "\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 ! $plugin_settings['include_sold_vehicles'] ) {"
          },
          {
            "lineNumber": 148,
            "text": "\t\t\t$post_args['tax_query'][] = Inventory_Presser_Taxonomies::tax_query_exclude_sold();"
          },
          {
            "lineNumber": 149,
            "text": "\t\t}"
          },
          {
            "lineNumber": 150
          },
          {
            "lineNumber": 151,
            "text": "\t\t$inventory_ids = get_posts( $post_args );"
          },
          {
            "lineNumber": 152,
            "text": "\t\tif ( empty( $inventory_ids ) ) {"
          },
          {
            "lineNumber": 153,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 154,
            "text": "\t\t}"
          },
          {
            "lineNumber": 155
          },
          {
            "lineNumber": 156,
            "text": "\t\t// Do we want priced vehicles first?"
          },
          {
            "lineNumber": 157,
            "text": "\t\tif ( $args['priced_first'] ) {"
          },
          {
            "lineNumber": 158,
            "text": "\t\t\t// Yes. Scan the results for vehicles without prices."
          },
          {
            "lineNumber": 159,
            "text": "\t\t\t$ids_without_prices = array();"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\tforeach ( $inventory_ids as $inventory_id ) {"
          },
          {
            "lineNumber": 161,
            "text": "\t\t\t\tif ( empty( get_post_meta( $inventory_id, apply_filters( 'invp_prefix_meta_key', 'price' ) ) ) ) {"
          },
          {
            "lineNumber": 162,
            "text": "\t\t\t\t\t$ids_without_prices[] = $inventory_id;"
          },
          {
            "lineNumber": 163,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 164,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 165,
            "text": "\t\t\tif ( ! empty( $ids_without_prices ) ) {"
          },
          {
            "lineNumber": 166,
            "text": "\t\t\t\t// Remove IDs and then add them to the end of the array."
          },
          {
            "lineNumber": 167,
            "text": "\t\t\t\t$inventory_ids = array_merge( array_diff( $inventory_ids, $ids_without_prices ), $ids_without_prices );"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 169,
            "text": "\t\t}"
          },
          {
            "lineNumber": 170
          },
          {
            "lineNumber": 171,
            "text": "\t\t$grid_html = sprintf("
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t'\u003cdiv class=\"invp-grid\"\u003e\u003cul class=\"grid-slides columns-%s\"\u003e',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 172
          },
          "startPosition": {
            "line": 110
          }
        },
        "relativeWorkspacePath": "./includes/widget/class-widget-inventory-grid.php",
        "signatures": {}
      },
      "score": 0.37305471301078796
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 75,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 76,
            "text": "\t\t */"
          },
          {
            "lineNumber": 77,
            "text": "\t\tpublic function add_orderby_to_query( $query ) {"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t// Do not mess with the query if it's not the main one and our CPT."
          },
          {
            "lineNumber": 79,
            "text": "\t\t\tif ( apply_filters( 'invp_apply_orderby_to_main_query_only', true ) \u0026\u0026 ! $query-\u003eis_main_query() ) {"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 81,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 82
          },
          {
            "lineNumber": 83,
            "text": "\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 85,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 86
          },
          {
            "lineNumber": 87,
            "text": "\t\t\tadd_filter( 'posts_clauses', array( $this, 'modify_query_orderby' ) );"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t$settings = INVP::settings();"
          },
          {
            "lineNumber": 89
          },
          {
            "lineNumber": 90,
            "text": "\t\t\tif ( empty( $_GET['orderby'] ) \u0026\u0026 empty( $settings['sort_vehicles_by'] ) ) {"
          },
          {
            "lineNumber": 91,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t * The field we want to order by is either in $_GET['orderby'] when"
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t * the user has chosen to reorder posts or saved in the plugin"
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t * settings 'default-sort-key.' The sort direction is in"
          },
          {
            "lineNumber": 98,
            "text": "\t\t\t * $_GET['order'] or 'sort_vehicles_order.'"
          },
          {
            "lineNumber": 99,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 100,
            "text": "\t\t\t$direction = $settings['sort_vehicles_order'];"
          },
          {
            "lineNumber": 101,
            "text": "\t\t\tif ( isset( $_GET['order'] ) ) {"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\t\t$direction = sanitize_text_field( wp_unslash( $_GET['order'] ) );"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 104
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t$key = $settings['sort_vehicles_by'];"
          },
          {
            "lineNumber": 106
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t// Backwards compatibility for pre 13.7.1 when there was a bug."
          },
          {
            "lineNumber": 108,
            "text": "\t\t\tif ( 'date_entered' === $key ) {"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\t\t$key = 'post_date';"
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\tif ( 'last_modified' === $key ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t\t$key = 'post_modified';"
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 114
          },
          {
            "lineNumber": 115,
            "text": "\t\t\tif ( isset( $_GET['orderby'] ) ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t$key = sanitize_text_field( wp_unslash( $_GET['orderby'] ) );"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 118
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t// post_date and post_modified are not meta keys."
          },
          {
            "lineNumber": 120,
            "text": "\t\t\tif ( in_array( $key, array( 'post_date', 'post_modified' ), true ) ) {"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t\t$query-\u003eset( 'orderby', $key );"
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t\t$query-\u003eset( 'order', $direction );"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 125
          },
          {
            "lineNumber": 126,
            "text": "\t\t\t// Make sure the meta key has the prefix."
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key );"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t$query-\u003eset( 'meta_key', $key );"
          },
          {
            "lineNumber": 129
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t * Maybe append to the meta_query if it is already set. If we are"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t * sorting by make, then we want to also add a secondary sort of model"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t * and a tertiary sort of trim. That's what users want. Apply the same"
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t * logic to sorts by year and model."
          },
          {
            "lineNumber": 135,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 136,
            "text": "\t\t\t$old = $query-\u003eget( 'meta_query', array() );"
          },
          {
            "lineNumber": 137,
            "text": "\t\t\tswitch ( apply_filters( 'invp_unprefix_meta_key', $query-\u003eget( 'meta_key' ) ) ) {"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\tcase 'make':"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t\t\t'meta_query',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 140
          },
          "startPosition": {
            "line": 74
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.3713034391403198
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 157,
            "text": "\tpublic function maybe_add_noindex( $robots ) {"
          },
          {
            "lineNumber": 158,
            "text": "\t\t// Is this a vehicle archive?"
          },
          {
            "lineNumber": 159,
            "text": "\t\tif ( ! defined( 'INVP::POST_TYPE' ) || ! is_post_type_archive( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\t// No."
          },
          {
            "lineNumber": 161,
            "text": "\t\t\treturn $robots;"
          },
          {
            "lineNumber": 162,
            "text": "\t\t}"
          },
          {
            "lineNumber": 163
          },
          {
            "lineNumber": 164,
            "text": "\t\t// How many taxonomy filters are in the query?"
          },
          {
            "lineNumber": 165,
            "text": "\t\t$filter_count = 0;"
          },
          {
            "lineNumber": 166,
            "text": "\t\tforeach ( self::query_vars_array() as $query_var ) {"
          },
          {
            "lineNumber": 167,
            "text": "\t\t\t$vars = get_query_var( $query_var );"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\tif ( '' !== $vars ) {"
          },
          {
            "lineNumber": 169,
            "text": "\t\t\t\tif ( is_array( $vars ) ) {"
          },
          {
            "lineNumber": 170,
            "text": "\t\t\t\t\t$filter_count += count( $vars );"
          },
          {
            "lineNumber": 171,
            "text": "\t\t\t\t} else {"
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t\t\t++$filter_count;"
          },
          {
            "lineNumber": 173,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 174
          },
          {
            "lineNumber": 175,
            "text": "\t\t\t\t// More than one?"
          },
          {
            "lineNumber": 176,
            "text": "\t\t\t\tif ( $filter_count \u003e 1 ) {"
          },
          {
            "lineNumber": 177,
            "text": "\t\t\t\t\t$robots['noindex'] = $robots['nofollow'] = true;"
          },
          {
            "lineNumber": 178,
            "text": "\t\t\t\t\treturn $robots;"
          },
          {
            "lineNumber": 179,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 180,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 181,
            "text": "\t\t}"
          },
          {
            "lineNumber": 182,
            "text": "\t\treturn $robots;"
          },
          {
            "lineNumber": 183,
            "text": "\t}"
          },
          {
            "lineNumber": 184
          },
          {
            "lineNumber": 185,
            "text": "\t/**"
          },
          {
            "lineNumber": 186,
            "text": "\t * Filter callback. Implements the \"include sold vehicles\" checkbox feature"
          },
          {
            "lineNumber": 187,
            "text": "\t * in vehicle archives and search results."
          },
          {
            "lineNumber": 188,
            "text": "\t *"
          },
          {
            "lineNumber": 189,
            "text": "\t * @param  WP_Query $query The posts query object."
          },
          {
            "lineNumber": 190,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 191,
            "text": "\t */"
          },
          {
            "lineNumber": 192,
            "text": "\tpublic function maybe_exclude_sold_vehicles( $query ) {"
          },
          {
            "lineNumber": 193,
            "text": "\t\tif ( is_admin() || ! $query-\u003eis_main_query()"
          },
          {
            "lineNumber": 194,
            "text": "\t\t\t|| ! ( is_search() || is_post_type_archive( INVP::POST_TYPE ) )"
          },
          {
            "lineNumber": 195,
            "text": "\t\t) {"
          },
          {
            "lineNumber": 196,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 197,
            "text": "\t\t}"
          },
          {
            "lineNumber": 198
          },
          {
            "lineNumber": 199,
            "text": "\t\t// If there is already a tax_query for taxonomy availability, abort."
          },
          {
            "lineNumber": 200,
            "text": "\t\tif ( $query-\u003eis_tax( 'availability' ) ) {"
          },
          {
            "lineNumber": 201,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 202,
            "text": "\t\t}"
          },
          {
            "lineNumber": 203
          },
          {
            "lineNumber": 204,
            "text": "\t\t// If the checkbox to include sold vehicles is checked, abort."
          },
          {
            "lineNumber": 205,
            "text": "\t\t$plugin_settings = INVP::settings();"
          },
          {
            "lineNumber": 206,
            "text": "\t\tif ( isset( $plugin_settings['include_sold_vehicles'] ) \u0026\u0026 $plugin_settings['include_sold_vehicles'] ) {"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 208,
            "text": "\t\t}"
          },
          {
            "lineNumber": 209
          },
          {
            "lineNumber": 210,
            "text": "\t\t$query-\u003eset( 'tax_query', self::tax_query_exclude_sold() );"
          },
          {
            "lineNumber": 211,
            "text": "\t}"
          },
          {
            "lineNumber": 212
          },
          {
            "lineNumber": 213,
            "text": "\t/**"
          },
          {
            "lineNumber": 214,
            "text": "\t * Outputs HTML that renders a meta box in the Classic Editor for all our taxonomies."
          },
          {
            "lineNumber": 215,
            "text": "\t *"
          },
          {
            "lineNumber": 216,
            "text": "\t * @param  WP_Post $post Current post object."
          },
          {
            "lineNumber": 217,
            "text": "\t * @param  array   $box  Categories meta box arguments."
          },
          {
            "lineNumber": 218,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 219,
            "text": "\t */"
          },
          {
            "lineNumber": 220,
            "text": "\tpublic static function meta_box_html( $post, $box ) {"
          },
          {
            "lineNumber": 221,
            "text": "\t\t$taxonomy = $box['args']['taxonomy'] ?? '';"
          }
        ],
        "range": {
          "endPosition": {
            "line": 221
          },
          "startPosition": {
            "line": 156
          }
        },
        "relativeWorkspacePath": "./includes/class-taxonomies.php",
        "signatures": {}
      },
      "score": 0.3697396516799927
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 370,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 371,
            "text": "\t\t */"
          },
          {
            "lineNumber": 372,
            "text": "\t\tpublic static function create_post_type() {"
          },
          {
            "lineNumber": 373,
            "text": "\t\t\t// creates a custom post type that will be used by this plugin."
          },
          {
            "lineNumber": 374,
            "text": "\t\t\tregister_post_type("
          },
          {
            "lineNumber": 375,
            "text": "\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 376,
            "text": "\t\t\t\tapply_filters("
          },
          {
            "lineNumber": 377,
            "text": "\t\t\t\t\t'invp_post_type_args',"
          },
          {
            "lineNumber": 378,
            "text": "\t\t\t\t\tarray("
          },
          {
            "lineNumber": 379,
            "text": "\t\t\t\t\t\t'capability_type' =\u003e INVP::POST_TYPE,"
          },
          {
            "lineNumber": 380,
            "text": "\t\t\t\t\t\t'map_meta_cap'    =\u003e true,"
          },
          {
            "lineNumber": 381,
            "text": "\t\t\t\t\t\t'description'     =\u003e __( 'Vehicles for sale', 'inventory-presser' ),"
          },
          {
            "lineNumber": 382,
            "text": "\t\t\t\t\t\t'has_archive'     =\u003e true,"
          },
          {
            "lineNumber": 383,
            "text": "\t\t\t\t\t\t'hierarchical'    =\u003e false,"
          },
          {
            "lineNumber": 384,
            "text": "\t\t\t\t\t\t'labels'          =\u003e array("
          },
          {
            "lineNumber": 385,
            "text": "\t\t\t\t\t\t\t'name'                  =\u003e _x( 'Vehicles', 'Post type general name', 'inventory-presser' ),"
          },
          {
            "lineNumber": 386,
            "text": "\t\t\t\t\t\t\t'singular_name'         =\u003e _x( 'Vehicle', 'Post type singular name', 'inventory-presser' ),"
          },
          {
            "lineNumber": 387,
            "text": "\t\t\t\t\t\t\t'menu_name'             =\u003e _x( 'Vehicles', 'Admin Menu text', 'inventory-presser' ),"
          },
          {
            "lineNumber": 388,
            "text": "\t\t\t\t\t\t\t'name_admin_bar'        =\u003e _x( 'Vehicle', 'Add New on Toolbar', 'inventory-presser' ),"
          },
          {
            "lineNumber": 389,
            "text": "\t\t\t\t\t\t\t'add_new'               =\u003e __( 'Add New', 'inventory-presser' ),"
          },
          {
            "lineNumber": 390,
            "text": "\t\t\t\t\t\t\t'add_new_item'          =\u003e __( 'Add New Vehicle', 'inventory-presser' ),"
          },
          {
            "lineNumber": 391,
            "text": "\t\t\t\t\t\t\t'new_item'              =\u003e __( 'New Vehicle', 'inventory-presser' ),"
          },
          {
            "lineNumber": 392,
            "text": "\t\t\t\t\t\t\t'edit_item'             =\u003e __( 'Edit Vehicle', 'inventory-presser' ),"
          },
          {
            "lineNumber": 393,
            "text": "\t\t\t\t\t\t\t'view_item'             =\u003e __( 'View Vehicle', 'inventory-presser' ),"
          },
          {
            "lineNumber": 394,
            "text": "\t\t\t\t\t\t\t'all_items'             =\u003e __( 'All Vehicles', 'inventory-presser' ),"
          },
          {
            "lineNumber": 395,
            "text": "\t\t\t\t\t\t\t'search_items'          =\u003e __( 'Search Vehicles', 'inventory-presser' ),"
          },
          {
            "lineNumber": 396,
            "text": "\t\t\t\t\t\t\t'parent_item_colon'     =\u003e __( 'Parent Vehicles:', 'inventory-presser' ),"
          },
          {
            "lineNumber": 397,
            "text": "\t\t\t\t\t\t\t'not_found'             =\u003e __( 'No vehicles found.', 'inventory-presser' ),"
          },
          {
            "lineNumber": 398,
            "text": "\t\t\t\t\t\t\t'not_found_in_trash'    =\u003e __( 'No vehicles found in Trash.', 'inventory-presser' ),"
          },
          {
            "lineNumber": 399,
            "text": "\t\t\t\t\t\t\t'archives'              =\u003e _x( 'Inventory', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'inventory-presser' ),"
          },
          {
            "lineNumber": 400,
            "text": "\t\t\t\t\t\t\t'insert_into_item'      =\u003e _x( 'Attach to vehicle', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'inventory-presser' ),"
          },
          {
            "lineNumber": 401,
            "text": "\t\t\t\t\t\t\t'uploaded_to_this_item' =\u003e _x( 'Uploaded to this vehicle', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'inventory-presser' ),"
          }
        ],
        "range": {
          "endPosition": {
            "line": 401
          },
          "startPosition": {
            "line": 369
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.35358428955078125
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 61,
            "text": "\t */"
          },
          {
            "lineNumber": 62,
            "text": "\tpublic function content( $atts ) {"
          },
          {
            "lineNumber": 63,
            "text": "\t\tif ( ! wp_style_is( 'invp-attribute-table', 'registered' ) ) {"
          },
          {
            "lineNumber": 64,
            "text": "\t\t\tInventory_Presser_Plugin::include_scripts_and_styles();"
          },
          {
            "lineNumber": 65,
            "text": "\t\t}"
          },
          {
            "lineNumber": 66,
            "text": "\t\twp_enqueue_style( 'invp-attribute-table' );"
          },
          {
            "lineNumber": 67,
            "text": "\t\twp_enqueue_style( 'invp_archive_vehicle' );"
          },
          {
            "lineNumber": 68
          },
          {
            "lineNumber": 69,
            "text": "\t\t$atts = shortcode_atts("
          },
          {
            "lineNumber": 70,
            "text": "\t\t\tarray("
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t\t'location'       =\u003e '',"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\t\t'order'          =\u003e get_query_var( 'order' ),"
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t\t'paged'          =\u003e ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1,"
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t\t'posts_per_page' =\u003e get_option( 'posts_per_page' ),"
          },
          {
            "lineNumber": 75,
            "text": "\t\t\t\t'post_status'    =\u003e 'publish',"
          },
          {
            "lineNumber": 76,
            "text": "\t\t\t\t'show_titles'    =\u003e true,"
          },
          {
            "lineNumber": 77,
            "text": "\t\t\t\t'style'          =\u003e 'a',"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t),"
          },
          {
            "lineNumber": 79,
            "text": "\t\t\t$atts,"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t'invp_archive'"
          },
          {
            "lineNumber": 81,
            "text": "\t\t);"
          },
          {
            "lineNumber": 82
          },
          {
            "lineNumber": 83,
            "text": "\t\t// Allow orderby and order $_GET parameters to change the sort order."
          },
          {
            "lineNumber": 84,
            "text": "\t\t$orderby = get_query_var( 'orderby' );"
          },
          {
            "lineNumber": 85,
            "text": "\t\tif ( '' !== $orderby \u0026\u0026 'meta_value' !== $orderby ) {"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t$atts['meta_key'] = apply_filters( 'invp_prefix_meta_key', $orderby );"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\t$atts['orderby']  = 'meta_value';"
          },
          {
            "lineNumber": 88,
            "text": "\t\t}"
          },
          {
            "lineNumber": 89
          },
          {
            "lineNumber": 90,
            "text": "\t\t// Parse boolean values to make life easy on users."
          },
          {
            "lineNumber": 91,
            "text": "\t\t$atts['show_titles'] = filter_var( $atts['show_titles'], FILTER_VALIDATE_BOOLEAN );"
          },
          {
            "lineNumber": 92,
            "text": "\t\t$atts['post_type']   = INVP::POST_TYPE;"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\t// Ensure style is \"a\" or \"b\"."
          },
          {
            "lineNumber": 95,
            "text": "\t\t$atts['style'] = in_array( $atts['style'], array( 'a', 'b' ), true ) ? $atts['style'] : 'a';"
          },
          {
            "lineNumber": 96
          },
          {
            "lineNumber": 97,
            "text": "\t\t// Add all taxonomy query vars to $atts so filters work."
          },
          {
            "lineNumber": 98,
            "text": "\t\t$taxonomies = get_object_taxonomies( $atts['post_type'], 'objects' );"
          },
          {
            "lineNumber": 99,
            "text": "\t\tforeach ( $taxonomies as $taxonomy ) {"
          },
          {
            "lineNumber": 100,
            "text": "\t\t\t$query_value = get_query_var( $taxonomy-\u003equery_var );"
          },
          {
            "lineNumber": 101,
            "text": "\t\t\tif ( '' !== $query_value ) {"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\t\t$atts[ $taxonomy-\u003equery_var ] = $query_value;"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 104,
            "text": "\t\t}"
          },
          {
            "lineNumber": 105
          },
          {
            "lineNumber": 106,
            "text": "\t\t// Query vehicles."
          },
          {
            "lineNumber": 107,
            "text": "\t\tadd_filter( 'invp_range_filters_main_query', '__return_false' );"
          },
          {
            "lineNumber": 108,
            "text": "\t\t$vehicles_query = new WP_Query( $this-\u003eclean_attributes_for_query( $atts ) );"
          },
          {
            "lineNumber": 109,
            "text": "\t\tremove_filter( 'invp_range_filters_main_query', '__return_false' );"
          },
          {
            "lineNumber": 110
          },
          {
            "lineNumber": 111,
            "text": "\t\t// Create the HTML output."
          },
          {
            "lineNumber": 112,
            "text": "\t\t$have_posts = $vehicles_query-\u003ehave_posts();"
          },
          {
            "lineNumber": 113,
            "text": "\t\t$output     = '' . apply_filters( 'invp_archive_shortcode_before', '', $have_posts, $atts );"
          },
          {
            "lineNumber": 114,
            "text": "\t\tif ( $have_posts ) {"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\twhile ( $vehicles_query-\u003ehave_posts() ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 4,
            "line": 115
          },
          "startPosition": {
            "line": 60
          }
        },
        "relativeWorkspacePath": "./includes/shortcode/class-shortcode-archive.php",
        "signatures": {}
      },
      "score": 0.35121381282806396
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 969,
            "text": "\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {"
          },
          {
            "lineNumber": 970,
            "text": "\t\t\t\treturn $title_parts;"
          },
          {
            "lineNumber": 971,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 972
          },
          {
            "lineNumber": 973,
            "text": "\t\t\t$title_parts['title'] = '';"
          },
          {
            "lineNumber": 974
          },
          {
            "lineNumber": 975,
            "text": "\t\t\t// Is it a make search?"
          },
          {
            "lineNumber": 976,
            "text": "\t\t\t$query_var = get_query_var( 'make' );"
          },
          {
            "lineNumber": 977,
            "text": "\t\t\tif ( ! empty( $query_var ) ) {"
          },
          {
            "lineNumber": 978,
            "text": "\t\t\t\t$term = get_term_by( 'slug', $query_var[0], 'make' );"
          },
          {
            "lineNumber": 979,
            "text": "\t\t\t\tif ( is_object( $term ) \u0026\u0026 'WP_Term' === get_class( $term ) ) {"
          },
          {
            "lineNumber": 980,
            "text": "\t\t\t\t\t$title_parts['title'] .= $term-\u003ename . ' ';"
          },
          {
            "lineNumber": 981,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 982,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 983
          },
          {
            "lineNumber": 984,
            "text": "\t\t\t// Is it a type search?"
          },
          {
            "lineNumber": 985,
            "text": "\t\t\t$query_var = get_query_var( 'type' );"
          },
          {
            "lineNumber": 986,
            "text": "\t\t\tif ( ! empty( $query_var ) ) {"
          },
          {
            "lineNumber": 987,
            "text": "\t\t\t\t$term = get_term_by( 'slug', $query_var[0], 'type' );"
          },
          {
            "lineNumber": 988,
            "text": "\t\t\t\tif ( is_object( $term ) \u0026\u0026 'WP_Term' === get_class( $term ) ) {"
          },
          {
            "lineNumber": 989,
            "text": "\t\t\t\t\t$title_parts['title'] .= $term-\u003ename . ' ';"
          },
          {
            "lineNumber": 990,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 991,
            "text": "\t\t\t} else {"
          },
          {
            "lineNumber": 992,
            "text": "\t\t\t\t$title_parts['title'] .= __( 'Vehicles', 'inventory-presser' ) . ' ';"
          },
          {
            "lineNumber": 993,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 994
          },
          {
            "lineNumber": 995,
            "text": "\t\t\t$title_parts['title'] .= __( 'For Sale', 'inventory-presser' );"
          },
          {
            "lineNumber": 996
          },
          {
            "lineNumber": 997,
            "text": "\t\t\treturn $title_parts;"
          },
          {
            "lineNumber": 998,
            "text": "\t\t}"
          },
          {
            "lineNumber": 999
          },
          {
            "lineNumber": 1000,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 1001,
            "text": "\t\t * Changes the messages shown to users in the editor when changes are made"
          },
          {
            "lineNumber": 1002,
            "text": "\t\t * to the post object."
          },
          {
            "lineNumber": 1003,
            "text": "\t\t *"
          },
          {
            "lineNumber": 1004,
            "text": "\t\t * @param  array $msgs"
          },
          {
            "lineNumber": 1005,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 1006,
            "text": "\t\t */"
          },
          {
            "lineNumber": 1007,
            "text": "\t\tpublic function change_post_updated_messages( $msgs ) {"
          },
          {
            "lineNumber": 1008,
            "text": "\t\t\tglobal $post;"
          },
          {
            "lineNumber": 1009
          },
          {
            "lineNumber": 1010,
            "text": "\t\t\t$view_link = sprintf("
          },
          {
            "lineNumber": 1011,
            "text": "\t\t\t\t'\u003ca href=\"%1$s\"\u003e%2$s\u003c/a\u003e',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1011
          },
          "startPosition": {
            "line": 967
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.33501601219177246
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 165,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 166,
            "text": "\t\t}"
          },
          {
            "lineNumber": 167
          },
          {
            "lineNumber": 168,
            "text": "\t\t// Condition filter."
          },
          {
            "lineNumber": 169,
            "text": "\t\tif ( ! empty( $shortcode_atts['condition'] ) ) {"
          },
          {
            "lineNumber": 170,
            "text": "\t\t\t$query_args['meta_query'][] = array("
          },
          {
            "lineNumber": 171,
            "text": "\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'condition' ),"
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t\t'value'   =\u003e $shortcode_atts['condition'],"
          },
          {
            "lineNumber": 173,
            "text": "\t\t\t\t'compare' =\u003e '=',"
          },
          {
            "lineNumber": 174,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 175,
            "text": "\t\t}"
          },
          {
            "lineNumber": 176
          },
          {
            "lineNumber": 177,
            "text": "\t\treturn $query_args;"
          },
          {
            "lineNumber": 178,
            "text": "\t}"
          },
          {
            "lineNumber": 179
          },
          {
            "lineNumber": 180,
            "text": "\tpublic static function get_vehicle_IDs( $shortcode_atts ) {"
          },
          {
            "lineNumber": 181,
            "text": "\t\t// Check if any filters are specified."
          },
          {
            "lineNumber": 182,
            "text": "\t\t$has_filters = ! empty( $shortcode_atts['make'] )"
          },
          {
            "lineNumber": 183,
            "text": "\t\t\t|| ! empty( $shortcode_atts['model'] )"
          },
          {
            "lineNumber": 184,
            "text": "\t\t\t|| ! empty( $shortcode_atts['type'] )"
          },
          {
            "lineNumber": 185,
            "text": "\t\t\t|| ! empty( $shortcode_atts['condition'] );"
          },
          {
            "lineNumber": 186
          },
          {
            "lineNumber": 187,
            "text": "\t\t// Base query arguments."
          },
          {
            "lineNumber": 188,
            "text": "\t\t$gpargs = array("
          },
          {
            "lineNumber": 189,
            "text": "\t\t\t'posts_per_page' =\u003e 10,"
          },
          {
            "lineNumber": 190,
            "text": "\t\t\t'post_type'      =\u003e INVP::POST_TYPE,"
          },
          {
            "lineNumber": 191,
            "text": "\t\t\t'meta_query'     =\u003e array("
          },
          {
            "lineNumber": 192,
            "text": "\t\t\t\t'relation' =\u003e 'AND',"
          },
          {
            "lineNumber": 193,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 194,
            "text": "\t\t\t\t\t'key'     =\u003e '_thumbnail_id',"
          },
          {
            "lineNumber": 195,
            "text": "\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 196,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 197,
            "text": "\t\t\t),"
          },
          {
            "lineNumber": 198,
            "text": "\t\t\t'fields'         =\u003e 'ids',"
          },
          {
            "lineNumber": 199,
            "text": "\t\t\t'orderby'        =\u003e $shortcode_atts['orderby'],"
          },
          {
            "lineNumber": 200,
            "text": "\t\t\t'order'          =\u003e $shortcode_atts['order'],"
          },
          {
            "lineNumber": 201,
            "text": "\t\t);"
          },
          {
            "lineNumber": 202
          },
          {
            "lineNumber": 203,
            "text": "\t\t// Only require featured vehicles if no filters are specified."
          },
          {
            "lineNumber": 204,
            "text": "\t\tif ( ! $has_filters ) {"
          },
          {
            "lineNumber": 205,
            "text": "\t\t\t$gpargs['meta_query'][] = array("
          },
          {
            "lineNumber": 206,
            "text": "\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'featured' ),"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\t\t'value'   =\u003e 1,"
          },
          {
            "lineNumber": 208,
            "text": "\t\t\t\t'compare' =\u003e '=',"
          },
          {
            "lineNumber": 209,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 210,
            "text": "\t\t}"
          },
          {
            "lineNumber": 211
          },
          {
            "lineNumber": 212,
            "text": "\t\t// Add filter arguments (make, model, type, condition)."
          },
          {
            "lineNumber": 213,
            "text": "\t\t$gpargs = self::add_make_and_model_query_args( $gpargs, $shortcode_atts );"
          },
          {
            "lineNumber": 214
          },
          {
            "lineNumber": 215,
            "text": "\t\t$inventory_ids = get_posts( $gpargs );"
          },
          {
            "lineNumber": 216
          },
          {
            "lineNumber": 217,
            "text": "\t\t// If we found less than 10 vehicles and no filters were specified, try non-featured vehicles."
          },
          {
            "lineNumber": 218,
            "text": "\t\tif ( count( $inventory_ids ) \u003c 10 \u0026\u0026 ! $has_filters ) {"
          },
          {
            "lineNumber": 219,
            "text": "\t\t\t$gpargs = array("
          },
          {
            "lineNumber": 220,
            "text": "\t\t\t\t'posts_per_page' =\u003e 10 - ( count( $inventory_ids ) ),"
          }
        ],
        "range": {
          "endPosition": {
            "line": 220
          },
          "startPosition": {
            "line": 164
          }
        },
        "relativeWorkspacePath": "./includes/shortcode/class-shortcode-inventory-slider.php",
        "signatures": {}
      },
      "score": 0.33458054065704346
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 522,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 523,
            "text": "\t\t */"
          },
          {
            "lineNumber": 524,
            "text": "\t\tprotected function generate_rewrite_rules( $post_type, $query_vars = array() ) {"
          },
          {
            "lineNumber": 525,
            "text": "\t\t\tglobal $wp_rewrite;"
          },
          {
            "lineNumber": 526
          },
          {
            "lineNumber": 527,
            "text": "\t\t\tif ( ! is_object( $post_type ) ) {"
          },
          {
            "lineNumber": 528,
            "text": "\t\t\t\t$post_type = get_post_type_object( $post_type );"
          },
          {
            "lineNumber": 529,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 530
          },
          {
            "lineNumber": 531,
            "text": "\t\t\t$rewrite_slugs = apply_filters("
          },
          {
            "lineNumber": 532,
            "text": "\t\t\t\t'invp_rewrite_slugs',"
          },
          {
            "lineNumber": 533,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 534,
            "text": "\t\t\t\t\t$post_type-\u003erewrite['slug'],"
          },
          {
            "lineNumber": 535,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 536,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 537
          },
          {
            "lineNumber": 538,
            "text": "\t\t\t$new_rewrite_rules = array();"
          },
          {
            "lineNumber": 539
          },
          {
            "lineNumber": 540,
            "text": "\t\t\t// Add taxonomy filters to the query vars array."
          },
          {
            "lineNumber": 541,
            "text": "\t\t\t$settings = INVP::settings();"
          },
          {
            "lineNumber": 542,
            "text": "\t\t\tforeach ( Inventory_Presser_Taxonomies::query_vars_array() as $query_var ) {"
          },
          {
            "lineNumber": 543,
            "text": "\t\t\t\t$is_active = $settings['taxonomies'][ $query_var ]['active'] ?? false;"
          },
          {
            "lineNumber": 544,
            "text": "\t\t\t\tif ( $is_active ) {"
          },
          {
            "lineNumber": 545,
            "text": "\t\t\t\t\t$query_vars[] = $query_var;"
          },
          {
            "lineNumber": 546,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 547,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 548
          },
          {
            "lineNumber": 549,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 550,
            "text": "\t\t\t * Create two rules for searches across single and multiple terms"
          },
          {
            "lineNumber": 551,
            "text": "\t\t\t * and for each listings page."
          },
          {
            "lineNumber": 552,
            "text": "\t\t\t * One rule is page one, and the second supports the paged variable."
          },
          {
            "lineNumber": 553,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 554,
            "text": "\t\t\t$maximum_simultaneous_filters = intval( apply_filters( 'invp_archive_filter_max', 5 ) );"
          },
          {
            "lineNumber": 555,
            "text": "\t\t\t$query_vars_count             = min( $maximum_simultaneous_filters, count( $query_vars ) );"
          },
          {
            "lineNumber": 556,
            "text": "\t\t\tfor ( $i = 1; $i \u003c= $query_vars_count;  $i++ ) {"
          },
          {
            "lineNumber": 557,
            "text": "\t\t\t\tforeach ( $rewrite_slugs as $rewrite_slug ) {"
          },
          {
            "lineNumber": 558,
            "text": "\t\t\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 5,
            "line": 557
          },
          "startPosition": {
            "line": 521
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.3310661017894745
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 244,
            "text": "\t\t *"
          },
          {
            "lineNumber": 245,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 246,
            "text": "\t\t */"
          },
          {
            "lineNumber": 247,
            "text": "\t\tprotected function get_vehicle_post_ids() {"
          },
          {
            "lineNumber": 248,
            "text": "\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 249,
            "text": "\t\t\treturn $wpdb-\u003eget_col("
          },
          {
            "lineNumber": 250,
            "text": "\t\t\t\t$wpdb-\u003eprepare("
          },
          {
            "lineNumber": 251,
            "text": "\t\t\t\t\t\""
          },
          {
            "lineNumber": 252,
            "text": "\t\t\t\t\tSELECT \t\tID"
          },
          {
            "lineNumber": 253
          },
          {
            "lineNumber": 254,
            "text": "\t\t\t\t\tFROM\t\t$wpdb-\u003eposts"
          },
          {
            "lineNumber": 255,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta1 ON $wpdb-\u003eposts.ID = meta1.post_id"
          },
          {
            "lineNumber": 256,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta2 ON $wpdb-\u003eposts.ID = meta2.post_id"
          },
          {
            "lineNumber": 257,
            "text": "\t\t\t\t\t\t\t\tLEFT JOIN $wpdb-\u003epostmeta meta3 ON $wpdb-\u003eposts.ID = meta3.post_id"
          },
          {
            "lineNumber": 258
          },
          {
            "lineNumber": 259,
            "text": "\t\t\t\t\tWHERE \t\tpost_type = %s"
          },
          {
            "lineNumber": 260,
            "text": "\t\t\t\t\t\t\t\tAND post_status = 'publish'"
          },
          {
            "lineNumber": 261,
            "text": "\t\t\t\t\t\t\t\tAND meta1.meta_key = %s"
          },
          {
            "lineNumber": 262,
            "text": "\t\t\t\t\t\t\t\tAND meta2.meta_key = %s"
          },
          {
            "lineNumber": 263,
            "text": "\t\t\t\t\t\t\t\tAND meta3.meta_key = %s"
          },
          {
            "lineNumber": 264
          },
          {
            "lineNumber": 265,
            "text": "\t\t\t\t\tORDER BY\tmeta1.meta_value DESC,"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\t\t\t\t\t\tmeta2.meta_value ASC,"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\t\t\t\t\t\tmeta3.meta_value ASC;"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t\t\","
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 273,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 274,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 275,
            "text": "\t\t}"
          },
          {
            "lineNumber": 276,
            "text": "\t}"
          },
          {
            "lineNumber": 277,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 277
          },
          "startPosition": {
            "line": 243
          }
        },
        "relativeWorkspacePath": "./includes/integrations/class-gravityforms-field-vehicle.php",
        "signatures": {}
      },
      "score": 0.32896214723587036
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "/**"
          },
          {
            "lineNumber": 3,
            "text": " * Range Filters"
          },
          {
            "lineNumber": 4,
            "text": " *"
          },
          {
            "lineNumber": 5,
            "text": " * Adds min_price, max_price, min_odometer, and max_odometer query parameters."
          },
          {
            "lineNumber": 6,
            "text": " * Modifies archive queries to adhere to the filters."
          },
          {
            "lineNumber": 7,
            "text": " *"
          },
          {
            "lineNumber": 8,
            "text": " * @package taxonomy-filters-widget"
          },
          {
            "lineNumber": 9,
            "text": " */"
          },
          {
            "lineNumber": 10
          },
          {
            "lineNumber": 11,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 12
          },
          {
            "lineNumber": 13,
            "text": "if ( ! class_exists( 'Inventory_Presser_Range_Filters' ) ) {"
          },
          {
            "lineNumber": 14,
            "text": "\t/**"
          },
          {
            "lineNumber": 15,
            "text": "\t * Inventory_Presser_Range_Filters"
          },
          {
            "lineNumber": 16,
            "text": "\t */"
          },
          {
            "lineNumber": 17,
            "text": "\tclass Inventory_Presser_Range_Filters {"
          },
          {
            "lineNumber": 18
          },
          {
            "lineNumber": 19,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 20,
            "text": "\t\t * Adds hooks that power the feature."
          },
          {
            "lineNumber": 21,
            "text": "\t\t *"
          },
          {
            "lineNumber": 22,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 23,
            "text": "\t\t */"
          },
          {
            "lineNumber": 24,
            "text": "\t\tpublic static function add_hooks() {"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\tif ( has_action( 'pre_get_posts', array( __CLASS__, 'modify_query_for_price_and_odometer_ranges' ) ) ) {"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\treturn;"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t// Modify the query to implement the price and odometer ranges."
          },
          {
            "lineNumber": 29,
            "text": "\t\t\tadd_action( 'pre_get_posts', array( __CLASS__, 'modify_query_for_price_and_odometer_ranges' ), 99, 1 );"
          },
          {
            "lineNumber": 30,
            "text": "\t\t}"
          },
          {
            "lineNumber": 31
          },
          {
            "lineNumber": 32,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 33,
            "text": "\t\t * Change a query's meta_query value if the meta_query does not already"
          },
          {
            "lineNumber": 34,
            "text": "\t\t * contain the provided key."
          },
          {
            "lineNumber": 35,
            "text": "\t\t *"
          },
          {
            "lineNumber": 36,
            "text": "\t\t * @param  mixed $meta_query"
          },
          {
            "lineNumber": 37,
            "text": "\t\t * @param  mixed $key"
          },
          {
            "lineNumber": 38,
            "text": "\t\t * @param  mixed $value"
          },
          {
            "lineNumber": 39,
            "text": "\t\t * @param  mixed $compare"
          },
          {
            "lineNumber": 40,
            "text": "\t\t * @param  mixed $type"
          },
          {
            "lineNumber": 41,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 42,
            "text": "\t\t */"
          },
          {
            "lineNumber": 43,
            "text": "\t\tprotected static function add_meta_query( $meta_query, $key, $value, $compare, $type ) {"
          },
          {
            "lineNumber": 44,
            "text": "\t\t\t// Make sure there is not already $key item in the meta_query."
          },
          {
            "lineNumber": 45,
            "text": "\t\t\tif ( self::meta_query_contains_key( $meta_query, $key ) ) {"
          },
          {
            "lineNumber": 46,
            "text": "\t\t\t\treturn $meta_query;"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 48
          },
          {
            "lineNumber": 49,
            "text": "\t\t\t$meta_query[] = array("
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t\t'key'     =\u003e $key,"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t\t'value'   =\u003e $value,"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t\t'compare' =\u003e $compare,"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t\t'type'    =\u003e $type,"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\treturn $meta_query;"
          },
          {
            "lineNumber": 56,
            "text": "\t\t}"
          },
          {
            "lineNumber": 57
          },
          {
            "lineNumber": 58,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 59,
            "text": "\t\t * Does a WP_Query's meta_query contain a specific key?"
          },
          {
            "lineNumber": 60,
            "text": "\t\t *"
          },
          {
            "lineNumber": 61,
            "text": "\t\t * @param  mixed $meta_query"
          },
          {
            "lineNumber": 62,
            "text": "\t\t * @param  mixed $key"
          },
          {
            "lineNumber": 63,
            "text": "\t\t * @return bool|null"
          },
          {
            "lineNumber": 64,
            "text": "\t\t */"
          },
          {
            "lineNumber": 65,
            "text": "\t\tprotected static function meta_query_contains_key( $meta_query, $key ) {"
          },
          {
            "lineNumber": 66,
            "text": "\t\t\tif ( is_array( $meta_query ) ) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t\tif ( isset( $meta_query['key'] ) ) {"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\t\t\treturn $meta_query['key'] === $key;"
          },
          {
            "lineNumber": 69,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 70
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t\tforeach ( $meta_query as $another ) {"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\t\t\treturn self::meta_query_contains_key( $another, $key );"
          },
          {
            "lineNumber": 73,
            "text": "\t\t\t\t}"
          },
          {
            "lineNumber": 74,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 75,
            "text": "\t\t\treturn null;"
          },
          {
            "lineNumber": 76,
            "text": "\t\t}"
          },
          {
            "lineNumber": 77
          },
          {
            "lineNumber": 78,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * Modifies the queries with the vehicle post type to include price and"
          }
        ],
        "range": {
          "endPosition": {
            "line": 79
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-range-filters.php",
        "signatures": {}
      },
      "score": 0.32435640692710876
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_REST"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * Adds routes to the REST API at /wp-json/invp/"
          },
          {
            "lineNumber": 8,
            "text": " */"
          },
          {
            "lineNumber": 9,
            "text": "class Inventory_Presser_REST {"
          },
          {
            "lineNumber": 10,
            "text": "\t/**"
          },
          {
            "lineNumber": 11,
            "text": "\t * add_hooks"
          },
          {
            "lineNumber": 12,
            "text": "\t *"
          },
          {
            "lineNumber": 13,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 14,
            "text": "\t */"
          },
          {
            "lineNumber": 15,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 16,
            "text": "\t\t/*"
          },
          {
            "lineNumber": 17,
            "text": "\t\t\tAdds"
          },
          {
            "lineNumber": 18,
            "text": "\t\t\t\t/invp/v1/settings"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t\t/invp/v1/feed-complete routes."
          },
          {
            "lineNumber": 20,
            "text": "\t\t*/"
          },
          {
            "lineNumber": 21,
            "text": "\t\tadd_action( 'rest_api_init', array( $this, 'add_routes' ) );"
          },
          {
            "lineNumber": 22,
            "text": "\t\t// Adds the inventory_type_slugs field to the response of the /wp-json/wp/v2/inventory_vehicle route."
          },
          {
            "lineNumber": 23,
            "text": "\t\tadd_action( 'rest_api_init', array( $this, 'add_inventory_type_slugs_to_posts' ) );"
          },
          {
            "lineNumber": 24
          },
          {
            "lineNumber": 25,
            "text": "\t\t// Allow attachments to be ordered by the inventory_presser_photo_number meta value."
          },
          {
            "lineNumber": 26,
            "text": "\t\tadd_filter( 'rest_attachment_collection_params', array( $this, 'allow_orderby_photo_number' ) );"
          },
          {
            "lineNumber": 27,
            "text": "\t\tadd_filter( 'rest_attachment_query', array( $this, 'orderby_photo_number' ), 10, 2 );"
          },
          {
            "lineNumber": 28
          },
          {
            "lineNumber": 29,
            "text": "\t\tif ( defined( 'INVP::POST_TYPE' ) ) {"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t// Allow vehicles to be returned in a random order."
          },
          {
            "lineNumber": 31,
            "text": "\t\t\tadd_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );"
          },
          {
            "lineNumber": 32
          },
          {
            "lineNumber": 33,
            "text": "\t\t\t// Prevent REST API warnings when vehicles are deleted during request processing."
          },
          {
            "lineNumber": 34,
            "text": "\t\t\tadd_filter( 'rest_prepare_' . INVP::POST_TYPE, array( $this, 'handle_null_post' ), 10, 3 );"
          },
          {
            "lineNumber": 35,
            "text": "\t\t}"
          },
          {
            "lineNumber": 36,
            "text": "\t}"
          },
          {
            "lineNumber": 37
          },
          {
            "lineNumber": 38,
            "text": "\t/**"
          },
          {
            "lineNumber": 39,
            "text": "\t * Adds an attribute &#96;inventory_type_slugs&#96; to the response of the"
          },
          {
            "lineNumber": 40,
            "text": "\t * /wp-json/wp/v2/inventory route."
          },
          {
            "lineNumber": 41,
            "text": "\t *"
          },
          {
            "lineNumber": 42,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 43,
            "text": "\t */"
          },
          {
            "lineNumber": 44,
            "text": "\tpublic function add_inventory_type_slugs_to_posts() {"
          },
          {
            "lineNumber": 45,
            "text": "\t\tregister_rest_field("
          },
          {
            "lineNumber": 46,
            "text": "\t\t\tINVP::POST_TYPE,"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\t'inventory_type_slugs',"
          },
          {
            "lineNumber": 48,
            "text": "\t\t\tarray("
          },
          {
            "lineNumber": 49,
            "text": "\t\t\t\t'get_callback' =\u003e array( $this, 'get_the_type_slugs' ),"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t\t'schema'       =\u003e array("
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t\t\t'description' =\u003e __( 'The type taxonomy term slugs.', 'inventory-presser' ),"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t\t\t'type'        =\u003e 'string',"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\t)"
          },
          {
            "lineNumber": 55,
            "text": "\t\t);"
          },
          {
            "lineNumber": 56,
            "text": "\t}"
          },
          {
            "lineNumber": 57
          },
          {
            "lineNumber": 58,
            "text": "\t/**"
          },
          {
            "lineNumber": 59,
            "text": "\t * Adds the photo_number meta field to the allowed orderby values."
          },
          {
            "lineNumber": 60,
            "text": "\t *"
          },
          {
            "lineNumber": 61,
            "text": "\t * @param  array $params"
          },
          {
            "lineNumber": 62,
            "text": "\t * @return array"
          },
          {
            "lineNumber": 63,
            "text": "\t */"
          },
          {
            "lineNumber": 64,
            "text": "\tpublic function allow_orderby_photo_number( $params ) {"
          },
          {
            "lineNumber": 65,
            "text": "\t\t$params['orderby']['enum'][] = apply_filters( 'invp_prefix_meta_key', 'photo_number' );"
          }
        ],
        "range": {
          "endPosition": {
            "line": 65
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-rest.php",
        "signatures": {}
      },
      "score": 0.3228748142719269
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 137,
            "text": "\t\t\tswitch ( apply_filters( 'invp_unprefix_meta_key', $query-\u003eget( 'meta_key' ) ) ) {"
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\tcase 'make':"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t\t\t'meta_query',"
          },
          {
            "lineNumber": 141,
            "text": "\t\t\t\t\t\tarray_merge("
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t\t\t\t\t$old,"
          },
          {
            "lineNumber": 143,
            "text": "\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 144,
            "text": "\t\t\t\t\t\t\t\t'relation' =\u003e 'AND',"
          },
          {
            "lineNumber": 145,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 146,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 147,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 148,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 149,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 150,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 151,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 152,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 153,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 154,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 155,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 156,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 157,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 158,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 159,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 161,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 162,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 163,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 164,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 165,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 166,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 167,
            "text": "\t\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 169,
            "text": "\t\t\t\t\t);"
          },
          {
            "lineNumber": 170,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 171
          },
          {
            "lineNumber": 172,
            "text": "\t\t\t\tcase 'model':"
          },
          {
            "lineNumber": 173,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 174,
            "text": "\t\t\t\t\t\t'meta_query',"
          },
          {
            "lineNumber": 175,
            "text": "\t\t\t\t\t\tarray_merge("
          },
          {
            "lineNumber": 176,
            "text": "\t\t\t\t\t\t\t$old,"
          },
          {
            "lineNumber": 177,
            "text": "\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 178,
            "text": "\t\t\t\t\t\t\t\t'relation' =\u003e 'AND',"
          },
          {
            "lineNumber": 179,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 180,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 181,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 182,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 183,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 184,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 185,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 186,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 187,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 188,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 189,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 190,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 191,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 192,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 193,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 194,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 195,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 196,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 197,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 198,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 199,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 200,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 201,
            "text": "\t\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 202,
            "text": "\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 203,
            "text": "\t\t\t\t\t);"
          },
          {
            "lineNumber": 204,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 205
          },
          {
            "lineNumber": 206,
            "text": "\t\t\t\tcase 'year':"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 208,
            "text": "\t\t\t\t\t\t'meta_query',"
          }
        ],
        "range": {
          "endPosition": {
            "line": 208
          },
          "startPosition": {
            "line": 136
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.31292930245399475
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 675,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {"
          },
          {
            "lineNumber": 676,
            "text": "\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();"
          },
          {
            "lineNumber": 677,
            "text": "\t\t\t\t$location_meta-\u003eadd_hooks();"
          },
          {
            "lineNumber": 678,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 679
          },
          {
            "lineNumber": 680,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 681,
            "text": "\t\t\t * Some custom rewrite rules are created and destroyed"
          },
          {
            "lineNumber": 682,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 683
          },
          {
            "lineNumber": 684,
            "text": "\t\t\t// Add custom rewrite rules."
          },
          {
            "lineNumber": 685,
            "text": "\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );"
          },
          {
            "lineNumber": 686
          },
          {
            "lineNumber": 687,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 688,
            "text": "\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are"
          },
          {
            "lineNumber": 689,
            "text": "\t\t\t * flushed to add and remove our custom rewrite rules"
          },
          {
            "lineNumber": 690,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 691
          },
          {
            "lineNumber": 692,
            "text": "\t\t\t// Flush rewrite rules when the plugin is activated."
          },
          {
            "lineNumber": 693,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );"
          },
          {
            "lineNumber": 694
          },
          {
            "lineNumber": 695,
            "text": "\t\t\t// Set default settings values."
          },
          {
            "lineNumber": 696,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );"
          },
          {
            "lineNumber": 697
          },
          {
            "lineNumber": 698,
            "text": "\t\t\t// Delete an option during deactivation."
          },
          {
            "lineNumber": 699,
            "text": "\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );"
          },
          {
            "lineNumber": 700
          },
          {
            "lineNumber": 701,
            "text": "\t\t\t// Register some widgets included with this plugin."
          },
          {
            "lineNumber": 702,
            "text": "\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );"
          },
          {
            "lineNumber": 703
          },
          {
            "lineNumber": 704,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 705,
            "text": "\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of"
          },
          {
            "lineNumber": 706,
            "text": "\t\t\t * the query that's fetching post objects."
          },
          {
            "lineNumber": 707,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 708,
            "text": "\t\t\tif ( ! is_admin() ) {"
          },
          {
            "lineNumber": 709,
            "text": "\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );"
          },
          {
            "lineNumber": 710,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 711
          },
          {
            "lineNumber": 712,
            "text": "\t\t\t// Register scripts and styles."
          },
          {
            "lineNumber": 713,
            "text": "\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 714,
            "text": "\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 715,
            "text": "\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );"
          },
          {
            "lineNumber": 716
          },
          {
            "lineNumber": 717,
            "text": "\t\t\t// Allow custom fields to be searched."
          },
          {
            "lineNumber": 718,
            "text": "\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {"
          },
          {
            "lineNumber": 719,
            "text": "\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();"
          },
          {
            "lineNumber": 720,
            "text": "\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();"
          },
          {
            "lineNumber": 721,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 722
          },
          {
            "lineNumber": 723,
            "text": "\t\t\t// Redirect URLs by VINs to proper vehicle permalinks."
          },
          {
            "lineNumber": 724,
            "text": "\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {"
          },
          {
            "lineNumber": 725,
            "text": "\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();"
          }
        ],
        "range": {
          "endPosition": {
            "line": 725
          },
          "startPosition": {
            "line": 674
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.3112579882144928
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 114,
            "text": "\t\tif ( $have_posts ) {"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\twhile ( $vehicles_query-\u003ehave_posts() ) {"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t\t$vehicles_query-\u003ethe_post();"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t\t$shortcode = sprintf( '[invp_archive_vehicle show_titles=\"%s\" style=\"%s\"]', esc_attr( strval( $atts['show_titles'] ) ), esc_attr( $atts['style'] ) );"
          },
          {
            "lineNumber": 118,
            "text": "\t\t\t\t$output   .= apply_shortcodes( $shortcode );"
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 120
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t * Paged navigation. Overwrite the global query with this shortcode's"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t * query so the core pagination functions work as expected. The"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t * query is rest on the following line outside this condition block."
          },
          {
            "lineNumber": 125,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 126,
            "text": "\t\t\tglobal $wp_query;"
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t$wp_query = $vehicles_query;"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t$output  .= INVP::get_paging_html();"
          },
          {
            "lineNumber": 129,
            "text": "\t\t} else {"
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t/**"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t * Do not encourage the user to search if there are zero vehicles."
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t * This query could be a filtered result that's empty, so check"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t * explicitly."
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t */"
          },
          {
            "lineNumber": 135,
            "text": "\t\t\t$vehicle_count = INVP::vehicle_count();"
          },
          {
            "lineNumber": 136,
            "text": "\t\t\tif ( 0 \u003c $vehicle_count ) {"
          },
          {
            "lineNumber": 137,
            "text": "\t\t\t\t$output .= apply_filters("
          },
          {
            "lineNumber": 138,
            "text": "\t\t\t\t\t'invp_archive_shortcode_no_results',"
          },
          {
            "lineNumber": 139,
            "text": "\t\t\t\t\tsprintf("
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t\t\t\t'\u003cp\u003e%s\u003c/p\u003e\u003ch2\u003e%s\u003c/h2\u003e\u003cp\u003e%s\u003c/p\u003e',"
          },
          {
            "lineNumber": 141,
            "text": "\t\t\t\t\t\tesc_html__( 'No vehicles found.', 'inventory-presser' ),"
          },
          {
            "lineNumber": 142,
            "text": "\t\t\t\t\t\tesc_html__( 'Search Inventory', 'inventory-presser' ),"
          },
          {
            "lineNumber": 143,
            "text": "\t\t\t\t\t\tapply_filters( 'invp_archive_shortcode_no_results_search', get_search_form() )"
          },
          {
            "lineNumber": 144,
            "text": "\t\t\t\t\t)"
          },
          {
            "lineNumber": 145,
            "text": "\t\t\t\t);"
          },
          {
            "lineNumber": 146,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 147,
            "text": "\t\t}"
          },
          {
            "lineNumber": 148
          },
          {
            "lineNumber": 149,
            "text": "\t\t// Restore original query \u0026 post data."
          },
          {
            "lineNumber": 150,
            "text": "\t\twp_reset_query();"
          },
          {
            "lineNumber": 151
          },
          {
            "lineNumber": 152,
            "text": "\t\treturn $output . apply_filters( 'invp_archive_shortcode_after', '', $have_posts, $atts );"
          },
          {
            "lineNumber": 153,
            "text": "\t}"
          },
          {
            "lineNumber": 154,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 154
          },
          "startPosition": {
            "line": 113
          }
        },
        "relativeWorkspacePath": "./includes/shortcode/class-shortcode-archive.php",
        "signatures": {}
      },
      "score": 0.30445700883865356
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 802,
            "text": "= 3.2.0 ="
          },
          {
            "lineNumber": 803,
            "text": "* [Added] When shoppers navigate to vehicles that are no longer on the site, redirect them to an archive page of all vehicles of the same make"
          },
          {
            "lineNumber": 804,
            "text": "* [Added] Make it easy for themes to include Schema.org structured data for vehicles via a new method on our vehicle class"
          },
          {
            "lineNumber": 805,
            "text": "* [Added] Include custom taxonomy names and slugs in searches, so searches for \"suv\" and \"diesel\" are now possible"
          },
          {
            "lineNumber": 806,
            "text": "* [Added] A mower vehicle type is now populated in the Type taxonomy"
          },
          {
            "lineNumber": 807,
            "text": "* [Changed] Now prioritizes featured vehicles when filling the slider"
          },
          {
            "lineNumber": 808,
            "text": "* [Changed] Tested up to date to 4.8.1"
          },
          {
            "lineNumber": 809,
            "text": "* [Fixed] A vehicle class member was typoed as drivetrain and changed to drivetype"
          },
          {
            "lineNumber": 810,
            "text": "* [Removed] An unused theme-specific setting that allowed the footer link text to be overriden has been removed from the options page"
          },
          {
            "lineNumber": 811
          },
          {
            "lineNumber": 812,
            "text": "= 3.1.0 ="
          },
          {
            "lineNumber": 813,
            "text": "* Adds a filter hook to the VIN input box on the edit vehicle screen in the dashboard. This permits our newest add-on plugin, [a VIN decoder](https://inventorypresser.com/products/plugins/vin-decoder/), to place a \"Decode VIN\" button adjacent to the VIN text box."
          },
          {
            "lineNumber": 814,
            "text": "* Adds an empty drop down option to the model year selector on the edit vehicle screen in the dashboard. Previously, new vehicle entries would save the current year if the user makes no selection."
          },
          {
            "lineNumber": 815,
            "text": "* Screenshots are updated"
          },
          {
            "lineNumber": 816
          },
          {
            "lineNumber": 817,
            "text": "= 3.0.0 ="
          },
          {
            "lineNumber": 818,
            "text": "* Consolidates all settings under the Vehicles custom post type menu submenu Options. This saves the default sort field and order in a different location, so those values will need to be migrated when upgrading."
          },
          {
            "lineNumber": 819
          },
          {
            "lineNumber": 820,
            "text": "= 2.3.5 ="
          },
          {
            "lineNumber": 821,
            "text": "* Use save_post_inventory_vehicle instead of save_post and then a check to make sure we are working on our post type"
          },
          {
            "lineNumber": 822,
            "text": "* Bug fix for the parameters passed into the save_post/save_post_{post-type} action handler"
          },
          {
            "lineNumber": 823,
            "text": "* Skip the extra stuff that happens when vehicles are saved if the vehicle was just moved to the trash"
          },
          {
            "lineNumber": 824
          },
          {
            "lineNumber": 825,
            "text": "= 2.3.4 ="
          },
          {
            "lineNumber": 826,
            "text": "* Bug fix to not modify ORDER BY clauses on term queries for model years and cylinder counts when no order is specified"
          },
          {
            "lineNumber": 827
          },
          {
            "lineNumber": 828,
            "text": "= 2.3.3 ="
          },
          {
            "lineNumber": 829,
            "text": "* Bug fix in Order By Post Meta widget. A bad string concatenation prevented the output of list items and links."
          },
          {
            "lineNumber": 830,
            "text": "* Bug fix while editing vehicles in the Dashboard. The last modified date was not being saved with the correct timezone offset."
          }
        ],
        "range": {
          "endPosition": {
            "line": 830
          },
          "startPosition": {
            "line": 800
          }
        },
        "relativeWorkspacePath": "./changelog.txt",
        "signatures": {}
      },
      "score": 0.3021082878112793
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 204,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 205
          },
          {
            "lineNumber": 206,
            "text": "\t\t\t\tcase 'year':"
          },
          {
            "lineNumber": 207,
            "text": "\t\t\t\t\t$query-\u003eset("
          },
          {
            "lineNumber": 208,
            "text": "\t\t\t\t\t\t'meta_query',"
          },
          {
            "lineNumber": 209,
            "text": "\t\t\t\t\t\tarray_merge("
          },
          {
            "lineNumber": 210,
            "text": "\t\t\t\t\t\t\t$old,"
          },
          {
            "lineNumber": 211,
            "text": "\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 212,
            "text": "\t\t\t\t\t\t\t\t'relation' =\u003e 'AND',"
          },
          {
            "lineNumber": 213,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 214,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 215,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 216,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 217,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 218,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 219,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 220,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'year' ),"
          },
          {
            "lineNumber": 221,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 222,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 223,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 224,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 225,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 226,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 227,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 228,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 229,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 230,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 231,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'make' ),"
          },
          {
            "lineNumber": 232,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 233,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 234,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 235,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 236,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 237,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 238,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 239,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 240,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 241,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 242,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'model' ),"
          },
          {
            "lineNumber": 243,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 244,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 245,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 246,
            "text": "\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 247,
            "text": "\t\t\t\t\t\t\t\t\t'relation' =\u003e 'OR',"
          },
          {
            "lineNumber": 248,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 249,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 250,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'NOT EXISTS',"
          },
          {
            "lineNumber": 251,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 252,
            "text": "\t\t\t\t\t\t\t\t\tarray("
          },
          {
            "lineNumber": 253,
            "text": "\t\t\t\t\t\t\t\t\t\t'key'     =\u003e apply_filters( 'invp_prefix_meta_key', 'trim' ),"
          },
          {
            "lineNumber": 254,
            "text": "\t\t\t\t\t\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 255,
            "text": "\t\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 256,
            "text": "\t\t\t\t\t\t\t\t),"
          },
          {
            "lineNumber": 257,
            "text": "\t\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 258,
            "text": "\t\t\t\t\t\t)"
          },
          {
            "lineNumber": 259,
            "text": "\t\t\t\t\t);"
          },
          {
            "lineNumber": 260,
            "text": "\t\t\t\t\tbreak;"
          },
          {
            "lineNumber": 261
          },
          {
            "lineNumber": 262,
            "text": "\t\t\t\t// Boat fields might not exist on all vehicles. Do not require them."
          },
          {
            "lineNumber": 263,
            "text": "\t\t\t\tcase 'beam':"
          },
          {
            "lineNumber": 264,
            "text": "\t\t\t\tcase 'condition_boat':"
          },
          {
            "lineNumber": 265,
            "text": "\t\t\t\tcase 'draft':"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\t\tcase 'engine_count':"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\t\tcase 'engine_make':"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t\tcase 'engine_model':"
          },
          {
            "lineNumber": 269,
            "text": "\t\t\t\tcase 'horsepower':"
          },
          {
            "lineNumber": 270,
            "text": "\t\t\t\tcase 'hull_material':"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\tcase 'length':"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\t\t$query-\u003eset( 'meta_key', '' );"
          }
        ],
        "range": {
          "endPosition": {
            "line": 272
          },
          "startPosition": {
            "line": 203
          }
        },
        "relativeWorkspacePath": "./inventory-presser.php",
        "signatures": {}
      },
      "score": 0.2975198030471802
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 71,
            "text": "\t\t\t\texit;"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 73,
            "text": "\t\t}"
          },
          {
            "lineNumber": 74
          },
          {
            "lineNumber": 75,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 76,
            "text": "\t\t * Takes a VIN and finds its permalink. If the vehicle is not in"
          },
          {
            "lineNumber": 77,
            "text": "\t\t * inventory, the vehicle archive URL is returned."
          },
          {
            "lineNumber": 78,
            "text": "\t\t *"
          },
          {
            "lineNumber": 79,
            "text": "\t\t * @param  string $vin A vehicle identification number."
          },
          {
            "lineNumber": 80,
            "text": "\t\t * @return string A vehicle permalink or the link to the vehicle archive."
          },
          {
            "lineNumber": 81,
            "text": "\t\t */"
          },
          {
            "lineNumber": 82,
            "text": "\t\tprotected function find_vehicle_url( $vin ) {"
          },
          {
            "lineNumber": 83,
            "text": "\t\t\t$posts = get_posts("
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 85,
            "text": "\t\t\t\t\t'post_type'   =\u003e INVP::POST_TYPE,"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t\t\t'post_status' =\u003e 'publish',"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\t\t\t'meta_key'    =\u003e apply_filters( 'invp_prefix_meta_key', 'vin' ),"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t\t\t'meta_value'  =\u003e $vin,"
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\t)"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 91,
            "text": "\t\t\tif ( 1 === count( $posts ) ) {"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t\treturn get_permalink( $posts[0] );"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\treturn get_post_type_archive_link( INVP::POST_TYPE );"
          },
          {
            "lineNumber": 95,
            "text": "\t\t}"
          },
          {
            "lineNumber": 96,
            "text": "\t}"
          },
          {
            "lineNumber": 97,
            "text": "}"
          }
        ],
        "range": {
          "endPosition": {
            "line": 97
          },
          "startPosition": {
            "line": 70
          }
        },
        "relativeWorkspacePath": "./includes/class-vehicle-urls-by-vin.php",
        "signatures": {}
      },
      "score": 0.29744744300842285
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "/**"
          },
          {
            "lineNumber": 3,
            "text": " * Vehicle_URLs_By_VIN"
          },
          {
            "lineNumber": 4,
            "text": " *"
          },
          {
            "lineNumber": 5,
            "text": " * This class redirects URLs based on a VIN to proper permalinks"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * Create a redirect that takes a URL like this:"
          },
          {
            "lineNumber": 8,
            "text": " * https://demo.inventorypresser.com/vin/JM1NB354940406328/ and redirects to the post that"
          },
          {
            "lineNumber": 9,
            "text": " * lives at some permalink like"
          },
          {
            "lineNumber": 10,
            "text": " * https://demo.inventorypresser.com/inventory/2004-mazda-speed-miata/"
          },
          {
            "lineNumber": 11,
            "text": " *"
          },
          {
            "lineNumber": 12,
            "text": " * @since      1.2.1"
          },
          {
            "lineNumber": 13,
            "text": " * @package inventory-presser"
          },
          {
            "lineNumber": 14,
            "text": " * @subpackage inventory-presser/includes"
          },
          {
            "lineNumber": 15,
            "text": " * @author     Corey Salzano \u003ccorey@friday.systems\u003e, John Norton \u003cnorton@fridaynet.com\u003e"
          },
          {
            "lineNumber": 16,
            "text": " */"
          },
          {
            "lineNumber": 17
          },
          {
            "lineNumber": 18,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 19
          },
          {
            "lineNumber": 20,
            "text": "if ( ! class_exists( 'Vehicle_URLs_By_VIN' ) ) {"
          },
          {
            "lineNumber": 21
          },
          {
            "lineNumber": 22,
            "text": "\t/**"
          },
          {
            "lineNumber": 23,
            "text": "\t * Vehicle_URLs_By_VIN"
          },
          {
            "lineNumber": 24,
            "text": "\t */"
          },
          {
            "lineNumber": 25,
            "text": "\tclass Vehicle_URLs_By_VIN {"
          },
          {
            "lineNumber": 26
          },
          {
            "lineNumber": 27,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 28,
            "text": "\t\t * Adds hooks that power the URL redirects."
          },
          {
            "lineNumber": 29,
            "text": "\t\t *"
          },
          {
            "lineNumber": 30,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 31,
            "text": "\t\t */"
          },
          {
            "lineNumber": 32,
            "text": "\t\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 33,
            "text": "\t\t\tadd_filter( 'invp_rewrite_rules', array( $this, 'add_vin_rewrite_rule' ) );"
          },
          {
            "lineNumber": 34,
            "text": "\t\t\tadd_filter( 'query_vars', array( $this, 'add_query_vars' ) );"
          },
          {
            "lineNumber": 35,
            "text": "\t\t\tadd_action( 'template_redirect', array( $this, 'redirect_vin_urls' ) );"
          },
          {
            "lineNumber": 36,
            "text": "\t\t}"
          },
          {
            "lineNumber": 37
          },
          {
            "lineNumber": 38,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 39,
            "text": "\t\t * Adds a rewrite rule to redirect URLs like https://demo.inventorypresser.com/vin/JM1NB354940406328/"
          },
          {
            "lineNumber": 40,
            "text": "\t\t *"
          },
          {
            "lineNumber": 41,
            "text": "\t\t * @param  array $rules An array of rewrite rules."
          },
          {
            "lineNumber": 42,
            "text": "\t\t * @return array"
          },
          {
            "lineNumber": 43,
            "text": "\t\t */"
          },
          {
            "lineNumber": 44,
            "text": "\t\tpublic function add_vin_rewrite_rule( $rules ) {"
          },
          {
            "lineNumber": 45,
            "text": "\t\t\t// Allow VINs as short as five digits because classic cars."
          },
          {
            "lineNumber": 46,
            "text": "\t\t\t$rules['^vin/([A-Z0-9]{5,17})/?$'] = 'index.php?vin=$matches[1]';"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\treturn $rules;"
          },
          {
            "lineNumber": 48,
            "text": "\t\t}"
          },
          {
            "lineNumber": 49
          },
          {
            "lineNumber": 50,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 51,
            "text": "\t\t * Adds 'vin' to the list of recognized query variables."
          },
          {
            "lineNumber": 52,
            "text": "\t\t *"
          },
          {
            "lineNumber": 53,
            "text": "\t\t * @param  array $vars An array of query variables."
          },
          {
            "lineNumber": 54,
            "text": "\t\t * @return array The expanded array of query variables"
          },
          {
            "lineNumber": 55,
            "text": "\t\t */"
          },
          {
            "lineNumber": 56,
            "text": "\t\tpublic function add_query_vars( $vars ) {"
          },
          {
            "lineNumber": 57,
            "text": "\t\t\t$vars[] = 'vin';"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\treturn $vars;"
          },
          {
            "lineNumber": 59,
            "text": "\t\t}"
          },
          {
            "lineNumber": 60
          },
          {
            "lineNumber": 61,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 62,
            "text": "\t\t * Redirects the request to a vehicle permalink if a 'vin' query"
          },
          {
            "lineNumber": 63,
            "text": "\t\t * variable is present."
          },
          {
            "lineNumber": 64,
            "text": "\t\t *"
          },
          {
            "lineNumber": 65,
            "text": "\t\t * @return void"
          },
          {
            "lineNumber": 66,
            "text": "\t\t */"
          },
          {
            "lineNumber": 67,
            "text": "\t\tpublic function redirect_vin_urls() {"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\t$vin = get_query_var( 'vin' );"
          },
          {
            "lineNumber": 69,
            "text": "\t\t\tif ( $vin ) {"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\twp_safe_redirect( $this-\u003efind_vehicle_url( $vin ) );"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t\texit;"
          },
          {
            "lineNumber": 72,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 73,
            "text": "\t\t}"
          },
          {
            "lineNumber": 74
          },
          {
            "lineNumber": 75,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 76,
            "text": "\t\t * Takes a VIN and finds its permalink. If the vehicle is not in"
          }
        ],
        "range": {
          "endPosition": {
            "line": 76
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-vehicle-urls-by-vin.php",
        "signatures": {}
      },
      "score": 0.29254400730133057
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1025,
            "text": "\t\t\t$post = array("
          },
          {
            "lineNumber": 1026,
            "text": "\t\t\t\t'post_author'       =\u003e $current_user_id,"
          },
          {
            "lineNumber": 1027,
            "text": "\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,"
          },
          {
            "lineNumber": 1028,
            "text": "\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,"
          },
          {
            "lineNumber": 1029,
            "text": "\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,"
          },
          {
            "lineNumber": 1030,
            "text": "\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,"
          },
          {
            "lineNumber": 1031,
            "text": "\t\t\t\t'post_status'       =\u003e 'publish',"
          },
          {
            "lineNumber": 1032,
            "text": "\t\t\t\t'comment_status'    =\u003e 'closed',"
          },
          {
            "lineNumber": 1033,
            "text": "\t\t\t\t'ping_status'       =\u003e 'closed',"
          },
          {
            "lineNumber": 1034,
            "text": "\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,"
          },
          {
            "lineNumber": 1035,
            "text": "\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,"
          },
          {
            "lineNumber": 1036,
            "text": "\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,"
          },
          {
            "lineNumber": 1037,
            "text": "\t\t\t\t'post_parent'       =\u003e 0,"
          },
          {
            "lineNumber": 1038,
            "text": "\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,"
          },
          {
            "lineNumber": 1039,
            "text": "\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,"
          },
          {
            "lineNumber": 1040,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1041
          },
          {
            "lineNumber": 1042,
            "text": "\t\t\t$id = wp_insert_post( $post );"
          },
          {
            "lineNumber": 1043,
            "text": "\t\t\tforeach ( $options as $option ) {"
          },
          {
            "lineNumber": 1044,
            "text": "\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );"
          },
          {
            "lineNumber": 1045,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1046
          },
          {
            "lineNumber": 1047,
            "text": "\t\t\t$endpoint_media = add_query_arg("
          },
          {
            "lineNumber": 1048,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 1049,
            "text": "\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),"
          },
          {
            "lineNumber": 1050,
            "text": "\t\t\t\t\t'order'   =\u003e 'asc',"
          },
          {
            "lineNumber": 1051,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 1052,
            "text": "\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref"
          },
          {
            "lineNumber": 1053,
            "text": "\t\t\t);"
          },
          {
            "lineNumber": 1054,
            "text": "\t\t\t$response       = wp_remote_get( $endpoint_media );"
          },
          {
            "lineNumber": 1055,
            "text": "\t\t\tif ( is_wp_error( $response ) ) {"
          },
          {
            "lineNumber": 1056,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1057,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1058
          },
          {
            "lineNumber": 1059,
            "text": "\t\t\t$media = json_decode( wp_remote_retrieve_body( $response ) );"
          },
          {
            "lineNumber": 1060,
            "text": "\t\t\tif ( ! is_array( $media ) ) {"
          },
          {
            "lineNumber": 1061,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 1062,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 1063,
            "text": "\t\t\t$media_count = count( $media );"
          },
          {
            "lineNumber": 1064,
            "text": "\t\t\tfor ( $m = 0; $m \u003c $media_count; $m++ ) {"
          },
          {
            "lineNumber": 1065,
            "text": "\t\t\t\t// Download a copy of the image."
          },
          {
            "lineNumber": 1066,
            "text": "\t\t\t\t$media_url = strtok( $media[ $m ]-\u003esource_url, '?' );"
          }
        ],
        "range": {
          "endPosition": {
            "line": 1066
          },
          "startPosition": {
            "line": 1024
          }
        },
        "relativeWorkspacePath": "./includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.29209449887275696
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 43,
            "text": "\t * @return array"
          },
          {
            "lineNumber": 44,
            "text": "\t */"
          },
          {
            "lineNumber": 45,
            "text": "\tpublic function enable_order_by_attachment_count( $pieces, $query ) {"
          },
          {
            "lineNumber": 46,
            "text": "\t\tif ( ! is_admin() ) {"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\treturn $pieces;"
          },
          {
            "lineNumber": 48,
            "text": "\t\t}"
          },
          {
            "lineNumber": 49
          },
          {
            "lineNumber": 50,
            "text": "\t\t/**"
          },
          {
            "lineNumber": 51,
            "text": "\t\t * We only want our code to run in the main WP query"
          },
          {
            "lineNumber": 52,
            "text": "\t\t * AND if an orderby query variable is designated."
          },
          {
            "lineNumber": 53,
            "text": "\t\t */"
          },
          {
            "lineNumber": 54,
            "text": "\t\tif ( $query-\u003eis_main_query() ) {"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\t// Get the order query variable - ASC or DESC."
          },
          {
            "lineNumber": 56,
            "text": "\t\t\t$order = strtoupper( $query-\u003eget( 'order', '' ) );"
          },
          {
            "lineNumber": 57
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t// Make sure the order setting qualifies. If not, set default as ASC."
          },
          {
            "lineNumber": 59,
            "text": "\t\t\tif ( ! in_array( $order, array( 'ASC', 'DESC' ), true ) ) {"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t\t$order = 'ASC';"
          },
          {
            "lineNumber": 61,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 62
          },
          {
            "lineNumber": 63,
            "text": "\t\t\t$orderby = $query-\u003eget( 'orderby', '' );"
          },
          {
            "lineNumber": 64,
            "text": "\t\t\tif ( apply_filters( 'invp_prefix_meta_key', 'photo_count' ) === $orderby"
          },
          {
            "lineNumber": 65,
            "text": "\t\t\t\t|| apply_filters( 'invp_prefix_meta_key', 'thumbnail' ) === $orderby"
          },
          {
            "lineNumber": 66,
            "text": "\t\t\t) {"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t\tglobal $wpdb;"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\t\t$pieces['orderby'] = \"( SELECT COUNT( ID ) FROM {$wpdb-\u003eposts} forget WHERE post_parent = {$wpdb-\u003eposts}.ID ) $order, \" . $pieces['orderby'];"
          },
          {
            "lineNumber": 69,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 70,
            "text": "\t\t}"
          },
          {
            "lineNumber": 71,
            "text": "\t\treturn $pieces;"
          },
          {
            "lineNumber": 72,
            "text": "\t}"
          },
          {
            "lineNumber": 73
          },
          {
            "lineNumber": 74,
            "text": "\t/**"
          },
          {
            "lineNumber": 75,
            "text": "\t * Adds hooks"
          },
          {
            "lineNumber": 76,
            "text": "\t *"
          },
          {
            "lineNumber": 77,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 78,
            "text": "\t */"
          },
          {
            "lineNumber": 79,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 80,
            "text": "\t\tadd_filter( 'posts_clauses', array( $this, 'enable_order_by_attachment_count' ), 1, 2 );"
          },
          {
            "lineNumber": 81
          },
          {
            "lineNumber": 82,
            "text": "\t\t// Add columns to the table that lists all the Vehicles on edit.php."
          },
          {
            "lineNumber": 83,
            "text": "\t\tadd_filter( 'manage_' . INVP::POST_TYPE . '_posts_columns', array( $this, 'add_columns_to_vehicles_table' ) );"
          },
          {
            "lineNumber": 84
          },
          {
            "lineNumber": 85,
            "text": "\t\t// Populate the columns we added to the Vehicles table."
          },
          {
            "lineNumber": 86,
            "text": "\t\tadd_action( 'manage_' . INVP::POST_TYPE . '_posts_custom_column', array( $this, 'populate_columns_we_added_to_vehicles_table' ), 10, 2 );"
          },
          {
            "lineNumber": 87
          },
          {
            "lineNumber": 88,
            "text": "\t\t// Make our added columns to the Vehicles table sortable."
          },
          {
            "lineNumber": 89,
            "text": "\t\tadd_filter( 'manage_edit-' . INVP::POST_TYPE . '_sortable_columns', array( $this, 'make_vehicles_table_columns_sortable' ) );"
          },
          {
            "lineNumber": 90
          },
          {
            "lineNumber": 91,
            "text": "\t\t// Implement the orderby for each of these added columns."
          },
          {
            "lineNumber": 92,
            "text": "\t\tadd_filter( 'pre_get_posts', array( $this, 'vehicles_table_columns_orderbys' ) );"
          },
          {
            "lineNumber": 93
          },
          {
            "lineNumber": 94,
            "text": "\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );"
          },
          {
            "lineNumber": 95,
            "text": "\t}"
          },
          {
            "lineNumber": 96
          },
          {
            "lineNumber": 97,
            "text": "\t/**"
          },
          {
            "lineNumber": 98,
            "text": "\t * Enqueues a stylesheet for the list of vehicles in the dashboard."
          }
        ],
        "range": {
          "endPosition": {
            "line": 98
          },
          "startPosition": {
            "line": 42
          }
        },
        "relativeWorkspacePath": "./includes/admin/class-admin-posts-list.php",
        "signatures": {}
      },
      "score": 0.28937995433807373
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 70,
            "text": "\tpublic function content( $args ) {"
          },
          {
            "lineNumber": 71
          },
          {
            "lineNumber": 72,
            "text": "\t\t// Need the stylesheet for this content."
          },
          {
            "lineNumber": 73,
            "text": "\t\twp_enqueue_style( 'invp-grid' );"
          },
          {
            "lineNumber": 74
          },
          {
            "lineNumber": 75,
            "text": "\t\t$default_args = array("
          },
          {
            "lineNumber": 76,
            "text": "\t\t\t'columns'                 =\u003e 5,     // In how many columns should the tiles be arranged?"
          },
          {
            "lineNumber": 77,
            "text": "\t\t\t'featured_only'           =\u003e false, // Include only featured vehicles?"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t'limit'                   =\u003e 15,    // How many vehicles in the grid maximum?"
          },
          {
            "lineNumber": 79,
            "text": "\t\t\t'make'                    =\u003e '',    // Only show vehicles of this make."
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t'model'                   =\u003e '',    // Only show vehicles of this model."
          },
          {
            "lineNumber": 81,
            "text": "\t\t\t'newest_first'            =\u003e false, // Sort the most recently modified vehicles first?"
          },
          {
            "lineNumber": 82,
            "text": "\t\t\t'priced_first'            =\u003e false, // Sort the vehicles with prices first?"
          },
          {
            "lineNumber": 83,
            "text": "\t\t\t'show_button'             =\u003e false, // Display a \"Full Inventory\" button below the grid?"
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t'show_captions'           =\u003e false, // Show text captions near each photo?"
          },
          {
            "lineNumber": 85,
            "text": "\t\t\t'show_odometers'          =\u003e false, // Show odometers in the captions?"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\t'show_prices'             =\u003e false, // Show prices in the captions?"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\t'suppress_call_for_price' =\u003e false, // When the price setting is {$Price}, this prevents \"Call for price\" in the grid."
          },
          {
            "lineNumber": 88,
            "text": "\t\t);"
          },
          {
            "lineNumber": 89,
            "text": "\t\t$args         = wp_parse_args( $args, $default_args );"
          },
          {
            "lineNumber": 90
          },
          {
            "lineNumber": 91,
            "text": "\t\t// Make sure the limit is not zero or empty string."
          },
          {
            "lineNumber": 92,
            "text": "\t\tif ( empty( $args['limit'] ) ) {"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t$args['limit'] = apply_filters( 'invp_query_limit', 1000, __METHOD__ );"
          },
          {
            "lineNumber": 94,
            "text": "\t\t}"
          },
          {
            "lineNumber": 95
          },
          {
            "lineNumber": 96,
            "text": "\t\t$post_args = array("
          },
          {
            "lineNumber": 97,
            "text": "\t\t\t'posts_per_page' =\u003e $args['limit'],"
          },
          {
            "lineNumber": 98,
            "text": "\t\t\t'post_type'      =\u003e INVP::POST_TYPE,"
          },
          {
            "lineNumber": 99,
            "text": "\t\t\t'meta_query'     =\u003e array("
          },
          {
            "lineNumber": 100,
            "text": "\t\t\t\tarray("
          },
          {
            "lineNumber": 101,
            "text": "\t\t\t\t\t'key'     =\u003e '_thumbnail_id',"
          },
          {
            "lineNumber": 102,
            "text": "\t\t\t\t\t'compare' =\u003e 'EXISTS',"
          },
          {
            "lineNumber": 103,
            "text": "\t\t\t\t),"
          },
          {
            "lineNumber": 104,
            "text": "\t\t\t),"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t'fields'         =\u003e 'ids',"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\t'orderby'        =\u003e 'rand', // Defaults to random order."
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t'order'          =\u003e 'ASC',"
          },
          {
            "lineNumber": 108,
            "text": "\t\t\t'tax_query'      =\u003e array(),"
          },
          {
            "lineNumber": 109,
            "text": "\t\t);"
          },
          {
            "lineNumber": 110
          },
          {
            "lineNumber": 111,
            "text": "\t\tif ( $args['newest_first'] ) {"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t// Change the order to last_modified date."
          }
        ],
        "range": {
          "endPosition": {
            "line": 112
          },
          "startPosition": {
            "line": 69
          }
        },
        "relativeWorkspacePath": "./includes/widget/class-widget-inventory-grid.php",
        "signatures": {}
      },
      "score": 0.28884729743003845
    },
    {
      "codeBlock": {
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Additional_Listings_Pages"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * This class makes additional listings pages work at URL paths other than"
          },
          {
            "lineNumber": 8,
            "text": " * /inventory. For example, a dealer might have some vehicles with down payment"
          },
          {
            "lineNumber": 9,
            "text": " * values while most of their inventory does not have values for down payment,"
          },
          {
            "lineNumber": 10,
            "text": " * and this class makes it easy to put those specific vehicles on a listings"
          },
          {
            "lineNumber": 11,
            "text": " * page together."
          },
          {
            "lineNumber": 12,
            "text": " */"
          },
          {
            "lineNumber": 13,
            "text": "class Inventory_Presser_Additional_Listings_Pages {"
          },
          {
            "lineNumber": 14
          },
          {
            "lineNumber": 15,
            "text": "\t/**"
          },
          {
            "lineNumber": 16,
            "text": "\t * Adds hooks"
          },
          {
            "lineNumber": 17,
            "text": "\t *"
          },
          {
            "lineNumber": 18,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 19,
            "text": "\t */"
          },
          {
            "lineNumber": 20,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 21,
            "text": "\t\tadd_filter( 'invp_rewrite_slugs', array( $this, 'add_rewrite_slugs' ) );"
          },
          {
            "lineNumber": 22,
            "text": "\t\tadd_filter( 'invp_rewrite_rules', array( $this, 'add_rewrite_rules' ) );"
          },
          {
            "lineNumber": 23,
            "text": "\t\tadd_action( 'pre_get_posts', array( $this, 'modify_query' ) );"
          },
          {
            "lineNumber": 24,
            "text": "\t\tadd_filter( 'post_type_archive_title', array( $this, 'change_page_title' ), 10, 2 );"
          },
          {
            "lineNumber": 25,
            "text": "\t}"
          },
          {
            "lineNumber": 26
          },
          {
            "lineNumber": 27,
            "text": "\t/**"
          },
          {
            "lineNumber": 28,
            "text": "\t * Callback on post_type_archive_title. Changes page titles for listings"
          },
          {
            "lineNumber": 29,
            "text": "\t * pages."
          },
          {
            "lineNumber": 30,
            "text": "\t *"
          },
          {
            "lineNumber": 31,
            "text": "\t * @param  mixed $post_type_name Post type 'name' label."
          },
          {
            "lineNumber": 32,
            "text": "\t * @param  mixed $post_type Post type."
          },
          {
            "lineNumber": 33,
            "text": "\t * @return string"
          },
          {
            "lineNumber": 34,
            "text": "\t */"
          },
          {
            "lineNumber": 35,
            "text": "\tpublic function change_page_title( $post_type_name, $post_type ) {"
          },
          {
            "lineNumber": 36,
            "text": "\t\tif ( ! class_exists( 'INVP' ) || INVP::POST_TYPE !== $post_type ) {"
          },
          {
            "lineNumber": 37,
            "text": "\t\t\treturn $post_type_name;"
          },
          {
            "lineNumber": 38,
            "text": "\t\t}"
          },
          {
            "lineNumber": 39
          },
          {
            "lineNumber": 40,
            "text": "\t\tglobal $wp;"
          },
          {
            "lineNumber": 41,
            "text": "\t\tforeach ( self::additional_listings_pages_array() as $additional_listing ) {"
          },
          {
            "lineNumber": 42,
            "text": "\t\t\t// is this rule valid and active?"
          },
          {
            "lineNumber": 43,
            "text": "\t\t\tif ( ! self::is_valid_rule( $additional_listing )"
          },
          {
            "lineNumber": 44,
            "text": "\t\t\t\t|| ! self::is_active_rule( $additional_listing ) ) {"
          },
          {
            "lineNumber": 45,
            "text": "\t\t\t\tcontinue;"
          },
          {
            "lineNumber": 46,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 47
          },
          {
            "lineNumber": 48,
            "text": "\t\t\t// our URL path will match the beginning of the rewrite rule."
          },
          {
            "lineNumber": 49,
            "text": "\t\t\tif ( substr( $wp-\u003ematched_rule, 0, strlen( $additional_listing['url_path'] ) ) === $additional_listing['url_path']"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t\t\u0026\u0026 ! empty( $additional_listing['title'] ) ) {"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t\treturn $additional_listing['title'];"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t}"
          },
          {
            "lineNumber": 53,
            "text": "\t\t}"
          },
          {
            "lineNumber": 54,
            "text": "\t\treturn $post_type_name;"
          },
          {
            "lineNumber": 55,
            "text": "\t}"
          },
          {
            "lineNumber": 56
          },
          {
            "lineNumber": 57,
            "text": "\t/**"
          },
          {
            "lineNumber": 58,
            "text": "\t * Adds rewrite rules so WordPress recognizes the places where users want"
          },
          {
            "lineNumber": 59,
            "text": "\t * the additional listing pages to live."
          },
          {
            "lineNumber": 60,
            "text": "\t *"
          },
          {
            "lineNumber": 61,
            "text": "\t * @param  array $rules"
          },
          {
            "lineNumber": 62,
            "text": "\t * @return array"
          },
          {
            "lineNumber": 63,
            "text": "\t */"
          },
          {
            "lineNumber": 64,
            "text": "\tpublic function add_rewrite_rules( $rules ) {"
          },
          {
            "lineNumber": 65,
            "text": "\t\tforeach ( self::additional_listings_pages_array() as $additional_listing ) {"
          },
          {
            "lineNumber": 66,
            "text": "\t\t\t"
          }
        ],
        "range": {
          "endPosition": {
            "column": 3,
            "line": 65
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "./includes/class-additional-listings-pages.php",
        "signatures": {}
      },
      "score": 0.285004585981369
    }
  ]
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="semantic_search_full"><details>
<summary>Tool use: **semantic_search_full**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "drive.type|drive_type"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "drive.type|drive_type",
  "topFiles": [
    {
      "matchCount": 2,
      "uri": "./readme.txt"
    },
    {
      "matchCount": 3,
      "uri": "./includes/template-tags.php"
    },
    {
      "matchCount": 6,
      "uri": "./includes/class-taxonomies.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/class-invp.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/admin/class-admin-options.php"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-es-CL.po"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-es.po"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-nl.po"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-nl_NL.po"
    },
    {
      "matchCount": 8,
      "uri": "./languages/inventory-presser-en-GB.po"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser.pot"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-es-MX.po"
    },
    {
      "matchCount": 4,
      "uri": "./languages/inventory-presser-es-CO.po"
    },
    {
      "matchCount": 8,
      "uri": "./includes/class-schema-org-generator.php"
    },
    {
      "matchCount": 2,
      "uri": "./includes/shortcode/class-shortcode-attribute-table.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/class-taxonomy-overlapper.php"
    },
    {
      "matchCount": 1,
      "uri": "./README.md"
    }
  ],
  "totalFiles": 17,
  "totalMatches": 61
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "pre_get_posts|post_type.*search|is_search"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "pre_get_posts|post_type.*search|is_search",
  "topFiles": [
    {
      "matchCount": 1,
      "uri": "./inventory-presser.php"
    },
    {
      "matchCount": 2,
      "uri": "./includes/class-taxonomies.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/admin/class-admin-posts-list.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/shortcode/class-shortcode-sort-by.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/class-add-custom-fields-to-search.php"
    },
    {
      "matchCount": 2,
      "uri": "./includes/class-range-filters.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/class-allow-inventory-as-home-page.php"
    },
    {
      "matchCount": 1,
      "uri": "./includes/class-additional-listings-pages.php"
    }
  ],
  "totalFiles": 8,
  "totalMatches": 12
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomy-overlapper.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "contextAfter": 1,
  "contextBefore": 1,
  "glob": "*.php",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "post_type|INVP::POST_TYPE"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "post_type|INVP::POST_TYPE",
  "topFiles": [
    {
      "matchCount": 6,
      "uri": "./includes/shortcode/class-shortcode-inventory-slider.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/admin/class-admin-menus.php"
    },
    {
      "matchCount": 101,
      "uri": "./inventory-presser.php"
    },
    {
      "matchCount": 12,
      "uri": "./includes/template-tags.php"
    },
    {
      "matchCount": 14,
      "uri": "./includes/class-rest.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/class-blocks.php"
    },
    {
      "matchCount": 30,
      "uri": "./includes/class-taxonomies.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/class-site-health.php"
    },
    {
      "matchCount": 44,
      "uri": "./includes/integrations/class-classic-editor.php"
    },
    {
      "matchCount": 9,
      "uri": "./includes/integrations/class-wp-all-import.php"
    },
    {
      "matchCount": 9,
      "uri": "./includes/integrations/class-contact-form-7.php"
    },
    {
      "matchCount": 30,
      "uri": "./includes/class-invp.php"
    },
    {
      "matchCount": 28,
      "uri": "./includes/admin/class-admin-photo-arranger.php"
    },
    {
      "matchCount": 43,
      "uri": "./includes/admin/class-admin-options.php"
    },
    {
      "matchCount": 13,
      "uri": "./includes/admin/class-admin-posts-list.php"
    },
    {
      "matchCount": 16,
      "uri": "./includes/class-template-provider.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/shortcode/class-shortcode-single-vehicle.php"
    },
    {
      "matchCount": 6,
      "uri": "./includes/shortcode/class-shortcode-archive.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/widget/class-widget-maximum-price-filter.php"
    },
    {
      "matchCount": 3,
      "uri": "./includes/widget/class-widget-inventory-slider.php"
    }
  ],
  "totalFiles": 41,
  "totalMatches": 211
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomies.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Investigating search behavior**

WordPress search defaults to 'post' post type, not vehicles, so the search isn't finding vehicle listings. </details></think>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "contextAfter": 2,
  "contextBefore": 2,
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/inventory-presser.php",
  "pattern": "search|post_type"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/inventory-presser.php",
  "pattern": "search|post_type",
  "topFiles": [
    {
      "matchCount": 140,
      "uri": "inventory-presser.php"
    }
  ],
  "totalFiles": 1,
  "totalMatches": 33
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="web_search">
<details>
<summary>Tool use: **web_search**</summary>


Parameters:

```json
{
  "searchTerm": "WordPress default search query post_type what does it search"
}
```
Result:

```json
{
  "isFinal": true,
  "references": [
    {
      "chunk": "Links:\n1. [How WP_Query performs a Wordpress search - WPSOLR](https://wpsolr.com/wp_query-guide-how-default-wordpress-search-works)\n2. [What exactly does the 's' parameter search for in WP queries?](https://wordpress.stackexchange.com/questions/189494/what-exactly-does-the-s-parameter-search-for-in-wp-queries)\n3. [How to make a WP_Query search with custom post types?](https://wordpress.stackexchange.com/questions/134537/how-to-make-a-wp-query-search-with-custom-post-types)\n4. [WP_Query::parse_search(  array   $q  ):  string](https://developer.wordpress.org/reference/classes/wp_query/parse_search)\n5. [WP_Query::parse_query() – Method | Developer.WordPress.org](https://developer.wordpress.org/reference/classes/wp_query/parse_query)\n\n# WordPress Default Search Query - What Gets Searched\n\nBy default, WordPress search (using the 's' parameter in WP_Query) searches **three post fields**:[4]\n\n1. **Post Title** (&#96;post_title&#96;)\n2. **Post Excerpt** (&#96;post_excerpt&#96;)\n3. **Post Content** (&#96;post_content&#96;)\n\n## How It Works\n\nWhen you use the 's' parameter in a query like &#96;'s' =\u003e 'keyword'&#96;, WordPress uses the &#96;WP_Query::parse_search()&#96; method to generate SQL that searches these fields using LIKE operators.[1][2] For example, the resulting SQL looks like:[2]\n\n&#96;&#96;&#96;\nWHERE (post_title LIKE '%keyword%' OR post_content LIKE '%keyword%')\n&#96;&#96;&#96;\n\n## Important Note\n\nBy default, WordPress search only searches standard **'post'** and **'page'** post types.[2][3] If you need to search custom post types, you must explicitly specify them using the &#96;'post_type'&#96; parameter, as WordPress will override any custom post type specification when the 's' parameter is used without this being explicitly set.[3]\n\nYou can customize which columns are searched using the &#96;'search_columns'&#96; parameter or the &#96;'post_search_columns'&#96; filter.[4]",
      "title": "Web search results for query: WordPress default search query post_type what does it search"
    }
  ],
  "rejected": false
}
```
User decision: **accepted**

Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="web_search"><details>
<summary>Tool use: **web_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Confirming search behavior**

WordPress search by default only looks in posts and pages, not custom post types like vehicles. </details></think>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/inventory-presser.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "exclude_from_search|publicly_queryable"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
  "pattern": "exclude_from_search|publicly_queryable",
  "topFiles": [],
  "totalFiles": 0,
  "totalMatches": 0
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Checking WordPress defaults**

I need to verify the default value of `exclude_from_search` when `public` is true in WordPress. The `exclude_from_search` default is false when `public` is true, so vehicles are included in search results. I confirmed that WordPress search includes custom post types with `exclude_from_search` set to false by default. 

**Checking search behavior**

I realized the search might use LIKE on meta_value instead of exact term matching. The meta stores term names, not slugs, so search terms must match the full term name like 'All-Wheel Drive' rather than the slug 'awd'. </details></think>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomy-overlapper.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

```json
{
  "caseInsensitive": false,
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomy-overlapper.php",
  "pattern": "-\u003ename|-\u003eslug|term-\u003ename"
}
```
Additional data:

```json
{
  "isPruned": true,
  "outputMode": "content",
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomy-overlapper.php",
  "pattern": "-\u003ename|-\u003eslug|term-\u003ename",
  "topFiles": [
    {
      "matchCount": 14,
      "uri": "includes/class-taxonomy-overlapper.php"
    }
  ],
  "totalFiles": 1,
  "totalMatches": 14
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search"><details>
<summary>Tool use: **ripgrep_raw_search**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Fixing taxonomy sync**

I found that taxonomy meta stores term names instead of slugs, causing URL lookup mismatches. I'm investigating term name vs slug discrepancies in taxonomy meta storage. </details></think>

_**Agent (composer-1.5)**_

Checking what drive-type terms look like and how the meta value is stored:


_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/class-taxonomy-overlapper.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/template-tags.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file_v2"><details>
<summary>Tool use: **read_file_v2**</summary>

</details></tool-use>

_**Agent (composer-1.5)**_

<think><details><summary>Thought Process</summary>
**Understanding taxonomy matching**

I understand that taxonomy archives match by term slug while search matches by term name stored in meta_value. </details></think>

_**Agent (composer-1.5)**_

The mismatch comes from how the taxonomy and search use different values for the same term.

**Taxonomy archive (`/inventory/drive-type/awd/`)**  
- Filters by term **slug** (e.g. `awd`).  
- Uses the term relationship tables.

**Search (`?s=awd`)**  
- Uses `LIKE '%awd%'` on `post_title` and `meta_value` via `Add_Custom_Fields_To_Search`.  
- The meta field only ever stores the term **name**, not the slug.

From the overlapper:

```445:449:includes/class-taxonomy-overlapper.php
		// For most taxonomies, we can just save the term name in the post meta field.
		if ( 'availability' !== strtolower( $taxonomy ) ) {
			$this->hooks_remove_meta();
			update_post_meta( $object_id, apply_filters( 'invp_prefix_meta_key', $taxonomies_and_keys[ $taxonomy ] ), $term->name );
			$this->hooks_add_meta();
```

So if the drive type term is:

- **Name:** `All-Wheel Drive`  
- **Slug:** `awd`  

then:

- The taxonomy archive finds those vehicles (slug `awd`).
- The search does not, because `"awd"` is not a substring of `"All-Wheel Drive"`.

If the term name were `AWD`, both would work.

**Summary:** The taxonomy archive matches on the slug; the search matches on the term name in meta. When the name doesn’t contain the slug (e.g. `All-Wheel Drive` vs. `awd`), the two methods return different results. To fix that, either use a term name that includes the slug, or extend the search so it also matches against term slugs in the taxonomy tables.
