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

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

# Vehicle meta fields in plugin (2026-02-12 19:37Z)

_**User**_

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

---

_**Agent (model composer-1.5, mode Agent)**_





---

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


Parameters:

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

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


</details>
</tool-use>

---


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 (model composer-1.5, mode Agent)**_





---

<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>

---


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 (model composer-1.5, mode Agent)**_

<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>

---





---

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


Parameters:

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

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


Parameters:

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

```json
{
  "success": {
    "pattern": "drive.type|drive_type",
    "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
    "outputMode": "content",
    "workspaceResults": {
      "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser": {
        "content": {
          "matches": [
            {
              "file": "./readme.txt",
              "matches": [
                {
                  "lineNumber": 20,
                  "content": "* Categorizes inventory by type, body style, fuel, transmission, drive type, availability, new or used, location, and more"
                },
                {
                  "lineNumber": 44,
                  "content": "* Custom taxonomies group vehicles by year, make, model, type, body style, fuel, transmission, drive type, availability, new or used, location, and more"
                }
              ]
            },
            {
              "file": "./includes/template-tags.php",
              "matches": [
                {
                  "lineNumber": 237,
                  "content": " * Template tag. Returns the drive type, or a description of how many driven"
                },
                {
                  "lineNumber": 243,
                  "content": "function invp_get_the_drive_type( $post_ID = null ) {"
                },
                {
                  "lineNumber": 244,
                  "content": "\treturn INVP::get_meta( 'drive_type', $post_ID );"
                }
              ]
            },
            {
              "file": "./includes/class-taxonomies.php",
              "matches": [
                {
                  "lineNumber": 771,
                  "content": "\t\t\t\t\t\t'search_items'  =&gt; __( 'Search drive types', 'inventory-presser' ),"
                },
                {
                  "lineNumber": 772,
                  "content": "\t\t\t\t\t\t'popular_items' =&gt; __( 'Popular drive types', 'inventory-presser' ),"
                },
                {
                  "lineNumber": 773,
                  "content": "\t\t\t\t\t\t'all_items'     =&gt; __( 'All drive types', 'inventory-presser' ),"
                },
                {
                  "lineNumber": 778,
                  "content": "\t\t\t\t\t\t'back_to_items' =&gt; __( '&amp;larr; Go to drive types', 'inventory-presser' ),"
                },
                {
                  "lineNumber": 781,
                  "content": "\t\t\t\t\t'query_var'      =&gt; 'drive-type',"
                },
                {
                  "lineNumber": 799,
                  "content": "\t\t\t* Propulsion type is essentially drive type for boats"
                }
              ]
            },
            {
              "file": "./includes/class-invp.php",
              "matches": [
                {
                  "lineNumber": 647,
                  "content": "\t\t\t\t\t'name'   =&gt; 'drive_type',"
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-options.php",
              "matches": [
                {
                  "lineNumber": 1292,
                  "content": "\t\t\t'drive-type'      =&gt; array("
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-es-CL.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-es.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-nl.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-nl_NL.po",
              "matches": [
                {
                  "lineNumber": 1330,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1334,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1338,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1713,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-en-GB.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1329,
                  "content": "msgstr \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1333,
                  "content": "msgstr \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1337,
                  "content": "msgstr \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                },
                {
                  "lineNumber": 1712,
                  "content": "msgstr \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser.pot",
              "matches": [
                {
                  "lineNumber": 1064,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1068,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1072,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1092,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-es-MX.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./languages/inventory-presser-es-CO.po",
              "matches": [
                {
                  "lineNumber": 1328,
                  "content": "msgid \"All drive types\""
                },
                {
                  "lineNumber": 1332,
                  "content": "msgid \"Popular drive types\""
                },
                {
                  "lineNumber": 1336,
                  "content": "msgid \"Search drive types\""
                },
                {
                  "lineNumber": 1711,
                  "content": "msgid \"&amp;larr; Go to drive types\""
                }
              ]
            },
            {
              "file": "./includes/class-schema-org-generator.php",
              "matches": [
                {
                  "lineNumber": 48,
                  "content": "\t * Translates our drive type term name into a schema.org vehicle drive"
                },
                {
                  "lineNumber": 51,
                  "content": "\t * @param  string $drive_type A drive type term name like \"Front Wheel Drive\""
                },
                {
                  "lineNumber": 52,
                  "content": "\t * @return string|null A schema.org vehicle drive type string like \"FrontWheelDriveConfiguration\""
                },
                {
                  "lineNumber": 54,
                  "content": "\tprotected function schema_org_drive_type( $drive_type ) {"
                },
                {
                  "lineNumber": 55,
                  "content": "\t\tswitch ( $drive_type ) {"
                },
                {
                  "lineNumber": 147,
                  "content": "\t\t$schema_drive_type = $this-&gt;schema_org_drive_type( invp_get_the_drive_type( $post_ID ) );"
                },
                {
                  "lineNumber": 148,
                  "content": "\t\tif ( null !== $schema_drive_type ) {"
                },
                {
                  "lineNumber": 149,
                  "content": "\t\t\t$obj['driveWheelConfiguration'] = $schema_drive_type;"
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-attribute-table.php",
              "matches": [
                {
                  "lineNumber": 110,
                  "content": "\t\t\t'member' =&gt; 'drive_type',"
                },
                {
                  "lineNumber": 112,
                  "content": "\t\t\t'value'  =&gt; invp_get_the_drive_type( $post_ID ),"
                }
              ]
            },
            {
              "file": "./includes/class-taxonomy-overlapper.php",
              "matches": [
                {
                  "lineNumber": 316,
                  "content": "\t\t\t\t'drive_type'      =&gt; 'drive_type',"
                }
              ]
            },
            {
              "file": "./README.md",
              "matches": [
                {
                  "lineNumber": 24,
                  "content": "* Categorizes inventory by type, body style, fuel, transmission, drive type, for sale or sold, new or used, etc"
                }
              ]
            }
          ],
          "totalLines": 61,
          "totalMatchedLines": 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>


Parameters:

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

```json
{
  "success": {
    "pattern": "pre_get_posts|post_type.*search|is_search",
    "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
    "outputMode": "content",
    "workspaceResults": {
      "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser": {
        "content": {
          "matches": [
            {
              "file": "./inventory-presser.php",
              "matches": [
                {
                  "lineNumber": 709,
                  "content": "\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );"
                }
              ]
            },
            {
              "file": "./includes/class-taxonomies.php",
              "matches": [
                {
                  "lineNumber": 129,
                  "content": "\t\tadd_action( 'pre_get_posts', array( $this, 'maybe_exclude_sold_vehicles' ) );"
                },
                {
                  "lineNumber": 194,
                  "content": "\t\t\t|| ! ( is_search() || is_post_type_archive( INVP::POST_TYPE ) )"
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-posts-list.php",
              "matches": [
                {
                  "lineNumber": 92,
                  "content": "\t\tadd_filter( 'pre_get_posts', array( $this, 'vehicles_table_columns_orderbys' ) );"
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-sort-by.php",
              "matches": [
                {
                  "lineNumber": 177,
                  "content": "\t\t\tadd_action( 'pre_get_posts', array( $this, 'change_price_field_when_sorting' ) );"
                }
              ]
            },
            {
              "file": "./includes/class-add-custom-fields-to-search.php",
              "matches": [
                {
                  "lineNumber": 51,
                  "content": "\t\t\tif ( is_search() ) {"
                },
                {
                  "lineNumber": 69,
                  "content": "\t\t\tif ( ! is_search() || $this-&gt;is_media_library() ) {"
                },
                {
                  "lineNumber": 88,
                  "content": "\t\t\tif ( ! is_search() || $this-&gt;is_media_library() ) {"
                }
              ]
            },
            {
              "file": "./includes/class-range-filters.php",
              "matches": [
                {
                  "lineNumber": 25,
                  "content": "\t\t\tif ( has_action( 'pre_get_posts', array( __CLASS__, 'modify_query_for_price_and_odometer_ranges' ) ) ) {"
                },
                {
                  "lineNumber": 29,
                  "content": "\t\t\tadd_action( 'pre_get_posts', array( __CLASS__, 'modify_query_for_price_and_odometer_ranges' ), 99, 1 );"
                }
              ]
            },
            {
              "file": "./includes/class-allow-inventory-as-home-page.php",
              "matches": [
                {
                  "lineNumber": 152,
                  "content": "\t\tadd_action( 'pre_get_posts', array( $this, 'redirect_the_page' ) );"
                }
              ]
            },
            {
              "file": "./includes/class-additional-listings-pages.php",
              "matches": [
                {
                  "lineNumber": 23,
                  "content": "\t\tadd_action( 'pre_get_posts', array( $this, 'modify_query' ) );"
                }
              ]
            }
          ],
          "totalLines": 12,
          "totalMatchedLines": 12
        }
      }
    }
  }
}
```
Status: **completed**


</details>
</tool-use>

---

<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="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>


Parameters:

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

```json
{
  "success": {
    "pattern": "post_type|INVP::POST_TYPE",
    "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser",
    "outputMode": "content",
    "workspaceResults": {
      "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser": {
        "content": {
          "matches": [
            {
              "file": "./includes/shortcode/class-shortcode-inventory-slider.php",
              "matches": [
                {
                  "lineNumber": 189,
                  "content": "\t\t\t'posts_per_page' =&gt; 10,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 190,
                  "content": "\t\t\t'post_type'      =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 191,
                  "content": "\t\t\t'meta_query'     =&gt; array(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 220,
                  "content": "\t\t\t\t'posts_per_page' =&gt; 10 - ( count( $inventory_ids ) ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 221,
                  "content": "\t\t\t\t'post_type'      =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 222,
                  "content": "\t\t\t\t'meta_query'     =&gt; array(",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-menus.php",
              "matches": [
                {
                  "lineNumber": 206,
                  "content": "\t\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 207,
                  "content": "\t\t\t\t\t'post_type'      =&gt; 'nav_menu_item',"
                },
                {
                  "lineNumber": 208,
                  "content": "\t\t\t\t\t'meta_key'       =&gt; '_invp_location_id',",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./inventory-presser.php",
              "matches": [
                {
                  "lineNumber": 57,
                  "content": "\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 58,
                  "content": "\t\t\t$role-&gt;add_cap( 'delete_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 59,
                  "content": "\t\t\t$role-&gt;add_cap( 'delete_others_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 60,
                  "content": "\t\t\t$role-&gt;add_cap( 'delete_private_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 61,
                  "content": "\t\t\t$role-&gt;add_cap( 'delete_published_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 62,
                  "content": "\t\t\t$role-&gt;add_cap( 'edit_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 63,
                  "content": "\t\t\t$role-&gt;add_cap( 'edit_others_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 64,
                  "content": "\t\t\t$role-&gt;add_cap( 'edit_private_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 65,
                  "content": "\t\t\t$role-&gt;add_cap( 'edit_published_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 66,
                  "content": "\t\t\t$role-&gt;add_cap( 'publish_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 67,
                  "content": "\t\t\t$role-&gt;add_cap( 'read_private_' . INVP::POST_TYPE . 's' );"
                },
                {
                  "lineNumber": 68,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 82,
                  "isContextLine": true
                },
                {
                  "lineNumber": 83,
                  "content": "\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 84,
                  "content": "\t\t\t\treturn;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 336,
                  "content": "\t\t\tglobal $wp_rewrite;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 337,
                  "content": "\t\t\t$wp_rewrite-&gt;rules = $this-&gt;generate_rewrite_rules( INVP::POST_TYPE ) + $wp_rewrite-&gt;rules;"
                },
                {
                  "lineNumber": 338,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 353,
                  "content": "\t\t\t$taxonomy = get_taxonomy( strtolower( $term-&gt;taxonomy ) );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 354,
                  "content": "\t\t\tif ( ! empty( $taxonomy-&gt;object_type ) &amp;&amp; ! in_array( INVP::POST_TYPE, $taxonomy-&gt;object_type, true ) ) {"
                },
                {
                  "lineNumber": 355,
                  "content": "\t\t\t\treturn $termlink;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 357,
                  "isContextLine": true
                },
                {
                  "lineNumber": 358,
                  "content": "\t\t\t$post_type = get_post_type_object( INVP::POST_TYPE );"
                },
                {
                  "lineNumber": 359,
                  "content": "\t\t\tif ( empty( $post_type ) ) {"
                },
                {
                  "lineNumber": 360,
                  "content": "\t\t\t\treturn $termlink;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 362,
                  "isContextLine": true
                },
                {
                  "lineNumber": 363,
                  "content": "\t\t\t$termlink = $post_type-&gt;rewrite['slug'] . $termlink;"
                },
                {
                  "lineNumber": 364,
                  "content": "\t\t\treturn $termlink;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 371,
                  "content": "\t\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 372,
                  "content": "\t\tpublic static function create_post_type() {"
                },
                {
                  "lineNumber": 373,
                  "content": "\t\t\t// creates a custom post type that will be used by this plugin.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 374,
                  "content": "\t\t\tregister_post_type("
                },
                {
                  "lineNumber": 375,
                  "content": "\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 376,
                  "content": "\t\t\t\tapply_filters(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 377,
                  "content": "\t\t\t\t\t'invp_post_type_args',"
                },
                {
                  "lineNumber": 378,
                  "content": "\t\t\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 379,
                  "content": "\t\t\t\t\t\t'capability_type' =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 380,
                  "content": "\t\t\t\t\t\t'map_meta_cap'    =&gt; true,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 435,
                  "content": "\t\tpublic function custom_fields_key_limit( $limit ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 436,
                  "content": "\t\t\tif ( INVP::POST_TYPE !== get_post_type() ) {"
                },
                {
                  "lineNumber": 437,
                  "content": "\t\t\t\treturn $limit;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 473,
                  "content": "\t\t *",
                  "isContextLine": true
                },
                {
                  "lineNumber": 474,
                  "content": "\t\t * @param  array  $args Array of arguments for registering a post type. See the register_post_type() function for accepted arguments."
                },
                {
                  "lineNumber": 475,
                  "content": "\t\t * @param  string $type Post type key.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 477,
                  "content": "\t\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 478,
                  "content": "\t\tpublic function edit_attachment_post_type( $args, $type ) {"
                },
                {
                  "lineNumber": 479,
                  "content": "\t\t\tif ( 'attachment' !== $type ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 492,
                  "content": "\t\tpublic static function flush_rewrite( $network_wide ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 493,
                  "content": "\t\t\tself::create_post_type();"
                },
                {
                  "lineNumber": 494,
                  "isContextLine": true
                },
                {
                  "lineNumber": 519,
                  "content": "\t\t *",
                  "isContextLine": true
                },
                {
                  "lineNumber": 520,
                  "content": "\t\t * @param  string $post_type The name of a post type."
                },
                {
                  "lineNumber": 521,
                  "content": "\t\t * @param  array  $query_vars An array of query variables.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 523,
                  "content": "\t\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 524,
                  "content": "\t\tprotected function generate_rewrite_rules( $post_type, $query_vars = array() ) {"
                },
                {
                  "lineNumber": 525,
                  "content": "\t\t\tglobal $wp_rewrite;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 526,
                  "isContextLine": true
                },
                {
                  "lineNumber": 527,
                  "content": "\t\t\tif ( ! is_object( $post_type ) ) {"
                },
                {
                  "lineNumber": 528,
                  "content": "\t\t\t\t$post_type = get_post_type_object( $post_type );"
                },
                {
                  "lineNumber": 529,
                  "content": "\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 533,
                  "content": "\t\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 534,
                  "content": "\t\t\t\t\t$post_type-&gt;rewrite['slug'],"
                },
                {
                  "lineNumber": 535,
                  "content": "\t\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 558,
                  "content": "\t\t\t\t\t$new_rewrite_rule = $rewrite_slug . '/';",
                  "isContextLine": true
                },
                {
                  "lineNumber": 559,
                  "content": "\t\t\t\t\t$new_query_string = 'index.php?post_type=' . $post_type-&gt;name;"
                },
                {
                  "lineNumber": 560,
                  "isContextLine": true
                },
                {
                  "lineNumber": 650,
                  "content": "\t\t\t// create a custom post type for the vehicles.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 651,
                  "content": "\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );"
                },
                {
                  "lineNumber": 652,
                  "isContextLine": true
                },
                {
                  "lineNumber": 659,
                  "content": "\t\t\t// Filter the attachment post type to make sure &#96;parent&#96; is exposed in the REST API.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 660,
                  "content": "\t\t\tadd_filter( 'register_post_type_args', array( $this, 'edit_attachment_post_type' ), 10, 2 );"
                },
                {
                  "lineNumber": 661,
                  "isContextLine": true
                },
                {
                  "lineNumber": 760,
                  "content": "\t\t\t\t// Everything For Sale because by default we hide other Availabilities like Sold.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 761,
                  "content": "\t\t\t\tadd_action( 'save_post_' . INVP::POST_TYPE, array( $this, 'mark_vehicles_for_sale_during_insertion' ), 10, 3 );"
                },
                {
                  "lineNumber": 762,
                  "content": "\t\t\t\t// Photos are sometimes attached to posts in simultaneous requests.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 763,
                  "content": "\t\t\t\tadd_action( 'save_post_' . INVP::POST_TYPE, array( 'Inventory_Presser_Photo_Numberer', 'renumber_photos' ), 10, 1 );"
                },
                {
                  "lineNumber": 764,
                  "content": "\t\t\t\t// Save custom post meta and term relationships when posts are saved.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 765,
                  "content": "\t\t\t\tadd_action( 'save_post_' . INVP::POST_TYPE, array( $this, 'save_vehicle_post_meta' ), 10, 3 );"
                },
                {
                  "lineNumber": 766,
                  "content": "\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 968,
                  "isContextLine": true
                },
                {
                  "lineNumber": 969,
                  "content": "\t\t\tif ( ! is_post_type_archive( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 970,
                  "content": "\t\t\t\treturn $title_parts;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1023,
                  "isContextLine": true
                },
                {
                  "lineNumber": 1024,
                  "content": "\t\t\t$msgs[ INVP::POST_TYPE ] = array("
                },
                {
                  "lineNumber": 1025,
                  "content": "\t\t\t\t0  =&gt; '',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1287,
                  "content": "\t\t\t\t\t\t\t),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1288,
                  "content": "\t\t\t\t\t\t\t'is_singular'         =&gt; is_singular( INVP::POST_TYPE ), // Used by flexslider.js."
                },
                {
                  "lineNumber": 1289,
                  "content": "\t\t\t\t\t\t\t'meta_prefix'         =&gt; INVP::meta_prefix(), // Used by classic-editor.js &amp; editor-sidebar.js.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1537,
                  "content": "\t\t\t\tsprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1538,
                  "content": "\t\t\t\t\t'edit.php?post_type=%s&amp;page=%s',"
                },
                {
                  "lineNumber": 1539,
                  "content": "\t\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 1540,
                  "content": "\t\t\t\t\tINVP::OPTION_PAGE",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1684,
                  "content": "\t\t\t// is the post a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1685,
                  "content": "\t\t\tif ( INVP::POST_TYPE !== get_post_type( $post_id ) ) {"
                },
                {
                  "lineNumber": 1686,
                  "content": "\t\t\t\treturn;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1712,
                  "content": "\t\t\t\tregister_post_meta(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1713,
                  "content": "\t\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 1714,
                  "content": "\t\t\t\t\t$key,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1832,
                  "content": "\t\t\t// is this a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1833,
                  "content": "\t\t\tif ( ! empty( $_POST['post_type'] ) &amp;&amp; INVP::POST_TYPE !== $_POST['post_type'] ) {"
                },
                {
                  "lineNumber": 1834,
                  "content": "\t\t\t\t// no, don't create any meta data for vehicles.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/template-tags.php",
              "matches": [
                {
                  "lineNumber": 397,
                  "content": "\t\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 398,
                  "content": "\t\t\t\t\t'post_type' =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 399,
                  "content": "\t\t\t\t\t'tax_query' =&gt; array(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 776,
                  "content": "\t\t\t\t'post_parent'    =&gt; $post_ID,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 777,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 778,
                  "content": "\t\t\t\t'posts_per_page' =&gt; apply_filters( 'invp_query_limit', 1000, __FUNCTION__ ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 843,
                  "content": "\t\t\t\t'post_status'    =&gt; 'inherit',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 844,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 845,
                  "content": "\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 862,
                  "content": "\t\t\t\t'post_status'    =&gt; 'inherit',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 863,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 864,
                  "content": "\t\t\t)",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-rest.php",
              "matches": [
                {
                  "lineNumber": 28,
                  "isContextLine": true
                },
                {
                  "lineNumber": 29,
                  "content": "\t\tif ( defined( 'INVP::POST_TYPE' ) ) {"
                },
                {
                  "lineNumber": 30,
                  "content": "\t\t\t// Allow vehicles to be returned in a random order.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 31,
                  "content": "\t\t\tadd_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );"
                },
                {
                  "lineNumber": 32,
                  "isContextLine": true
                },
                {
                  "lineNumber": 33,
                  "content": "\t\t\t// Prevent REST API warnings when vehicles are deleted during request processing.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 34,
                  "content": "\t\t\tadd_filter( 'rest_prepare_' . INVP::POST_TYPE, array( $this, 'handle_null_post' ), 10, 3 );"
                },
                {
                  "lineNumber": 35,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 45,
                  "content": "\t\tregister_rest_field(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 46,
                  "content": "\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 47,
                  "content": "\t\t\t'inventory_type_slugs',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 72,
                  "content": "\t * @param  array        $query_params",
                  "isContextLine": true
                },
                {
                  "lineNumber": 73,
                  "content": "\t * @param  WP_Post_Type $post_type"
                },
                {
                  "lineNumber": 74,
                  "content": "\t * @return array",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-blocks.php",
              "matches": [
                {
                  "lineNumber": 57,
                  "content": "\t\tif ( ! is_admin()",
                  "isContextLine": true
                },
                {
                  "lineNumber": 58,
                  "content": "\t\t\t|| get_post_type() !== INVP::POST_TYPE"
                },
                {
                  "lineNumber": 59,
                  "content": "\t\t\t|| ( 'post-new.php' !== $pagenow &amp;&amp; 'post.php' !== $pagenow ) ) {",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-taxonomies.php",
              "matches": [
                {
                  "lineNumber": 158,
                  "content": "\t\t// Is this a vehicle archive?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 159,
                  "content": "\t\tif ( ! defined( 'INVP::POST_TYPE' ) || ! is_post_type_archive( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 160,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 193,
                  "content": "\t\tif ( is_admin() || ! $query-&gt;is_main_query()",
                  "isContextLine": true
                },
                {
                  "lineNumber": 194,
                  "content": "\t\t\t|| ! ( is_search() || is_post_type_archive( INVP::POST_TYPE ) )"
                },
                {
                  "lineNumber": 195,
                  "content": "\t\t) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 225,
                  "content": "\t\tprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 226,
                  "content": "\t\t\t'%1$s &lt;a href=\"edit-tags.php?taxonomy=%2$s&amp;post_type=%3$s\"&gt;%4$s&lt;/a&gt;',"
                },
                {
                  "lineNumber": 227,
                  "content": "\t\t\tself::taxonomy_meta_box_html( $taxonomy, apply_filters( 'invp_prefix_meta_key', $taxonomy ), $post ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 228,
                  "content": "\t\t\tesc_attr( $taxonomy ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 229,
                  "content": "\t\t\tesc_attr( INVP::POST_TYPE ),"
                },
                {
                  "lineNumber": 230,
                  "content": "\t\t\tesc_html__( 'Manage', 'inventory-presser' )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 242,
                  "content": "\t\t$html     = sprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 243,
                  "content": "\t\t\t'%1$s &lt;a href=\"edit-tags.php?taxonomy=%2$s&amp;post_type=%3$s\"&gt;%4$s&lt;/a&gt;',"
                },
                {
                  "lineNumber": 244,
                  "content": "\t\t\tself::taxonomy_meta_box_html( $taxonomy, apply_filters( 'invp_prefix_meta_key', $taxonomy ), $post ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 245,
                  "content": "\t\t\tesc_attr( $taxonomy ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 246,
                  "content": "\t\t\tesc_attr( INVP::POST_TYPE ),"
                },
                {
                  "lineNumber": 247,
                  "content": "\t\t\tesc_html__( 'Manage', 'inventory-presser' )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 451,
                  "content": "\t\t\t$taxonomy_name = str_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ?? '' );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 452,
                  "content": "\t\t\tregister_taxonomy( $taxonomy_name, INVP::POST_TYPE, $taxonomy_data[ $i ]['args'] );"
                },
                {
                  "lineNumber": 453,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 482,
                  "content": "\t/**",
                  "isContextLine": true
                },
                {
                  "lineNumber": 483,
                  "content": "\t * Used by the save_post_{post_type} hook. Create a term relationship"
                },
                {
                  "lineNumber": 484,
                  "content": "\t * between a post and a term. Inserts the term first if it does not exist.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1244,
                  "content": "\t\tglobal $wp_meta_boxes;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1245,
                  "content": "\t\tif ( ! isset( $wp_meta_boxes[ INVP::POST_TYPE ]['side']['core'] ) ) {"
                },
                {
                  "lineNumber": 1246,
                  "content": "\t\t\treturn;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1267,
                  "content": "\t\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1268,
                  "content": "\t\t\t\tunset( $wp_meta_boxes[ INVP::POST_TYPE ]['side']['core'][ $id ] );"
                },
                {
                  "lineNumber": 1269,
                  "content": "\t\t\t}",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-site-health.php",
              "matches": [
                {
                  "lineNumber": 123,
                  "content": "\t\t\t\t\t'&lt;p&gt;%s&lt;/p&gt;',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 124,
                  "content": "\t\t\t\t\t__( 'No permalink structure has been chosen at Settings → Permalinks. This means the default vehicle archive is located at /?post_type=inventory_vehicle rather than /inventory.', 'inventory-presser' )"
                },
                {
                  "lineNumber": 125,
                  "content": "\t\t\t\t),",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-classic-editor.php",
              "matches": [
                {
                  "lineNumber": 60,
                  "content": "\t\tglobal $pagenow, $current_screen;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 61,
                  "content": "\t\tif ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ), true ) || INVP::POST_TYPE !== $current_screen-&gt;post_type ) {"
                },
                {
                  "lineNumber": 62,
                  "content": "\t\t\t// No. Not adding or editing editing a vehicle.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 88,
                  "content": "\t\t// Add a meta box to the New/Edit post page.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 89,
                  "content": "\t\tadd_meta_box( 'vehicle-meta', 'Attributes', array( $this, 'meta_box_html_vehicle' ), INVP::POST_TYPE, 'normal', 'high' );"
                },
                {
                  "lineNumber": 90,
                  "isContextLine": true
                },
                {
                  "lineNumber": 91,
                  "content": "\t\t// And another for prices.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 92,
                  "content": "\t\tadd_meta_box( 'prices-meta', 'Prices', array( $this, 'meta_box_html_prices' ), INVP::POST_TYPE, 'normal', 'high' );"
                },
                {
                  "lineNumber": 93,
                  "isContextLine": true
                },
                {
                  "lineNumber": 94,
                  "content": "\t\t// Add another meta box to the New/Edit post page.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 95,
                  "content": "\t\tadd_meta_box( 'options-meta', 'Optional equipment', array( $this, 'meta_box_html_options' ), INVP::POST_TYPE, 'normal', 'high' );"
                },
                {
                  "lineNumber": 96,
                  "isContextLine": true
                },
                {
                  "lineNumber": 97,
                  "content": "\t\t// Add a meta box to the side column for a featured vehicle checkbox.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 98,
                  "content": "\t\tadd_meta_box( 'featured', 'Featured Vehicle', array( $this, 'meta_box_html_featured' ), INVP::POST_TYPE, 'side', 'low' );"
                },
                {
                  "lineNumber": 99,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 110,
                  "content": "\t\t$parent = get_post_parent( $id );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 111,
                  "content": "\t\tif ( ! empty( $parent-&gt;post_type ) &amp;&amp; INVP::POST_TYPE !== $parent-&gt;post_type ) {"
                },
                {
                  "lineNumber": 112,
                  "content": "\t\t\treturn $html;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 151,
                  "isContextLine": true
                },
                {
                  "lineNumber": 152,
                  "content": "\t\tif ( INVP::POST_TYPE !== $the_post-&gt;post_type ) {"
                },
                {
                  "lineNumber": 153,
                  "content": "\t\t\treturn '';",
                  "isContextLine": true
                },
                {
                  "lineNumber": 158,
                  "content": "\t\t\t\t'post_parent'    =&gt; $the_post-&gt;ID,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 159,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 160,
                  "content": "\t\t\t\t'posts_per_page' =&gt; apply_filters( 'invp_query_limit', 1000, __METHOD__ ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 222,
                  "content": "\t\t$the_post = get_post( $post-&gt;ID );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 223,
                  "content": "\t\tif ( INVP::POST_TYPE !== $the_post-&gt;post_type ) {"
                },
                {
                  "lineNumber": 224,
                  "content": "\t\t\treturn '';",
                  "isContextLine": true
                },
                {
                  "lineNumber": 228,
                  "content": "\t\t\t\t'post_parent'    =&gt; $the_post-&gt;ID,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 229,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 230,
                  "content": "\t\t\t\t'posts_per_page' =&gt; -1,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 794,
                  "content": "\t\tglobal $post, $wp_meta_boxes;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 795,
                  "content": "\t\t$post_type = get_post_type( $post );"
                },
                {
                  "lineNumber": 796,
                  "isContextLine": true
                },
                {
                  "lineNumber": 797,
                  "content": "\t\tif ( INVP::POST_TYPE !== $post_type ) {"
                },
                {
                  "lineNumber": 798,
                  "content": "\t\t\treturn;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 801,
                  "content": "\t\tdo_meta_boxes( get_current_screen(), 'advanced', $post );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 802,
                  "content": "\t\tunset( $wp_meta_boxes[ get_post_type( $post ) ]['advanced'] );"
                },
                {
                  "lineNumber": 803,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 811,
                  "content": "\t\tglobal $wp_meta_boxes;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 812,
                  "content": "\t\tunset( $wp_meta_boxes[ INVP::POST_TYPE ]['side']['core']['tagsdiv-post_tag'] );"
                },
                {
                  "lineNumber": 813,
                  "content": "\t\tadd_meta_box(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 816,
                  "content": "\t\t\t'post_tags_meta_box',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 817,
                  "content": "\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 818,
                  "content": "\t\t\t'side',",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-wp-all-import.php",
              "matches": [
                {
                  "lineNumber": 42,
                  "content": "\tpublic function do_not_renumber_on_save() {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 43,
                  "content": "\t\tremove_action( 'save_post_' . INVP::POST_TYPE, array( 'Inventory_Presser_Photo_Numberer', 'renumber_photos' ), 10, 1 );"
                },
                {
                  "lineNumber": 44,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 57,
                  "content": "\t\t// Is it a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 58,
                  "content": "\t\tif ( ! class_exists( 'INVP' ) || INVP::POST_TYPE !== get_post_type( $post_id ) ) {"
                },
                {
                  "lineNumber": 59,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 128,
                  "content": "\t\t// Is it a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 129,
                  "content": "\t\tif ( ! class_exists( 'INVP' ) || INVP::POST_TYPE !== get_post_type( $post_id ) ) {"
                },
                {
                  "lineNumber": 130,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-contact-form-7.php",
              "matches": [
                {
                  "lineNumber": 228,
                  "content": "\t\t\t// Is this a vehicle details page?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 229,
                  "content": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 230,
                  "content": "\t\t\t\t// Yes. Return two hidden fields.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 275,
                  "content": "\t\t\t\t\t\t\tLEFT JOIN $wpdb-&gt;postmeta meta3 ON $wpdb-&gt;posts.ID = meta3.post_id",
                  "isContextLine": true
                },
                {
                  "lineNumber": 276,
                  "content": "\t\t\t\tWHERE \t\tpost_type = %s"
                },
                {
                  "lineNumber": 277,
                  "content": "\t\t\t\t\t\t\tAND post_status = 'publish'",
                  "isContextLine": true
                },
                {
                  "lineNumber": 284,
                  "content": "\t\t\t\t\",",
                  "isContextLine": true
                },
                {
                  "lineNumber": 285,
                  "content": "\t\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 286,
                  "content": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-invp.php",
              "matches": [
                {
                  "lineNumber": 155,
                  "content": "\t\t\t'post_status'    =&gt; get_post_stati(),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 156,
                  "content": "\t\t\t'post_type'      =&gt; self::POST_TYPE,"
                },
                {
                  "lineNumber": 157,
                  "content": "\t\t\t'posts_per_page' =&gt; apply_filters( 'invp_query_limit', 1000, __METHOD__ ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 216,
                  "content": "\t\t// Is $post_id a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 217,
                  "content": "\t\tif ( self::POST_TYPE !== get_post_type( $post_id ) ) {"
                },
                {
                  "lineNumber": 218,
                  "content": "\t\t\t// No, abort.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 225,
                  "content": "\t\t\t\t'post_status'    =&gt; 'inherit',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 226,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 227,
                  "content": "\t\t\t\t'posts_per_page' =&gt; apply_filters( 'invp_query_limit', 1000, __METHOD__ ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 249,
                  "content": "\t\t\t\t'post_status'    =&gt; 'any',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 250,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 251,
                  "content": "\t\t\t\t'meta_query'     =&gt; array(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 452,
                  "content": "\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 453,
                  "content": "\t\t\t\t'post_type'      =&gt; self::POST_TYPE,"
                },
                {
                  "lineNumber": 454,
                  "content": "\t\t\t\t'post_status'    =&gt; 'publish',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 466,
                  "content": "\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 467,
                  "content": "\t\t\t\t'post_type'      =&gt; self::POST_TYPE,"
                },
                {
                  "lineNumber": 468,
                  "content": "\t\t\t\t'post_status'    =&gt; 'publish',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1037,
                  "content": "\t\t\t\t'post_parent'       =&gt; 0,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1038,
                  "content": "\t\t\t\t'post_type'         =&gt; $vehicle-&gt;type,"
                },
                {
                  "lineNumber": 1039,
                  "content": "\t\t\t\t'meta_input'        =&gt; (array) $vehicle-&gt;meta,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1089,
                  "content": "\t\t\t\t\t\t'post_modified_gmt' =&gt; $media[ $m ]-&gt;modified_gmt,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1090,
                  "content": "\t\t\t\t\t\t'post_type'         =&gt; $media[ $m ]-&gt;type,"
                },
                {
                  "lineNumber": 1091,
                  "content": "\t\t\t\t\t\t'meta_input'        =&gt; (array) $media[ $m ]-&gt;meta,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1212,
                  "content": "\t\t$object_name    = 'posts';",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1213,
                  "content": "\t\t$post_type_name = $wp_query-&gt;get( 'post_type', '' );"
                },
                {
                  "lineNumber": 1214,
                  "content": "\t\tif ( '' !== $post_type_name ) {"
                },
                {
                  "lineNumber": 1215,
                  "content": "\t\t\t$post_type   = get_post_type_object( $post_type_name );"
                },
                {
                  "lineNumber": 1216,
                  "content": "\t\t\t$object_name = strtolower( $post_type-&gt;labels-&gt;name );"
                },
                {
                  "lineNumber": 1217,
                  "content": "\t\t}",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-photo-arranger.php",
              "matches": [
                {
                  "lineNumber": 39,
                  "content": "\t\t// - update all the sequence numbers to match the gallery order.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 40,
                  "content": "\t\tadd_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'change_parents_and_sequence' ), 10, 2 );"
                },
                {
                  "lineNumber": 41,
                  "content": "\t\t// - unattach photos that are no longer in the gallery",
                  "isContextLine": true
                },
                {
                  "lineNumber": 42,
                  "content": "\t\tadd_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'unattach_when_removed' ), 10, 2 );"
                },
                {
                  "lineNumber": 43,
                  "isContextLine": true
                },
                {
                  "lineNumber": 77,
                  "content": "\t\t// Is the new attachment attached to a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 78,
                  "content": "\t\tif ( empty( $parent-&gt;post_type ) || INVP::POST_TYPE !== $parent-&gt;post_type ) {"
                },
                {
                  "lineNumber": 79,
                  "content": "\t\t\t// Parent post isn't a vehicle.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 198,
                  "content": "\t\t// Don't renumber right after we renumber.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 199,
                  "content": "\t\tremove_action( 'save_post_' . INVP::POST_TYPE, array( 'Inventory_Presser_Photo_Numberer', 'renumber_photos' ), 10, 1 );"
                },
                {
                  "lineNumber": 200,
                  "isContextLine": true
                },
                {
                  "lineNumber": 243,
                  "content": "\t\tif ( ! is_admin()",
                  "isContextLine": true
                },
                {
                  "lineNumber": 244,
                  "content": "\t\t\t|| get_post_type() !== INVP::POST_TYPE"
                },
                {
                  "lineNumber": 245,
                  "content": "\t\t\t|| 'post-new.php' !== $pagenow ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 380,
                  "content": "\t\t// Is the new attachment attached to a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 381,
                  "content": "\t\tif ( empty( $parent-&gt;post_type ) || INVP::POST_TYPE !== $parent-&gt;post_type ) {"
                },
                {
                  "lineNumber": 382,
                  "content": "\t\t\t// Parent post isn't a vehicle.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 457,
                  "content": "\t\t// Don't cause hooks to fire themselves.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 458,
                  "content": "\t\tremove_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'change_parents_and_sequence' ), 10, 2 );"
                },
                {
                  "lineNumber": 459,
                  "content": "\t\tremove_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'unattach_when_removed' ), 10, 2 );"
                },
                {
                  "lineNumber": 460,
                  "isContextLine": true
                },
                {
                  "lineNumber": 463,
                  "content": "\t\t// Re-add the hooks now that we're done making changes.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 464,
                  "content": "\t\tadd_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'change_parents_and_sequence' ), 10, 2 );"
                },
                {
                  "lineNumber": 465,
                  "content": "\t\tadd_action( 'edit_post_' . INVP::POST_TYPE, array( $this, 'unattach_when_removed' ), 10, 2 );"
                },
                {
                  "lineNumber": 466,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 495,
                  "content": "\t\t\t\t'post_parent'    =&gt; $post_id,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 496,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 497,
                  "content": "\t\t\t\t'posts_per_page' =&gt; 500,",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-options.php",
              "matches": [
                {
                  "lineNumber": 50,
                  "content": "\tpublic function add_options_pages() {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 51,
                  "content": "\t\tif ( post_type_exists( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 52,
                  "content": "\t\t\t// Taxonomy settings page.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 53,
                  "content": "\t\t\tadd_submenu_page(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 54,
                  "content": "\t\t\t\t'edit.php?post_type=' . INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 55,
                  "content": "\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // page_title.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 63,
                  "content": "\t\t\tadd_submenu_page(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 64,
                  "content": "\t\t\t\t'edit.php?post_type=' . INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 65,
                  "content": "\t\t\t\t__( 'Options', 'inventory-presser' ), // page_title.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 305,
                  "content": "\t\t\t\t\t\t\t&lt;?php",
                  "isContextLine": true
                },
                {
                  "lineNumber": 306,
                  "content": "\t\t\t\t\t\t\t$uri = get_post_type_archive_link( INVP::POST_TYPE );"
                },
                {
                  "lineNumber": 307,
                  "content": "\t\t\t\t\t\t\tprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 440,
                  "content": "\t\t\t\t),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 441,
                  "content": "\t\t\t\tadmin_url( 'edit.php?post_type=' . INVP::POST_TYPE . '&amp;page=' . INVP::OPTION_PAGE )"
                },
                {
                  "lineNumber": 442,
                  "content": "\t\t\t);",
                  "isContextLine": true
                },
                {
                  "lineNumber": 456,
                  "content": "\t\t\t\t),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 457,
                  "content": "\t\t\t\tadmin_url( 'edit.php?post_type=' . INVP::POST_TYPE . '&amp;page=' . INVP::OPTION_PAGE )"
                },
                {
                  "lineNumber": 458,
                  "content": "\t\t\t);",
                  "isContextLine": true
                },
                {
                  "lineNumber": 564,
                  "content": "\t\t\t'&lt;a class=\"button\" href=\"%1$s\"&gt;%2$s&lt;/a&gt;',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 565,
                  "content": "\t\t\tesc_url_raw( admin_url( sprintf( 'edit.php?post_type=%s&amp;page=invp-taxonomies', INVP::POST_TYPE ) ) ),"
                },
                {
                  "lineNumber": 566,
                  "content": "\t\t\tesc_html__( 'Manage Taxonomies', 'inventory-presser' )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 580,
                  "content": "\t\t\t\t\tsprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 581,
                  "content": "\t\t\t\t\t\t'edit-tags.php?taxonomy=%s&amp;post_type=%s',"
                },
                {
                  "lineNumber": 582,
                  "content": "\t\t\t\t\t\tstr_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ?? '' ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 583,
                  "content": "\t\t\t\t\t\tINVP::POST_TYPE"
                },
                {
                  "lineNumber": 584,
                  "content": "\t\t\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 798,
                  "content": "\t\t\t\t\t\t\tsprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 799,
                  "content": "\t\t\t\t\t\t\t\t'edit-tags.php?taxonomy=%s&amp;post_type=%s',"
                },
                {
                  "lineNumber": 800,
                  "content": "\t\t\t\t\t\t\t\tstr_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 801,
                  "content": "\t\t\t\t\t\t\t\tINVP::POST_TYPE"
                },
                {
                  "lineNumber": 802,
                  "content": "\t\t\t\t\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 908,
                  "content": "\t\t// Redirect to prevent duplicate actions on reloads.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 909,
                  "content": "\t\twp_safe_redirect( admin_url( 'edit.php?post_type=' . INVP::POST_TYPE . '&amp;page=' . INVP::OPTION_PAGE ) );"
                },
                {
                  "lineNumber": 910,
                  "content": "\t\texit;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1093,
                  "isContextLine": true
                },
                {
                  "lineNumber": 1094,
                  "content": "\t\t// Is this the taxonomies page at edit.php?post_type=inventory_vehicle&amp;page=invp-taxonomies?"
                },
                {
                  "lineNumber": 1095,
                  "content": "\t\tif ( 1 === count( $input ) &amp;&amp; 'taxonomies' === key( $input ) ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1104,
                  "isContextLine": true
                },
                {
                  "lineNumber": 1105,
                  "content": "\t\t// Sanitize settings from the main settings page at edit.php?post_type=inventory_vehicle&amp;page=dealership-options."
                },
                {
                  "lineNumber": 1106,
                  "content": "\t\t$sanitary_values = array(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1253,
                  "content": "\t\t\tesc_html__( 'Configure which taxonomies are active, whether they are shown in the dashboard menu, and for which vehicle types they should appear in the editor. Vehicle types can be added and removed %1$shere%2$s. Deleted types provided by the plugin will be restored during plugin activation.', 'inventory-presser' ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 1254,
                  "content": "\t\t\t'&lt;a href=\"' . esc_url( admin_url( 'edit-tags.php?taxonomy=type&amp;post_type=' . INVP::POST_TYPE ) ) . '\"&gt;',"
                },
                {
                  "lineNumber": 1255,
                  "content": "\t\t\t'&lt;/a&gt;'",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-posts-list.php",
              "matches": [
                {
                  "lineNumber": 82,
                  "content": "\t\t// Add columns to the table that lists all the Vehicles on edit.php.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 83,
                  "content": "\t\tadd_filter( 'manage_' . INVP::POST_TYPE . '_posts_columns', array( $this, 'add_columns_to_vehicles_table' ) );"
                },
                {
                  "lineNumber": 84,
                  "isContextLine": true
                },
                {
                  "lineNumber": 85,
                  "content": "\t\t// Populate the columns we added to the Vehicles table.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 86,
                  "content": "\t\tadd_action( 'manage_' . INVP::POST_TYPE . '_posts_custom_column', array( $this, 'populate_columns_we_added_to_vehicles_table' ), 10, 2 );"
                },
                {
                  "lineNumber": 87,
                  "isContextLine": true
                },
                {
                  "lineNumber": 88,
                  "content": "\t\t// Make our added columns to the Vehicles table sortable.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 89,
                  "content": "\t\tadd_filter( 'manage_edit-' . INVP::POST_TYPE . '_sortable_columns', array( $this, 'make_vehicles_table_columns_sortable' ) );"
                },
                {
                  "lineNumber": 90,
                  "isContextLine": true
                },
                {
                  "lineNumber": 102,
                  "content": "\tpublic function scripts_and_styles() {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 103,
                  "content": "\t\tglobal $pagenow, $post_type;"
                },
                {
                  "lineNumber": 104,
                  "content": "\t\tif ( is_admin() &amp;&amp; 'edit.php' === $pagenow &amp;&amp; INVP::POST_TYPE === $post_type ) {"
                },
                {
                  "lineNumber": 105,
                  "content": "\t\t\t$min = defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ? '' : '.min';",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-template-provider.php",
              "matches": [
                {
                  "lineNumber": 37,
                  "content": "\t\tpublic static function lie_about_post_thumbnails( $has_thumbnail, $post, $thumbnail_id ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 38,
                  "content": "\t\t\tif ( ! empty( $post ) &amp;&amp; INVP::POST_TYPE !== get_post_type( $post ) ) {"
                },
                {
                  "lineNumber": 39,
                  "content": "\t\t\t\treturn $has_thumbnail;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 41,
                  "isContextLine": true
                },
                {
                  "lineNumber": 42,
                  "content": "\t\t\t$is_vehicle_photo = 'attachment' === get_post_type( $thumbnail_id )"
                },
                {
                  "lineNumber": 43,
                  "content": "\t\t\t\t&amp;&amp; ! empty( INVP::get_meta( 'photo_number', $thumbnail_id ) );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 77,
                  "isContextLine": true
                },
                {
                  "lineNumber": 78,
                  "content": "\t\t\tif ( INVP::POST_TYPE !== $post-&gt;post_type ) {"
                },
                {
                  "lineNumber": 79,
                  "content": "\t\t\t\t// no, who cares.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 87,
                  "content": "\t\t\tif ( ! empty( $template )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 88,
                  "content": "\t\t\t\t&amp;&amp; ( ( 'archive' === $single_or_archive &amp;&amp; 'archive-' . INVP::POST_TYPE . '.php' === basename( $template ) )"
                },
                {
                  "lineNumber": 89,
                  "content": "\t\t\t\t|| ( 'single' === $single_or_archive &amp;&amp; 'single-' . INVP::POST_TYPE . '.php' === basename( $template ) ) )"
                },
                {
                  "lineNumber": 90,
                  "content": "\t\t\t) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 158,
                  "isContextLine": true
                },
                {
                  "lineNumber": 159,
                  "content": "\t\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {"
                },
                {
                  "lineNumber": 160,
                  "content": "\t\t\t\treturn $value;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-single-vehicle.php",
              "matches": [
                {
                  "lineNumber": 36,
                  "content": "\tpublic function content( $atts ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 37,
                  "content": "\t\tif ( ! is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 38,
                  "content": "\t\t\treturn '';",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-archive.php",
              "matches": [
                {
                  "lineNumber": 91,
                  "content": "\t\t$atts['show_titles'] = filter_var( $atts['show_titles'], FILTER_VALIDATE_BOOLEAN );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 92,
                  "content": "\t\t$atts['post_type']   = INVP::POST_TYPE;"
                },
                {
                  "lineNumber": 93,
                  "isContextLine": true
                },
                {
                  "lineNumber": 97,
                  "content": "\t\t// Add all taxonomy query vars to $atts so filters work.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 98,
                  "content": "\t\t$taxonomies = get_object_taxonomies( $atts['post_type'], 'objects' );"
                },
                {
                  "lineNumber": 99,
                  "content": "\t\tforeach ( $taxonomies as $taxonomy ) {",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/widget/class-widget-maximum-price-filter.php",
              "matches": [
                {
                  "lineNumber": 121,
                  "content": "\t\t\t\t),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 122,
                  "content": "\t\t\t\tget_post_type_archive_link( INVP::POST_TYPE )"
                },
                {
                  "lineNumber": 123,
                  "content": "\t\t\t);",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/widget/class-widget-inventory-slider.php",
              "matches": [
                {
                  "lineNumber": 119,
                  "content": "\t\t\t'orderby'        =&gt; 'rand',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 120,
                  "content": "\t\t\t'post_type'      =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 121,
                  "content": "\t\t\t'posts_per_page' =&gt; $showcount * 5, // get 5 sets of the number we'll show at one time.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/widget/class-widget-fuel-economy.php",
              "matches": [
                {
                  "lineNumber": 84,
                  "content": "\t\t// if we aren't looking at a single vehicle, abort.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 85,
                  "content": "\t\tif ( ! is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 86,
                  "content": "\t\t\treturn;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/widget/class-widget-carfax.php",
              "matches": [
                {
                  "lineNumber": 108,
                  "content": "\t\t\t\t'&lt;a href=\"%s\"&gt;%s&lt;/a&gt;',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 109,
                  "content": "\t\t\t\tesc_url( get_post_type_archive_link( INVP::POST_TYPE ) ),"
                },
                {
                  "lineNumber": 110,
                  "content": "\t\t\t\t$svg",
                  "isContextLine": true
                },
                {
                  "lineNumber": 114,
                  "content": "\t\t\t\t'&lt;a href=\"%s\"&gt;&lt;img src=\"%s\"&gt;&lt;/a&gt;',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 115,
                  "content": "\t\t\t\tesc_url( get_post_type_archive_link( INVP::POST_TYPE ) ),"
                },
                {
                  "lineNumber": 116,
                  "content": "\t\t\t\tesc_url( plugins_url( '/images/' . $this-&gt;images()[ $image ]['img'], INVP_PLUGIN_FILE_PATH ) )",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-divi.php",
              "matches": [
                {
                  "lineNumber": 29,
                  "content": "\t\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 30,
                  "content": "\t\tadd_action( 'enqueue_block_editor_assets', array( $this, 'add_et_builder_post_types_hook' ), 3 );"
                },
                {
                  "lineNumber": 31,
                  "isContextLine": true
                },
                {
                  "lineNumber": 98,
                  "content": "\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 99,
                  "content": "\tpublic function add_et_builder_post_types_hook() {"
                },
                {
                  "lineNumber": 100,
                  "content": "\t\tadd_filter( 'et_builder_post_types', array( $this, 'remove_post_type_block_editor' ) );"
                },
                {
                  "lineNumber": 101,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 124,
                  "content": "\t *",
                  "isContextLine": true
                },
                {
                  "lineNumber": 125,
                  "content": "\t * @param  string[] $post_types Array of post types enabled in Divi Builder."
                },
                {
                  "lineNumber": 126,
                  "content": "\t * @return string[]",
                  "isContextLine": true
                },
                {
                  "lineNumber": 127,
                  "content": "\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 128,
                  "content": "\tpublic function remove_post_type_block_editor( $post_types ) {"
                },
                {
                  "lineNumber": 129,
                  "content": "\t\t// Is this the block editor creating a new vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 131,
                  "content": "\t\tif ( ! is_admin()",
                  "isContextLine": true
                },
                {
                  "lineNumber": 132,
                  "content": "\t\t\t|| get_post_type() !== INVP::POST_TYPE"
                },
                {
                  "lineNumber": 133,
                  "content": "\t\t\t|| 'post-new.php' !== $pagenow ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 134,
                  "content": "\t\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 135,
                  "content": "\t\t\treturn $post_types;"
                },
                {
                  "lineNumber": 136,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 137,
                  "content": "\t\t// Is our post type managed by the Divi Builder?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 138,
                  "content": "\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );"
                },
                {
                  "lineNumber": 139,
                  "content": "\t\tif ( false === $index ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 140,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 141,
                  "content": "\t\t\treturn $post_types;"
                },
                {
                  "lineNumber": 142,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 143,
                  "content": "\t\t// Yes. Remove it from the list of post types to prevent the Divi nag.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 144,
                  "content": "\t\tunset( $post_types[ $index ] );"
                },
                {
                  "lineNumber": 145,
                  "content": "\t\treturn array_values( $post_types );"
                },
                {
                  "lineNumber": 146,
                  "content": "\t}",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-editor-sidebar.php",
              "matches": [
                {
                  "lineNumber": 40,
                  "content": "\t\t// Are we editing a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 41,
                  "content": "\t\tif ( empty( $post-&gt;post_type ) || INVP::POST_TYPE !== $post-&gt;post_type ) {"
                },
                {
                  "lineNumber": 42,
                  "content": "\t\t\treturn;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/widget/class-widget-inventory-grid.php",
              "matches": [
                {
                  "lineNumber": 97,
                  "content": "\t\t\t'posts_per_page' =&gt; $args['limit'],",
                  "isContextLine": true
                },
                {
                  "lineNumber": 98,
                  "content": "\t\t\t'post_type'      =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 99,
                  "content": "\t\t\t'meta_query'     =&gt; array(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 210,
                  "content": "\t\t\t\t'&lt;div class=\"invp-grid-button\"&gt;&lt;button onclick=\"location.href=\\'%s\\';\" class=\"button wp-element-button\"&gt;%s&lt;/button&gt;&lt;/div&gt;',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 211,
                  "content": "\t\t\t\tesc_url( get_post_type_archive_link( INVP::POST_TYPE ) ),"
                },
                {
                  "lineNumber": 212,
                  "content": "\t\t\t\tesc_html__( 'Full Inventory', 'inventory-presser' )",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-schema-org-generator.php",
              "matches": [
                {
                  "lineNumber": 34,
                  "content": "\tpublic function include_json_ld() {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 35,
                  "content": "\t\tif ( ! is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 36,
                  "content": "\t\t\treturn;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-avada.php",
              "matches": [
                {
                  "lineNumber": 50,
                  "content": "\t\t// Is $post_id a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 51,
                  "content": "\t\tif ( INVP::POST_TYPE !== get_post_type( $post_id ) ) {"
                },
                {
                  "lineNumber": 52,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 63,
                  "content": "\t\t\t\t'post_status'    =&gt; 'inherit',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 64,
                  "content": "\t\t\t\t'post_type'      =&gt; 'attachment',"
                },
                {
                  "lineNumber": 65,
                  "content": "\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 76,
                  "content": "\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 77,
                  "content": "\t\t\t$meta[ 'kd_featured-image-' . $i . '_' . INVP::POST_TYPE . '_id' ] = $images[ $i ];"
                },
                {
                  "lineNumber": 78,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 93,
                  "content": "\t\tglobal $wp_query;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 94,
                  "content": "\t\tif ( INVP::POST_TYPE === $args['post_type'] &amp;&amp; is_post_type_archive( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 95,
                  "content": "\t\t\t// The query variables are already set. Use them instead.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-attribute-table.php",
              "matches": [
                {
                  "lineNumber": 179,
                  "content": "\t\t\t// Is this table displayed on a boat single?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 180,
                  "content": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 181,
                  "content": "\t\t\t\t// Beam.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-gravityforms-field-vehicle.php",
              "matches": [
                {
                  "lineNumber": 126,
                  "isContextLine": true
                },
                {
                  "lineNumber": 127,
                  "content": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 128,
                  "content": "\t\t\t\t$value = sprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 148,
                  "content": "\t\t\t// Is this a single vehicle page?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 149,
                  "content": "\t\t\tif ( ! is_singular( INVP::POST_TYPE ) &amp;&amp; ! $is_form_editor ) {"
                },
                {
                  "lineNumber": 150,
                  "content": "\t\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 258,
                  "isContextLine": true
                },
                {
                  "lineNumber": 259,
                  "content": "\t\t\t\t\tWHERE \t\tpost_type = %s"
                },
                {
                  "lineNumber": 260,
                  "content": "\t\t\t\t\t\t\t\tAND post_status = 'publish'",
                  "isContextLine": true
                },
                {
                  "lineNumber": 268,
                  "content": "\t\t\t\t\",",
                  "isContextLine": true
                },
                {
                  "lineNumber": 269,
                  "content": "\t\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 270,
                  "content": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/shortcode/class-shortcode-hours-today.php",
              "matches": [
                {
                  "lineNumber": 235,
                  "content": "\t\t\treturn $this-&gt;find_hours_set_by_uid( $shortcode_atts['hours_uid'] );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 236,
                  "content": "\t\t} elseif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 237,
                  "content": "\t\t\t// is there a location attached to this vehicle?",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-wpforms-field-vehicle.php",
              "matches": [
                {
                  "lineNumber": 106,
                  "content": "\t\t\t// The field will be hidden, do not show a label.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 107,
                  "content": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 108,
                  "content": "\t\t\t\t$properties['label']['disabled']    = true;",
                  "isContextLine": true
                },
                {
                  "lineNumber": 454,
                  "content": "\t\t\t// Is this a vehicle details page?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 455,
                  "content": "\t\t\tif ( is_singular( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 456,
                  "content": "\t\t\t\t$value = sprintf(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 619,
                  "isContextLine": true
                },
                {
                  "lineNumber": 620,
                  "content": "\t\t\t\t\tWHERE \t\tpost_type = %s"
                },
                {
                  "lineNumber": 621,
                  "content": "\t\t\t\t\t\t\t\tAND post_status = 'publish'",
                  "isContextLine": true
                },
                {
                  "lineNumber": 629,
                  "content": "\t\t\t\t\",",
                  "isContextLine": true
                },
                {
                  "lineNumber": 630,
                  "content": "\t\t\t\t\tINVP::POST_TYPE,"
                },
                {
                  "lineNumber": 631,
                  "content": "\t\t\t\t\tapply_filters( 'invp_prefix_meta_key', 'year' ),",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/integrations/class-forms-integration.php",
              "matches": [
                {
                  "lineNumber": 28,
                  "content": "\t\t\t\t'post_status'    =&gt; 'publish',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 29,
                  "content": "\t\t\t\t'post_type'      =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 30,
                  "content": "\t\t\t\t'posts_per_page' =&gt; 1,",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-vehicle-urls-by-vin.php",
              "matches": [
                {
                  "lineNumber": 84,
                  "content": "\t\t\t\tarray(",
                  "isContextLine": true
                },
                {
                  "lineNumber": 85,
                  "content": "\t\t\t\t\t'post_type'   =&gt; INVP::POST_TYPE,"
                },
                {
                  "lineNumber": 86,
                  "content": "\t\t\t\t\t'post_status' =&gt; 'publish',",
                  "isContextLine": true
                },
                {
                  "lineNumber": 93,
                  "content": "\t\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 94,
                  "content": "\t\t\treturn get_post_type_archive_link( INVP::POST_TYPE );"
                },
                {
                  "lineNumber": 95,
                  "content": "\t\t}",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-taxonomy-overlapper.php",
              "matches": [
                {
                  "lineNumber": 356,
                  "content": "\t\t// Does $object_id belong to a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 357,
                  "content": "\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {"
                },
                {
                  "lineNumber": 358,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 419,
                  "content": "\t\t// Does $object_id belong to a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 420,
                  "content": "\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {"
                },
                {
                  "lineNumber": 421,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-redirect-404-vehicles.php",
              "matches": [
                {
                  "lineNumber": 41,
                  "content": "\t\t\t// if this is a request for a single vehicle, parse the make out of the slug.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 42,
                  "content": "\t\t\tif ( isset( $wp_obj-&gt;query_vars[ INVP::POST_TYPE ] )"
                },
                {
                  "lineNumber": 43,
                  "content": "\t\t\t\t&amp;&amp; '' !== $wp_obj-&gt;query_vars[ INVP::POST_TYPE ] ) {"
                },
                {
                  "lineNumber": 44,
                  "content": "\t\t\t\t$slug_pieces = explode( '-', $wp_obj-&gt;query_vars[ INVP::POST_TYPE ] );"
                },
                {
                  "lineNumber": 45,
                  "content": "\t\t\t\tif ( 2 &lt;= count( $slug_pieces )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 75,
                  "content": "\t\t\treturn isset( $wp_obj-&gt;query_vars )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 76,
                  "content": "\t\t\t\t&amp;&amp; isset( $wp_obj-&gt;query_vars['post_type'] )"
                },
                {
                  "lineNumber": 77,
                  "content": "\t\t\t\t&amp;&amp; INVP::POST_TYPE === $wp_obj-&gt;query_vars['post_type'];"
                },
                {
                  "lineNumber": 78,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 92,
                  "content": "\t\t\t$pieces = explode( '/', $wp_obj-&gt;request );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 93,
                  "content": "\t\t\treturn isset( $pieces[0] ) &amp;&amp; trim( str_replace( site_url(), '', get_post_type_archive_link( INVP::POST_TYPE ) ), '/' ) === $pieces[0];"
                },
                {
                  "lineNumber": 94,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 120,
                  "content": "\t\t\t// base link to the inventory page.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 121,
                  "content": "\t\t\t$url = get_post_type_archive_link( INVP::POST_TYPE );"
                },
                {
                  "lineNumber": 122,
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-range-filters.php",
              "matches": [
                {
                  "lineNumber": 86,
                  "content": "\t\t\t// Is this query for vehicles?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 87,
                  "content": "\t\t\tif ( INVP::POST_TYPE !== $query-&gt;get( 'post_type', '' ) ) {"
                },
                {
                  "lineNumber": 88,
                  "content": "\t\t\t\t// No.",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-photo-numberer.php",
              "matches": [
                {
                  "lineNumber": 70,
                  "isContextLine": true
                },
                {
                  "lineNumber": 71,
                  "content": "\t\tif ( 'attachment' !== get_post_type( $id ) ) {"
                },
                {
                  "lineNumber": 72,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 76,
                  "content": "\t\t$parent = get_post_parent( $id );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 77,
                  "content": "\t\tif ( empty( $parent ) || INVP::POST_TYPE !== $parent-&gt;post_type ) {"
                },
                {
                  "lineNumber": 78,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 130,
                  "content": "\t\t// Is this even attached to a vehicle?",
                  "isContextLine": true
                },
                {
                  "lineNumber": 131,
                  "content": "\t\tif ( INVP::POST_TYPE !== get_post_type( $attachment-&gt;post_parent ) ) {"
                },
                {
                  "lineNumber": 132,
                  "content": "\t\t\t// No.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 162,
                  "content": "\t\t\t\t'post_parent' =&gt; $post_id,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 163,
                  "content": "\t\t\t\t'post_type'   =&gt; 'attachment',"
                },
                {
                  "lineNumber": 164,
                  "content": "\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 170,
                  "content": "\t\t\t\t'post_parent' =&gt; $post_id,",
                  "isContextLine": true
                },
                {
                  "lineNumber": 171,
                  "content": "\t\t\t\t'post_type'   =&gt; 'attachment',"
                },
                {
                  "lineNumber": 172,
                  "content": "\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 263,
                  "content": "WHERE\t\t&#96;{$wpdb-&gt;prefix}posts&#96;.&#96;post_parent&#96; = %d",
                  "isContextLine": true
                },
                {
                  "lineNumber": 264,
                  "content": "\t\t\tAND &#96;post_type&#96; = 'attachment'"
                },
                {
                  "lineNumber": 265,
                  "content": "\t\t\tAND &#96;meta_key&#96; = %s\",",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-allow-inventory-as-home-page.php",
              "matches": [
                {
                  "lineNumber": 36,
                  "content": "\t\t\t\t'post_title'     =&gt; __( 'Inventory', 'inventory-presser' ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 37,
                  "content": "\t\t\t\t'post_type'      =&gt; 'page',"
                },
                {
                  "lineNumber": 38,
                  "content": "\t\t\t)",
                  "isContextLine": true
                },
                {
                  "lineNumber": 135,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 136,
                  "content": "\t\tglobal $pagenow, $post_type;"
                },
                {
                  "lineNumber": 137,
                  "content": "\t\tif ( is_admin() &amp;&amp; is_main_query() &amp;&amp; 'edit.php' === $pagenow &amp;&amp; 'page' === $post_type ) {"
                },
                {
                  "lineNumber": 138,
                  "content": "\t\t\t$query-&gt;set( 'post__not_in', array( $page_id ) );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 172,
                  "content": "\t\tif ( $page_id == get_option( 'page_on_front' ) &amp;&amp; $page_id == self::find_page_id() ) {",
                  "isContextLine": true
                },
                {
                  "lineNumber": 173,
                  "content": "\t\t\twp_safe_redirect( get_post_type_archive_link( INVP::POST_TYPE ) );"
                },
                {
                  "lineNumber": 174,
                  "content": "\t\t\texit;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/class-additional-listings-pages.php",
              "matches": [
                {
                  "lineNumber": 23,
                  "content": "\t\tadd_action( 'pre_get_posts', array( $this, 'modify_query' ) );",
                  "isContextLine": true
                },
                {
                  "lineNumber": 24,
                  "content": "\t\tadd_filter( 'post_type_archive_title', array( $this, 'change_page_title' ), 10, 2 );"
                },
                {
                  "lineNumber": 25,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 27,
                  "content": "\t/**",
                  "isContextLine": true
                },
                {
                  "lineNumber": 28,
                  "content": "\t * Callback on post_type_archive_title. Changes page titles for listings"
                },
                {
                  "lineNumber": 29,
                  "content": "\t * pages.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 30,
                  "content": "\t *",
                  "isContextLine": true
                },
                {
                  "lineNumber": 31,
                  "content": "\t * @param  mixed $post_type_name Post type 'name' label."
                },
                {
                  "lineNumber": 32,
                  "content": "\t * @param  mixed $post_type Post type."
                },
                {
                  "lineNumber": 33,
                  "content": "\t * @return string",
                  "isContextLine": true
                },
                {
                  "lineNumber": 34,
                  "content": "\t */",
                  "isContextLine": true
                },
                {
                  "lineNumber": 35,
                  "content": "\tpublic function change_page_title( $post_type_name, $post_type ) {"
                },
                {
                  "lineNumber": 36,
                  "content": "\t\tif ( ! class_exists( 'INVP' ) || INVP::POST_TYPE !== $post_type ) {"
                },
                {
                  "lineNumber": 37,
                  "content": "\t\t\treturn $post_type_name;"
                },
                {
                  "lineNumber": 38,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 53,
                  "content": "\t\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 54,
                  "content": "\t\treturn $post_type_name;"
                },
                {
                  "lineNumber": 55,
                  "content": "\t}",
                  "isContextLine": true
                },
                {
                  "lineNumber": 72,
                  "content": "\t\t\t// Base rule for this slug, this is not a post type.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 73,
                  "content": "\t\t\t$rules[ $additional_listing['url_path'] . '/?$' ] = 'index.php?post_type=' . INVP::POST_TYPE;"
                },
                {
                  "lineNumber": 74,
                  "content": "\t\t\t// Another rule to enable paging.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 75,
                  "content": "\t\t\t$rules[ $additional_listing['url_path'] . '/page/([0-9]{1,})/?$' ] = 'index.php?post_type=' . INVP::POST_TYPE . '&amp;paged=$matches[1]';"
                },
                {
                  "lineNumber": 76,
                  "isContextLine": true
                },
                {
                  "lineNumber": 127,
                  "content": "\t\t// Must be the main query on a vehicle archive request.",
                  "isContextLine": true
                },
                {
                  "lineNumber": 128,
                  "content": "\t\tif ( ! $query-&gt;is_main_query() || ! is_post_type_archive( INVP::POST_TYPE ) ) {"
                },
                {
                  "lineNumber": 129,
                  "content": "\t\t\treturn false;",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-location-meta.php",
              "matches": [
                {
                  "lineNumber": 380,
                  "content": "\t\tif ( ( 'edit-tags.php' === $hook || 'term.php' === $hook )",
                  "isContextLine": true
                },
                {
                  "lineNumber": 381,
                  "content": "\t\t\t&amp;&amp; INVP::POST_TYPE === $current_screen-&gt;post_type"
                },
                {
                  "lineNumber": 382,
                  "content": "\t\t\t&amp;&amp; 'location' === $current_screen-&gt;taxonomy",
                  "isContextLine": true
                }
              ]
            },
            {
              "file": "./includes/admin/class-admin-bar.php",
              "matches": [
                {
                  "lineNumber": 32,
                  "content": "\t\t\t\t'title'  =&gt; __( 'Vehicles', 'inventory-presser' ),",
                  "isContextLine": true
                },
                {
                  "lineNumber": 33,
                  "content": "\t\t\t\t'href'   =&gt; admin_url( 'edit.php?post_type=' . INVP::POST_TYPE ),"
                },
                {
                  "lineNumber": 34,
                  "content": "\t\t\t\t'parent' =&gt; 'site-name',",
                  "isContextLine": true
                }
              ]
            }
          ],
          "totalLines": 564,
          "totalMatchedLines": 211
        }
      }
    }
  }
}
```
Status: **completed**


</details>
</tool-use>

---

<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>

---

