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

# 2025-11-06 16:20:35Z

<!-- cursoride Session 5aadee56-89a8-48d4-82bb-24ade134b598 (2025-11-06 16:20:35Z) -->

_**User (2025-11-09 00:29:34Z)**_

when i visit wp-admin/widgets.php, i see this red banner: "The "invp-plugin-sidebar" plugin has encountered an error and cannot be rendered." what could that mean?

---

_**Agent (default)**_

Searching for where "invp-plugin-sidebar" is registered and reviewing widget registration code.


_**Agent (default)**_

<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "invp-plugin-sidebar" • 4 matches</summary>

Output mode: content


| File | Content | Line |
|------|------|------|
| `./includes/admin/class-admin-editor-sidebar.php` | `'invp-plugin-sidebar',` | L20 |
| `./includes/admin/class-admin-editor-sidebar.php` | `wp_enqueue_script( 'invp-plugin-sidebar' );` | L39 |
| `./js/editor-sidebar.js` | `'invp-plugin-sidebar',` | L315 |
| `./js/editor-sidebar.js` | `name: 'invp-plugin-sidebar',` | L572 |


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 69
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/admin/class-admin-editor-sidebar.php",
        "signatures": {}
      },
      "score": 0.4433428943157196
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 934
          },
          "startPosition": {
            "column": 1,
            "line": 884
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.4131743907928467
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 884
          },
          "startPosition": {
            "column": 1,
            "line": 827
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.4002976417541504
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 3,
            "line": 127
          },
          "startPosition": {
            "column": 2,
            "line": 52
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js",
        "signatures": {}
      },
      "score": 0.37843239307403564
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 746
          },
          "startPosition": {
            "column": 1,
            "line": 700
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.3686027526855469
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1234
          },
          "startPosition": {
            "column": 1,
            "line": 1189
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.36305591464042664
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 73
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/class-blocks.php",
        "signatures": {}
      },
      "score": 0.3444685935974121
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 18,
            "line": 585
          },
          "startPosition": {
            "column": 130,
            "line": 523
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js",
        "signatures": {
          "ranges": [
            {
              "endPosition": {
                "column": 1,
                "line": 57
              },
              "startPosition": {
                "column": 1,
                "line": 57
              }
            },
            {
              "endPosition": {
                "column": 2,
                "line": 314
              },
              "startPosition": {
                "column": 2,
                "line": 314
              }
            }
          ]
        }
      },
      "score": 0.3427932858467102
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 652
          },
          "startPosition": {
            "column": 1,
            "line": 593
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.32979893684387207
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 139
          },
          "startPosition": {
            "column": 1,
            "line": 73
          }
        },
        "relativeWorkspacePath": "includes/class-blocks.php",
        "signatures": {}
      },
      "score": 0.32354456186294556
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 700
          },
          "startPosition": {
            "column": 1,
            "line": 652
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.3233259916305542
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1831
          },
          "startPosition": {
            "column": 1,
            "line": 1770
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.31612429022789
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 61
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/class-taxonomies.php",
        "signatures": {}
      },
      "score": 0.31497490406036377
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 61
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/admin/class-admin-options.php",
        "signatures": {}
      },
      "score": 0.3148411512374878
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1189
          },
          "startPosition": {
            "column": 1,
            "line": 1140
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.31075024604797363
    }
  ],
  "explanation": "",
  "query": "How are WordPress sidebars registered in this plugin?",
  "repositoryInfo": {
    "orthogonalTransformSeed": 6308982098672407,
    "preferredEmbeddingModel": "EMBEDDING_MODEL_UNSPECIFIED",
    "relativeWorkspacePath": ".",
    "repoName": "5a26c3e1-2367-4e37-aaba-63a54ad0ac26",
    "repoOwner": "auth0|user_01JXZMQ8XHQ8Y96GRWHQJCM038"
  },
  "topK": 15
}
```
Result:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "contents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Editor_Sidebar\n *\n * Adds a sidebar to the WordPress editor so that meta fields can be edited\n * outside of blocks.\n */\nclass Inventory_Presser_Admin_Editor_Sidebar {\n\n\t/**\n\t * Registers a JavaScript file\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_register() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_register_script(\n\t\t\t'invp-plugin-sidebar',\n\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),\n\t\t\tINVP_PLUGIN_VERSION,\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Includes the JavaScript file when editing a vehicle in the dashboard.\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_script_enqueue() {\n\t\t// Are we editing a vehicle?\n\t\tglobal $post;\n\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {\n\t\t\treturn;\n\t\t}\n\t\twp_enqueue_script( 'invp-plugin-sidebar' );\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_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );\n\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\n\t}\n\n\t/**\n\t * Includes the wp-api JavaScript\n\t *\n\t * @return void\n\t */\n\tpublic function scripts_and_styles() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_enqueue_script( 'wp-api' );\n\t\twp_enqueue_style(\n\t\t\t'invp-editor-sidebar',\n\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray(),\n\t\t\tINVP_PLUGIN_VERSION\n\t\t);\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Admin_Editor_Sidebar"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * Adds a sidebar to the WordPress editor so that meta fields can be edited"
          },
          {
            "lineNumber": 8,
            "text": " * outside of blocks."
          },
          {
            "lineNumber": 9,
            "text": " */"
          },
          {
            "lineNumber": 10,
            "text": "class Inventory_Presser_Admin_Editor_Sidebar {"
          },
          {
            "lineNumber": 11
          },
          {
            "lineNumber": 12,
            "text": "\t/**"
          },
          {
            "lineNumber": 13,
            "text": "\t * Registers a JavaScript file"
          },
          {
            "lineNumber": 14,
            "text": "\t *"
          },
          {
            "lineNumber": 15,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 16,
            "text": "\t */"
          },
          {
            "lineNumber": 17,
            "text": "\tpublic function sidebar_plugin_register() {"
          },
          {
            "lineNumber": 18,
            "text": "\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';"
          },
          {
            "lineNumber": 19,
            "text": "\t\twp_register_script("
          },
          {
            "lineNumber": 20,
            "text": "\t\t\t'invp-plugin-sidebar',"
          },
          {
            "lineNumber": 21,
            "text": "\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),"
          },
          {
            "lineNumber": 22,
            "text": "\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),"
          },
          {
            "lineNumber": 23,
            "text": "\t\t\tINVP_PLUGIN_VERSION,"
          },
          {
            "lineNumber": 24,
            "text": "\t\t\ttrue"
          },
          {
            "lineNumber": 25,
            "text": "\t\t);"
          },
          {
            "lineNumber": 26,
            "text": "\t}"
          },
          {
            "lineNumber": 27
          },
          {
            "lineNumber": 28,
            "text": "\t/**"
          },
          {
            "lineNumber": 29,
            "text": "\t * Includes the JavaScript file when editing a vehicle in the dashboard."
          },
          {
            "lineNumber": 30,
            "text": "\t *"
          },
          {
            "lineNumber": 31,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 32,
            "text": "\t */"
          },
          {
            "lineNumber": 33,
            "text": "\tpublic function sidebar_plugin_script_enqueue() {"
          },
          {
            "lineNumber": 34,
            "text": "\t\t// Are we editing a vehicle?"
          },
          {
            "lineNumber": 35,
            "text": "\t\tglobal $post;"
          },
          {
            "lineNumber": 36,
            "text": "\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {"
          },
          {
            "lineNumber": 37,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 38,
            "text": "\t\t}"
          },
          {
            "lineNumber": 39,
            "text": "\t\twp_enqueue_script( 'invp-plugin-sidebar' );"
          },
          {
            "lineNumber": 40,
            "text": "\t}"
          },
          {
            "lineNumber": 41
          },
          {
            "lineNumber": 42,
            "text": "\t/**"
          },
          {
            "lineNumber": 43,
            "text": "\t * Adds hooks"
          },
          {
            "lineNumber": 44,
            "text": "\t *"
          },
          {
            "lineNumber": 45,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 46,
            "text": "\t */"
          },
          {
            "lineNumber": 47,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 48,
            "text": "\t\tadd_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );"
          },
          {
            "lineNumber": 49,
            "text": "\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );"
          },
          {
            "lineNumber": 50,
            "text": "\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );"
          },
          {
            "lineNumber": 51,
            "text": "\t}"
          },
          {
            "lineNumber": 52
          },
          {
            "lineNumber": 53,
            "text": "\t/**"
          },
          {
            "lineNumber": 54,
            "text": "\t * Includes the wp-api JavaScript"
          },
          {
            "lineNumber": 55,
            "text": "\t *"
          },
          {
            "lineNumber": 56,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 57,
            "text": "\t */"
          },
          {
            "lineNumber": 58,
            "text": "\tpublic function scripts_and_styles() {"
          },
          {
            "lineNumber": 59,
            "text": "\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';"
          },
          {
            "lineNumber": 60,
            "text": "\t\twp_enqueue_script( 'wp-api' );"
          },
          {
            "lineNumber": 61,
            "text": "\t\twp_enqueue_style("
          },
          {
            "lineNumber": 62,
            "text": "\t\t\t'invp-editor-sidebar',"
          },
          {
            "lineNumber": 63,
            "text": "\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),"
          },
          {
            "lineNumber": 64,
            "text": "\t\t\tarray(),"
          },
          {
            "lineNumber": 65,
            "text": "\t\t\tINVP_PLUGIN_VERSION"
          },
          {
            "lineNumber": 66,
            "text": "\t\t);"
          },
          {
            "lineNumber": 67,
            "text": "\t}"
          },
          {
            "lineNumber": 68,
            "text": "}"
          }
        ],
        "originalContents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Editor_Sidebar\n *\n * Adds a sidebar to the WordPress editor so that meta fields can be edited\n * outside of blocks.\n */\nclass Inventory_Presser_Admin_Editor_Sidebar {\n\n\t/**\n\t * Registers a JavaScript file\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_register() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_register_script(\n\t\t\t'invp-plugin-sidebar',\n\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),\n\t\t\tINVP_PLUGIN_VERSION,\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Includes the JavaScript file when editing a vehicle in the dashboard.\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_script_enqueue() {\n\t\t// Are we editing a vehicle?\n\t\tglobal $post;\n\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {\n\t\t\treturn;\n\t\t}\n\t\twp_enqueue_script( 'invp-plugin-sidebar' );\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_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );\n\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\n\t}\n\n\t/**\n\t * Includes the wp-api JavaScript\n\t *\n\t * @return void\n\t */\n\tpublic function scripts_and_styles() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_enqueue_script( 'wp-api' );\n\t\twp_enqueue_style(\n\t\t\t'invp-editor-sidebar',\n\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray(),\n\t\t\tINVP_PLUGIN_VERSION\n\t\t);\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 68
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/admin/class-admin-editor-sidebar.php"
      },
      "score": 0.4433428943157196
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t\t// Add a sidebar to the editor when editing vehicles.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Editor_Sidebar' ) ) {\r\n\t\t\t\t\t$sidebar = new Inventory_Presser_Admin_Editor_Sidebar();\r\n\t\t\t\t\t$sidebar-\u003eadd_hooks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow more than 30 meta keys in the Custom Fields editor panel.\r\n\t\t\t\tadd_filter( 'postmeta_form_limit', array( $this, 'custom_fields_key_limit' ) );\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomy_Overlapper' ) ) {\r\n\t\t\t\t$overlapper = new Inventory_Presser_Taxonomy_Overlapper();\r\n\t\t\t\t$overlapper-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Schema_Org_Generator' ) ) {\r\n\t\t\t\t$schema_generator = new Inventory_Presser_Schema_Org_Generator();\r\n\t\t\t\t$schema_generator-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Adds the \"View Details\" button to each vehicle in archive loops.\r\n\t\t\tadd_action( 'invp_archive_buttons', array( $this, 'add_view_details_button' ), 20 );\r\n\r\n\t\t\t// Embeds a contact form on vehicle singles if one is chosen at Vehicles → Options.\r\n\t\t\tadd_action( 'invp_single_sections', array( $this, 'single_sections_add_form' ) );\r\n\r\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'loaded' ) );\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_REST' ) ) {\r\n\t\t\t\t$rest = new Inventory_Presser_REST();\r\n\t\t\t\t$rest-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Photo_Arranger' ) ) {\r\n\t\t\t\t$photo_arranger = new Inventory_Presser_Admin_Photo_Arranger();\r\n\t\t\t\t$photo_arranger-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Change archive page titles.\r\n\t\t\tadd_filter( 'document_title_parts', array( $this, 'change_archive_title_tags' ) );\r\n\r\n\t\t\t// Add a link to the Settings page on the plugin management page.\r\n\t\t\tadd_filter( 'plugin_action_links_' . INVP_PLUGIN_BASE, array( $this, 'insert_settings_link' ), 2, 2 );\r\n\r\n\t\t\t// Add tests to the Site Health Status page.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Site_Health' ) ) {\r\n\t\t\t\t$health = new Inventory_Presser_Site_Health();\r\n\t\t\t\t$health-\u003eadd_hooks();\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 882,
            "text": "\t\t\t\t\t$posts_list-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 883,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 884,
            "text": "\r"
          },
          {
            "lineNumber": 885,
            "text": "\t\t\t\t// Add a sidebar to the editor when editing vehicles.\r"
          },
          {
            "lineNumber": 886,
            "text": "\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Editor_Sidebar' ) ) {\r"
          },
          {
            "lineNumber": 887,
            "text": "\t\t\t\t\t$sidebar = new Inventory_Presser_Admin_Editor_Sidebar();\r"
          },
          {
            "lineNumber": 888,
            "text": "\t\t\t\t\t$sidebar-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 889,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 890,
            "text": "\r"
          },
          {
            "lineNumber": 891,
            "text": "\t\t\t\t// Allow more than 30 meta keys in the Custom Fields editor panel.\r"
          },
          {
            "lineNumber": 892,
            "text": "\t\t\t\tadd_filter( 'postmeta_form_limit', array( $this, 'custom_fields_key_limit' ) );\r"
          },
          {
            "lineNumber": 893,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 894,
            "text": "\r"
          },
          {
            "lineNumber": 895,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomy_Overlapper' ) ) {\r"
          },
          {
            "lineNumber": 896,
            "text": "\t\t\t\t$overlapper = new Inventory_Presser_Taxonomy_Overlapper();\r"
          },
          {
            "lineNumber": 897,
            "text": "\t\t\t\t$overlapper-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 898,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 899,
            "text": "\r"
          },
          {
            "lineNumber": 900,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Schema_Org_Generator' ) ) {\r"
          },
          {
            "lineNumber": 901,
            "text": "\t\t\t\t$schema_generator = new Inventory_Presser_Schema_Org_Generator();\r"
          },
          {
            "lineNumber": 902,
            "text": "\t\t\t\t$schema_generator-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 903,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 904,
            "text": "\r"
          },
          {
            "lineNumber": 905,
            "text": "\t\t\t// Adds the \"View Details\" button to each vehicle in archive loops.\r"
          },
          {
            "lineNumber": 906,
            "text": "\t\t\tadd_action( 'invp_archive_buttons', array( $this, 'add_view_details_button' ), 20 );\r"
          },
          {
            "lineNumber": 907,
            "text": "\r"
          },
          {
            "lineNumber": 908,
            "text": "\t\t\t// Embeds a contact form on vehicle singles if one is chosen at Vehicles → Options.\r"
          },
          {
            "lineNumber": 909,
            "text": "\t\t\tadd_action( 'invp_single_sections', array( $this, 'single_sections_add_form' ) );\r"
          },
          {
            "lineNumber": 910,
            "text": "\r"
          },
          {
            "lineNumber": 911,
            "text": "\t\t\tadd_action( 'plugins_loaded', array( $this, 'loaded' ) );\r"
          },
          {
            "lineNumber": 912,
            "text": "\r"
          },
          {
            "lineNumber": 913,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_REST' ) ) {\r"
          },
          {
            "lineNumber": 914,
            "text": "\t\t\t\t$rest = new Inventory_Presser_REST();\r"
          },
          {
            "lineNumber": 915,
            "text": "\t\t\t\t$rest-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 916,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 917,
            "text": "\r"
          },
          {
            "lineNumber": 918,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Photo_Arranger' ) ) {\r"
          },
          {
            "lineNumber": 919,
            "text": "\t\t\t\t$photo_arranger = new Inventory_Presser_Admin_Photo_Arranger();\r"
          },
          {
            "lineNumber": 920,
            "text": "\t\t\t\t$photo_arranger-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 921,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 922,
            "text": "\r"
          },
          {
            "lineNumber": 923,
            "text": "\t\t\t// Change archive page titles.\r"
          },
          {
            "lineNumber": 924,
            "text": "\t\t\tadd_filter( 'document_title_parts', array( $this, 'change_archive_title_tags' ) );\r"
          },
          {
            "lineNumber": 925,
            "text": "\r"
          },
          {
            "lineNumber": 926,
            "text": "\t\t\t// Add a link to the Settings page on the plugin management page.\r"
          },
          {
            "lineNumber": 927,
            "text": "\t\t\tadd_filter( 'plugin_action_links_' . INVP_PLUGIN_BASE, array( $this, 'insert_settings_link' ), 2, 2 );\r"
          },
          {
            "lineNumber": 928,
            "text": "\r"
          },
          {
            "lineNumber": 929,
            "text": "\t\t\t// Add tests to the Site Health Status page.\r"
          },
          {
            "lineNumber": 930,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Site_Health' ) ) {\r"
          },
          {
            "lineNumber": 931,
            "text": "\t\t\t\t$health = new Inventory_Presser_Site_Health();\r"
          },
          {
            "lineNumber": 932,
            "text": "\t\t\t\t$health-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 933,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 934,
            "text": "\r"
          },
          {
            "lineNumber": 935,
            "text": "\t\t\tadd_action( 'plugins_loaded', array( $this, 'load_integrations' ) );\r"
          },
          {
            "lineNumber": 936,
            "text": "\t\t"
          }
        ],
        "originalContents": "\r\n\t\t\t\t// Add a sidebar to the editor when editing vehicles.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Editor_Sidebar' ) ) {\r\n\t\t\t\t\t$sidebar = new Inventory_Presser_Admin_Editor_Sidebar();\r\n\t\t\t\t\t$sidebar-\u003eadd_hooks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow more than 30 meta keys in the Custom Fields editor panel.\r\n\t\t\t\tadd_filter( 'postmeta_form_limit', array( $this, 'custom_fields_key_limit' ) );\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomy_Overlapper' ) ) {\r\n\t\t\t\t$overlapper = new Inventory_Presser_Taxonomy_Overlapper();\r\n\t\t\t\t$overlapper-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Schema_Org_Generator' ) ) {\r\n\t\t\t\t$schema_generator = new Inventory_Presser_Schema_Org_Generator();\r\n\t\t\t\t$schema_generator-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Adds the \"View Details\" button to each vehicle in archive loops.\r\n\t\t\tadd_action( 'invp_archive_buttons', array( $this, 'add_view_details_button' ), 20 );\r\n\r\n\t\t\t// Embeds a contact form on vehicle singles if one is chosen at Vehicles → Options.\r\n\t\t\tadd_action( 'invp_single_sections', array( $this, 'single_sections_add_form' ) );\r\n\r\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'loaded' ) );\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_REST' ) ) {\r\n\t\t\t\t$rest = new Inventory_Presser_REST();\r\n\t\t\t\t$rest-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Photo_Arranger' ) ) {\r\n\t\t\t\t$photo_arranger = new Inventory_Presser_Admin_Photo_Arranger();\r\n\t\t\t\t$photo_arranger-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Change archive page titles.\r\n\t\t\tadd_filter( 'document_title_parts', array( $this, 'change_archive_title_tags' ) );\r\n\r\n\t\t\t// Add a link to the Settings page on the plugin management page.\r\n\t\t\tadd_filter( 'plugin_action_links_' . INVP_PLUGIN_BASE, array( $this, 'insert_settings_link' ), 2, 2 );\r\n\r\n\t\t\t// Add tests to the Site Health Status page.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Site_Health' ) ) {\r\n\t\t\t\t$health = new Inventory_Presser_Site_Health();\r\n\t\t\t\t$health-\u003eadd_hooks();\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "column": 2,
            "line": 935
          },
          "startPosition": {
            "line": 881
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.4131743907928467
    },
    {
      "codeBlock": {
        "contents": "\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Vin' ) ) {\r\n\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Vin();\r\n\t\t\t\t$shortcodes-\u003eadd_hooks();\r\n\t\t\t}\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Sort_By' ) ) {\r\n\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Sort_By();\r\n\t\t\t\t$shortcodes-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * When the active theme isn't prepared to display vehicles, insert\r\n\t\t\t * our archive and single vehicle shortcodes.\r\n\t\t\t */\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Template_Provider' ) ) {\r\n\t\t\t\t$template_provider = new Inventory_Presser_Template_Provider();\r\n\t\t\t\t$template_provider-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add blocks.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Blocks' ) ) {\r\n\t\t\t\t$blocks = new Inventory_Presser_Blocks();\r\n\t\t\t\t$blocks-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Add photo number meta values to vehicle photos uploaded in the\r\n\t\t\t * dashboard\r\n\t\t\t */\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Photo_Numberer' ) ) {\r\n\t\t\t\t$photo_numberer = new Inventory_Presser_Photo_Numberer();\r\n\t\t\t\t$photo_numberer-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Allow additional vehicle archives to be created.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Additional_Listings_Pages' ) ) {\r\n\t\t\t\t$additional_archives = new Inventory_Presser_Additional_Listings_Pages();\r\n\t\t\t\t$additional_archives-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add menus to the admin bar.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Bar' ) ) {\r\n\t\t\t\t$bar = new Inventory_Presser_Admin_Bar();\r\n\t\t\t\t$bar-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( is_admin() ) {\r\n\t\t\t\t// Initialize our Settings page in the Dashboard.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Options' ) ) {\r\n\t\t\t\t\t$options = new Inventory_Presser_Admin_Options();\r\n\t\t\t\t\t$options-\u003eadd_hooks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add columns to the vehicle posts list.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Posts_List' ) ) {\r\n\t\t\t\t\t$posts_list = new Inventory_Presser_Admin_Posts_List();\r\n\t\t\t\t\t$posts_list-\u003eadd_hooks();\r\n\t\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 825,
            "text": "\t\t\t\t$shortcodes-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 826,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 827,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Vin' ) ) {\r"
          },
          {
            "lineNumber": 828,
            "text": "\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Vin();\r"
          },
          {
            "lineNumber": 829,
            "text": "\t\t\t\t$shortcodes-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 830,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 831,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Sort_By' ) ) {\r"
          },
          {
            "lineNumber": 832,
            "text": "\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Sort_By();\r"
          },
          {
            "lineNumber": 833,
            "text": "\t\t\t\t$shortcodes-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 834,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 835,
            "text": "\r"
          },
          {
            "lineNumber": 836,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 837,
            "text": "\t\t\t * When the active theme isn't prepared to display vehicles, insert\r"
          },
          {
            "lineNumber": 838,
            "text": "\t\t\t * our archive and single vehicle shortcodes.\r"
          },
          {
            "lineNumber": 839,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 840,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Template_Provider' ) ) {\r"
          },
          {
            "lineNumber": 841,
            "text": "\t\t\t\t$template_provider = new Inventory_Presser_Template_Provider();\r"
          },
          {
            "lineNumber": 842,
            "text": "\t\t\t\t$template_provider-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 843,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 844,
            "text": "\r"
          },
          {
            "lineNumber": 845,
            "text": "\t\t\t// Add blocks.\r"
          },
          {
            "lineNumber": 846,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Blocks' ) ) {\r"
          },
          {
            "lineNumber": 847,
            "text": "\t\t\t\t$blocks = new Inventory_Presser_Blocks();\r"
          },
          {
            "lineNumber": 848,
            "text": "\t\t\t\t$blocks-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 849,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 850,
            "text": "\r"
          },
          {
            "lineNumber": 851,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 852,
            "text": "\t\t\t * Add photo number meta values to vehicle photos uploaded in the\r"
          },
          {
            "lineNumber": 853,
            "text": "\t\t\t * dashboard\r"
          },
          {
            "lineNumber": 854,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 855,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Photo_Numberer' ) ) {\r"
          },
          {
            "lineNumber": 856,
            "text": "\t\t\t\t$photo_numberer = new Inventory_Presser_Photo_Numberer();\r"
          },
          {
            "lineNumber": 857,
            "text": "\t\t\t\t$photo_numberer-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 858,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 859,
            "text": "\r"
          },
          {
            "lineNumber": 860,
            "text": "\t\t\t// Allow additional vehicle archives to be created.\r"
          },
          {
            "lineNumber": 861,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Additional_Listings_Pages' ) ) {\r"
          },
          {
            "lineNumber": 862,
            "text": "\t\t\t\t$additional_archives = new Inventory_Presser_Additional_Listings_Pages();\r"
          },
          {
            "lineNumber": 863,
            "text": "\t\t\t\t$additional_archives-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 864,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 865,
            "text": "\r"
          },
          {
            "lineNumber": 866,
            "text": "\t\t\t// Add menus to the admin bar.\r"
          },
          {
            "lineNumber": 867,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Bar' ) ) {\r"
          },
          {
            "lineNumber": 868,
            "text": "\t\t\t\t$bar = new Inventory_Presser_Admin_Bar();\r"
          },
          {
            "lineNumber": 869,
            "text": "\t\t\t\t$bar-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 870,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 871,
            "text": "\r"
          },
          {
            "lineNumber": 872,
            "text": "\t\t\tif ( is_admin() ) {\r"
          },
          {
            "lineNumber": 873,
            "text": "\t\t\t\t// Initialize our Settings page in the Dashboard.\r"
          },
          {
            "lineNumber": 874,
            "text": "\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Options' ) ) {\r"
          },
          {
            "lineNumber": 875,
            "text": "\t\t\t\t\t$options = new Inventory_Presser_Admin_Options();\r"
          },
          {
            "lineNumber": 876,
            "text": "\t\t\t\t\t$options-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 877,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 878,
            "text": "\r"
          },
          {
            "lineNumber": 879,
            "text": "\t\t\t\t// Add columns to the vehicle posts list.\r"
          },
          {
            "lineNumber": 880,
            "text": "\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Posts_List' ) ) {\r"
          },
          {
            "lineNumber": 881,
            "text": "\t\t\t\t\t$posts_list = new Inventory_Presser_Admin_Posts_List();\r"
          },
          {
            "lineNumber": 882,
            "text": "\t\t\t\t\t$posts_list-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 883,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 884,
            "text": "\r"
          },
          {
            "lineNumber": 885,
            "text": "\t\t\t\t// Add a sidebar to the editor when editing vehicles.\r"
          }
        ],
        "originalContents": "\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Vin' ) ) {\r\n\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Vin();\r\n\t\t\t\t$shortcodes-\u003eadd_hooks();\r\n\t\t\t}\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Shortcode_Sort_By' ) ) {\r\n\t\t\t\t$shortcodes = new Inventory_Presser_Shortcode_Sort_By();\r\n\t\t\t\t$shortcodes-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * When the active theme isn't prepared to display vehicles, insert\r\n\t\t\t * our archive and single vehicle shortcodes.\r\n\t\t\t */\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Template_Provider' ) ) {\r\n\t\t\t\t$template_provider = new Inventory_Presser_Template_Provider();\r\n\t\t\t\t$template_provider-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add blocks.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Blocks' ) ) {\r\n\t\t\t\t$blocks = new Inventory_Presser_Blocks();\r\n\t\t\t\t$blocks-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Add photo number meta values to vehicle photos uploaded in the\r\n\t\t\t * dashboard\r\n\t\t\t */\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Photo_Numberer' ) ) {\r\n\t\t\t\t$photo_numberer = new Inventory_Presser_Photo_Numberer();\r\n\t\t\t\t$photo_numberer-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Allow additional vehicle archives to be created.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Additional_Listings_Pages' ) ) {\r\n\t\t\t\t$additional_archives = new Inventory_Presser_Additional_Listings_Pages();\r\n\t\t\t\t$additional_archives-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add menus to the admin bar.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Bar' ) ) {\r\n\t\t\t\t$bar = new Inventory_Presser_Admin_Bar();\r\n\t\t\t\t$bar-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\tif ( is_admin() ) {\r\n\t\t\t\t// Initialize our Settings page in the Dashboard.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Options' ) ) {\r\n\t\t\t\t\t$options = new Inventory_Presser_Admin_Options();\r\n\t\t\t\t\t$options-\u003eadd_hooks();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add columns to the vehicle posts list.\r\n\t\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Posts_List' ) ) {\r\n\t\t\t\t\t$posts_list = new Inventory_Presser_Admin_Posts_List();\r\n\t\t\t\t\t$posts_list-\u003eadd_hooks();\r\n\t\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 885
          },
          "startPosition": {
            "line": 824
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.4002976417541504
    },
    {
      "codeBlock": {
        "contents": "\r\n\r\n/**\r\n * Editor sidebar spin up.\r\n */\r\n( function( wp ) {\r\n\tvar registerPlugin = wp.plugins.registerPlugin;\r\n\tvar PluginSidebar  = wp.editor.PluginSidebar;\r\n\tvar el             = wp.element.createElement;\r\n\tvar Text           = wp.components.TextControl;\r\n\tvar Select         = wp.components.SelectControl;\r\n\tvar Checkbox       = wp.components.CheckboxControl;\r\n\tvar withSelect     = wp.data.withSelect;\r\n\tvar withDispatch   = wp.data.withDispatch;\r\n\tvar compose        = wp.compose.compose;\r\n\tconst { __ } = wp.i18n;\r\n\r\n\tfunction getLabel( meta_key ) {\r\n\t\tif ( invp.meta_prefix !== meta_key.substr(0, invp.meta_prefix.length ) ) {\r\n\t\t\treturn meta_key;\r\n\t\t}\r\n\r\n\t\tvar key = meta_key.substring( invp.meta_prefix.length );\r\n\t\tswitch ( key ) {\r\n\t\t\tcase 'msrp':\r\n\t\t\tcase 'vin':\r\n\t\t\t\treturn key.toUpperCase();\r\n\r\n\t\t\tcase 'odometer':\r\n\t\t\t\treturn invp.odometer_label + ' (' + invp.odometer_units + ')';\r\n\r\n\t\t\tcase 'youtube':\r\n\t\t\t\treturn __( 'YouTube Video ID', 'inventory-presser' );\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t/**\r\n\t\t\t\t * Replace underscores with spaces, capitalize the first letter,\r\n\t\t\t\t * and capitalize ID, KBB, NADA, and URL.\r\n\t\t\t\t */\r\n\t\t\t\tconst pattern = /_/g;\r\n\t\t\t\treturn ucwords( key.replace( pattern, ' ' ) )\r\n\t\t\t\t\t.replace( 'Id', 'ID' )\r\n\t\t\t\t\t.replace( 'Kbb', 'KBB' )\r\n\t\t\t\t\t.replace( 'Nada', 'NADA' )\r\n\t\t\t\t\t.replace( 'Url', 'URL' );\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tfunction hullMaterialOptions()\r\n\t{\r\n\t\tvar options = [{label:'',value:''}];\r\n\t\tfor ( var l = 0; l \u003c invp.hull_materials.length; l++ ) {\r\n\t\t\toptions.push(\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: invp.hull_materials[l],\r\n\t\t\t\t\tvalue: invp.hull_materials[l].toLowerCase().replace( ' ', '-' )\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tfunction paymentFrequencyOptions()\r\n\t{\r\n\t\tvar options = [{label:'',value:''}];\r\n\t\tfor ( var label in invp.payment_frequencies ) {\r\n\t\t\toptions.push(\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: label,\r\n\t\t\t\t\tvalue: invp.payment_frequencies[label]\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn options;\r\n\t}",
        "detailedLines": [
          {
            "isSignature": true,
            "lineNumber": 45,
            "text": "function invpFormatCurrency( value ) {\r"
          },
          {
            "lineNumber": 49,
            "text": "\r"
          },
          {
            "lineNumber": 50,
            "text": "\t}\r"
          },
          {
            "lineNumber": 51,
            "text": "\treturn value;\r"
          },
          {
            "isSignature": true,
            "lineNumber": 52,
            "text": "}\r"
          },
          {
            "lineNumber": 53,
            "text": "\r"
          },
          {
            "lineNumber": 54,
            "text": "/**\r"
          },
          {
            "lineNumber": 55,
            "text": " * Editor sidebar spin up.\r"
          },
          {
            "lineNumber": 56,
            "text": " */\r"
          },
          {
            "lineNumber": 57,
            "text": "( function( wp ) {\r"
          },
          {
            "lineNumber": 58,
            "text": "\tvar registerPlugin = wp.plugins.registerPlugin;\r"
          },
          {
            "lineNumber": 59,
            "text": "\tvar PluginSidebar  = wp.editor.PluginSidebar;\r"
          },
          {
            "lineNumber": 60,
            "text": "\tvar el             = wp.element.createElement;\r"
          },
          {
            "lineNumber": 61,
            "text": "\tvar Text           = wp.components.TextControl;\r"
          },
          {
            "lineNumber": 62,
            "text": "\tvar Select         = wp.components.SelectControl;\r"
          },
          {
            "lineNumber": 63,
            "text": "\tvar Checkbox       = wp.components.CheckboxControl;\r"
          },
          {
            "lineNumber": 64,
            "text": "\tvar withSelect     = wp.data.withSelect;\r"
          },
          {
            "lineNumber": 65,
            "text": "\tvar withDispatch   = wp.data.withDispatch;\r"
          },
          {
            "lineNumber": 66,
            "text": "\tvar compose        = wp.compose.compose;\r"
          },
          {
            "lineNumber": 67,
            "text": "\tconst { __ } = wp.i18n;\r"
          },
          {
            "lineNumber": 68,
            "text": "\r"
          },
          {
            "lineNumber": 69,
            "text": "\tfunction getLabel( meta_key ) {\r"
          },
          {
            "lineNumber": 70,
            "text": "\t\tif ( invp.meta_prefix !== meta_key.substr(0, invp.meta_prefix.length ) ) {\r"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\treturn meta_key;\r"
          },
          {
            "lineNumber": 72,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 73,
            "text": "\r"
          },
          {
            "lineNumber": 74,
            "text": "\t\tvar key = meta_key.substring( invp.meta_prefix.length );\r"
          },
          {
            "lineNumber": 75,
            "text": "\t\tswitch ( key ) {\r"
          },
          {
            "lineNumber": 76,
            "text": "\t\t\tcase 'msrp':\r"
          },
          {
            "lineNumber": 77,
            "text": "\t\t\tcase 'vin':\r"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t\treturn key.toUpperCase();\r"
          },
          {
            "lineNumber": 79,
            "text": "\r"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\tcase 'odometer':\r"
          },
          {
            "lineNumber": 81,
            "text": "\t\t\t\treturn invp.odometer_label + ' (' + invp.odometer_units + ')';\r"
          },
          {
            "lineNumber": 82,
            "text": "\r"
          },
          {
            "lineNumber": 83,
            "text": "\t\t\tcase 'youtube':\r"
          },
          {
            "lineNumber": 84,
            "text": "\t\t\t\treturn __( 'YouTube Video ID', 'inventory-presser' );\r"
          },
          {
            "lineNumber": 85,
            "text": "\r"
          },
          {
            "lineNumber": 86,
            "text": "\t\t\tdefault:\r"
          },
          {
            "lineNumber": 87,
            "text": "\t\t\t\t/**\r"
          },
          {
            "lineNumber": 88,
            "text": "\t\t\t\t * Replace underscores with spaces, capitalize the first letter,\r"
          },
          {
            "lineNumber": 89,
            "text": "\t\t\t\t * and capitalize ID, KBB, NADA, and URL.\r"
          },
          {
            "lineNumber": 90,
            "text": "\t\t\t\t */\r"
          },
          {
            "lineNumber": 91,
            "text": "\t\t\t\tconst pattern = /_/g;\r"
          },
          {
            "lineNumber": 92,
            "text": "\t\t\t\treturn ucwords( key.replace( pattern, ' ' ) )\r"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\t\t\t.replace( 'Id', 'ID' )\r"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\t\t\t.replace( 'Kbb', 'KBB' )\r"
          },
          {
            "lineNumber": 95,
            "text": "\t\t\t\t\t.replace( 'Nada', 'NADA' )\r"
          },
          {
            "lineNumber": 96,
            "text": "\t\t\t\t\t.replace( 'Url', 'URL' );\r"
          },
          {
            "lineNumber": 97,
            "text": "\r"
          },
          {
            "lineNumber": 98,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 99,
            "text": "\t}\r"
          },
          {
            "lineNumber": 100,
            "text": "\r"
          },
          {
            "lineNumber": 101,
            "text": "\tfunction hullMaterialOptions()\r"
          },
          {
            "lineNumber": 102,
            "text": "\t{\r"
          },
          {
            "lineNumber": 103,
            "text": "\t\tvar options = [{label:'',value:''}];\r"
          },
          {
            "lineNumber": 104,
            "text": "\t\tfor ( var l = 0; l \u003c invp.hull_materials.length; l++ ) {\r"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\toptions.push(\r"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\t\t{\r"
          },
          {
            "lineNumber": 107,
            "text": "\t\t\t\t\tlabel: invp.hull_materials[l],\r"
          },
          {
            "lineNumber": 108,
            "text": "\t\t\t\t\tvalue: invp.hull_materials[l].toLowerCase().replace( ' ', '-' )\r"
          },
          {
            "lineNumber": 109,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 111,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 112,
            "text": "\t\treturn options;\r"
          },
          {
            "lineNumber": 113,
            "text": "\t}\r"
          },
          {
            "lineNumber": 114,
            "text": "\r"
          },
          {
            "lineNumber": 115,
            "text": "\tfunction paymentFrequencyOptions()\r"
          },
          {
            "lineNumber": 116,
            "text": "\t{\r"
          },
          {
            "lineNumber": 117,
            "text": "\t\tvar options = [{label:'',value:''}];\r"
          },
          {
            "lineNumber": 118,
            "text": "\t\tfor ( var label in invp.payment_frequencies ) {\r"
          },
          {
            "lineNumber": 119,
            "text": "\t\t\toptions.push(\r"
          },
          {
            "lineNumber": 120,
            "text": "\t\t\t\t{\r"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t\t\tlabel: label,\r"
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t\t\tvalue: invp.payment_frequencies[label]\r"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 125,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 126,
            "text": "\t\treturn options;\r"
          },
          {
            "lineNumber": 127,
            "text": "\t}\r"
          },
          {
            "lineNumber": 128,
            "text": "\r"
          },
          {
            "lineNumber": 129,
            "text": "\tfunction titleStatusOptions()\r"
          },
          {
            "lineNumber": 130,
            "text": "\t{\r"
          },
          {
            "lineNumber": 131,
            "text": "\t\tvar options = [{label:'',value:''}];"
          },
          {
            "lineNumber": 141,
            "text": "\t}"
          }
        ],
        "originalContents": "\r\n\r\n/**\r\n * Editor sidebar spin up.\r\n */\r\n( function( wp ) {\r\n\tvar registerPlugin = wp.plugins.registerPlugin;\r\n\tvar PluginSidebar  = wp.editor.PluginSidebar;\r\n\tvar el             = wp.element.createElement;\r\n\tvar Text           = wp.components.TextControl;\r\n\tvar Select         = wp.components.SelectControl;\r\n\tvar Checkbox       = wp.components.CheckboxControl;\r\n\tvar withSelect     = wp.data.withSelect;\r\n\tvar withDispatch   = wp.data.withDispatch;\r\n\tvar compose        = wp.compose.compose;\r\n\tconst { __ } = wp.i18n;\r\n\r\n\tfunction getLabel( meta_key ) {\r\n\t\tif ( invp.meta_prefix !== meta_key.substr(0, invp.meta_prefix.length ) ) {\r\n\t\t\treturn meta_key;\r\n\t\t}\r\n\r\n\t\tvar key = meta_key.substring( invp.meta_prefix.length );\r\n\t\tswitch ( key ) {\r\n\t\t\tcase 'msrp':\r\n\t\t\tcase 'vin':\r\n\t\t\t\treturn key.toUpperCase();\r\n\r\n\t\t\tcase 'odometer':\r\n\t\t\t\treturn invp.odometer_label + ' (' + invp.odometer_units + ')';\r\n\r\n\t\t\tcase 'youtube':\r\n\t\t\t\treturn __( 'YouTube Video ID', 'inventory-presser' );\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t/**\r\n\t\t\t\t * Replace underscores with spaces, capitalize the first letter,\r\n\t\t\t\t * and capitalize ID, KBB, NADA, and URL.\r\n\t\t\t\t */\r\n\t\t\t\tconst pattern = /_/g;\r\n\t\t\t\treturn ucwords( key.replace( pattern, ' ' ) )\r\n\t\t\t\t\t.replace( 'Id', 'ID' )\r\n\t\t\t\t\t.replace( 'Kbb', 'KBB' )\r\n\t\t\t\t\t.replace( 'Nada', 'NADA' )\r\n\t\t\t\t\t.replace( 'Url', 'URL' );\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tfunction hullMaterialOptions()\r\n\t{\r\n\t\tvar options = [{label:'',value:''}];\r\n\t\tfor ( var l = 0; l \u003c invp.hull_materials.length; l++ ) {\r\n\t\t\toptions.push(\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: invp.hull_materials[l],\r\n\t\t\t\t\tvalue: invp.hull_materials[l].toLowerCase().replace( ' ', '-' )\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn options;\r\n\t}\r\n\r\n\tfunction paymentFrequencyOptions()\r\n\t{\r\n\t\tvar options = [{label:'',value:''}];\r\n\t\tfor ( var label in invp.payment_frequencies ) {\r\n\t\t\toptions.push(\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: label,\r\n\t\t\t\t\tvalue: invp.payment_frequencies[label]\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn options;\r\n\t}",
        "range": {
          "endPosition": {
            "line": 584
          },
          "startPosition": {
            "line": 44
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js"
      },
      "score": 0.37843239307403564
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t// Register some widgets included with this plugin.\r\n\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of\r\n\t\t\t * the query that's fetching post objects.\r\n\t\t\t */\r\n\t\t\tif ( ! is_admin() ) {\r\n\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );\r\n\t\t\t}\r\n\r\n\t\t\t// Register scripts and styles.\r\n\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\r\n\t\t\t// Allow custom fields to be searched.\r\n\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {\r\n\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();\r\n\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect URLs by VINs to proper vehicle permalinks.\r\n\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {\r\n\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();\r\n\t\t\t\t$allow_urls_by_vin-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add buttons near vehicles for Carfax reports or NextGear inspections.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Badges' ) ) {\r\n\t\t\t\t$badges = new Inventory_Presser_Badges();\r\n\t\t\t\t$badges-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect 404 vehicles to make archives.\r\n\t\t\tif ( class_exists( 'Redirect_404_Vehicles' ) ) {\r\n\t\t\t\t$redirect_404_vehicles = new Redirect_404_Vehicles();\r\n\t\t\t\t$redirect_404_vehicles-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Modify the URL of an \"Email a Friend\" menu item on the \"Vehicle Details Buttons\" menu.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Email_A_Friend' ) ) {\r\n\t\t\t\t$email_a_friend = new Inventory_Presser_Email_A_Friend();\r\n\t\t\t\t$email_a_friend-\u003eadd_hooks();\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 699,
            "text": "\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );\r"
          },
          {
            "lineNumber": 700,
            "text": "\r"
          },
          {
            "lineNumber": 701,
            "text": "\t\t\t// Register some widgets included with this plugin.\r"
          },
          {
            "lineNumber": 702,
            "text": "\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );\r"
          },
          {
            "lineNumber": 703,
            "text": "\r"
          },
          {
            "lineNumber": 704,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 705,
            "text": "\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of\r"
          },
          {
            "lineNumber": 706,
            "text": "\t\t\t * the query that's fetching post objects.\r"
          },
          {
            "lineNumber": 707,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 708,
            "text": "\t\t\tif ( ! is_admin() ) {\r"
          },
          {
            "lineNumber": 709,
            "text": "\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );\r"
          },
          {
            "lineNumber": 710,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 711,
            "text": "\r"
          },
          {
            "lineNumber": 712,
            "text": "\t\t\t// Register scripts and styles.\r"
          },
          {
            "lineNumber": 713,
            "text": "\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r"
          },
          {
            "lineNumber": 714,
            "text": "\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r"
          },
          {
            "lineNumber": 715,
            "text": "\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );\r"
          },
          {
            "lineNumber": 716,
            "text": "\r"
          },
          {
            "lineNumber": 717,
            "text": "\t\t\t// Allow custom fields to be searched.\r"
          },
          {
            "lineNumber": 718,
            "text": "\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {\r"
          },
          {
            "lineNumber": 719,
            "text": "\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();\r"
          },
          {
            "lineNumber": 720,
            "text": "\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 721,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 722,
            "text": "\r"
          },
          {
            "lineNumber": 723,
            "text": "\t\t\t// Redirect URLs by VINs to proper vehicle permalinks.\r"
          },
          {
            "lineNumber": 724,
            "text": "\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {\r"
          },
          {
            "lineNumber": 725,
            "text": "\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();\r"
          },
          {
            "lineNumber": 726,
            "text": "\t\t\t\t$allow_urls_by_vin-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 727,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 728,
            "text": "\r"
          },
          {
            "lineNumber": 729,
            "text": "\t\t\t// Add buttons near vehicles for Carfax reports or NextGear inspections.\r"
          },
          {
            "lineNumber": 730,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Badges' ) ) {\r"
          },
          {
            "lineNumber": 731,
            "text": "\t\t\t\t$badges = new Inventory_Presser_Badges();\r"
          },
          {
            "lineNumber": 732,
            "text": "\t\t\t\t$badges-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 733,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 734,
            "text": "\r"
          },
          {
            "lineNumber": 735,
            "text": "\t\t\t// Redirect 404 vehicles to make archives.\r"
          },
          {
            "lineNumber": 736,
            "text": "\t\t\tif ( class_exists( 'Redirect_404_Vehicles' ) ) {\r"
          },
          {
            "lineNumber": 737,
            "text": "\t\t\t\t$redirect_404_vehicles = new Redirect_404_Vehicles();\r"
          },
          {
            "lineNumber": 738,
            "text": "\t\t\t\t$redirect_404_vehicles-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 739,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 740,
            "text": "\r"
          },
          {
            "lineNumber": 741,
            "text": "\t\t\t// Modify the URL of an \"Email a Friend\" menu item on the \"Vehicle Details Buttons\" menu.\r"
          },
          {
            "lineNumber": 742,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Email_A_Friend' ) ) {\r"
          },
          {
            "lineNumber": 743,
            "text": "\t\t\t\t$email_a_friend = new Inventory_Presser_Email_A_Friend();\r"
          },
          {
            "lineNumber": 744,
            "text": "\t\t\t\t$email_a_friend-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 745,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 746,
            "text": "\r"
          },
          {
            "lineNumber": 747,
            "text": "\t\t\t// Make it possible for a menu item to print the page.\r"
          }
        ],
        "originalContents": "\r\n\t\t\t// Register some widgets included with this plugin.\r\n\t\t\tadd_action( 'widgets_init', array( $this, 'register_widgets' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Deliver our promise to order posts, change the ORDER BY clause of\r\n\t\t\t * the query that's fetching post objects.\r\n\t\t\t */\r\n\t\t\tif ( ! is_admin() ) {\r\n\t\t\t\tadd_action( 'pre_get_posts', array( $this, 'add_orderby_to_query' ) );\r\n\t\t\t}\r\n\r\n\t\t\t// Register scripts and styles.\r\n\t\t\tadd_action( 'wp_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\t\t\tadd_action( 'admin_enqueue_scripts', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\t\t\tadd_action( 'enqueue_block_assets', array( __CLASS__, 'include_scripts_and_styles' ) );\r\n\r\n\t\t\t// Allow custom fields to be searched.\r\n\t\t\tif ( class_exists( 'Add_Custom_Fields_To_Search' ) ) {\r\n\t\t\t\t$add_custom_fields_to_search = new Add_Custom_Fields_To_Search();\r\n\t\t\t\t$add_custom_fields_to_search-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect URLs by VINs to proper vehicle permalinks.\r\n\t\t\tif ( class_exists( 'Vehicle_URLs_By_VIN' ) ) {\r\n\t\t\t\t$allow_urls_by_vin = new Vehicle_URLs_By_VIN();\r\n\t\t\t\t$allow_urls_by_vin-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Add buttons near vehicles for Carfax reports or NextGear inspections.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Badges' ) ) {\r\n\t\t\t\t$badges = new Inventory_Presser_Badges();\r\n\t\t\t\t$badges-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect 404 vehicles to make archives.\r\n\t\t\tif ( class_exists( 'Redirect_404_Vehicles' ) ) {\r\n\t\t\t\t$redirect_404_vehicles = new Redirect_404_Vehicles();\r\n\t\t\t\t$redirect_404_vehicles-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Modify the URL of an \"Email a Friend\" menu item on the \"Vehicle Details Buttons\" menu.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Email_A_Friend' ) ) {\r\n\t\t\t\t$email_a_friend = new Inventory_Presser_Email_A_Friend();\r\n\t\t\t\t$email_a_friend-\u003eadd_hooks();\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 747
          },
          "startPosition": {
            "line": 698
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.3686027526855469
    },
    {
      "codeBlock": {
        "contents": "\t\t\t\t'shortcode/class-shortcode-vin.php',\r\n\t\t\t\t'class-taxonomies.php',\r\n\t\t\t\t'class-taxonomy-overlapper.php',\r\n\t\t\t\t'class-template-provider.php',\r\n\t\t\t\t'class-vehicle-urls-by-vin.php',\r\n\t\t\t\t'widget/class-widget-address.php',\r\n\t\t\t\t'widget/class-widget-carfax.php',\r\n\t\t\t\t'widget/class-widget-fuel-economy.php',\r\n\t\t\t\t'widget/class-widget-google-maps.php',\r\n\t\t\t\t'widget/class-widget-google-maps-v3.php',\r\n\t\t\t\t'widget/class-widget-hours.php',\r\n\t\t\t\t'widget/class-widget-inventory-grid.php',\r\n\t\t\t\t'widget/class-widget-inventory-slider.php',\r\n\t\t\t\t'widget/class-widget-kbb.php',\r\n\t\t\t\t'widget/class-widget-map.php',\r\n\t\t\t\t'widget/class-widget-order-by.php',\r\n\t\t\t\t'widget/class-widget-phones.php',\r\n\t\t\t\t'widget/class-widget-maximum-price-filter.php',\r\n\t\t\t\t'template-tags.php',\r\n\t\t\t);\r\n\t\t\tforeach ( $file_names as $file_name ) {\r\n\t\t\t\t$path = plugin_dir_path( INVP_PLUGIN_FILE_PATH ) . 'includes/' . $file_name;\r\n\t\t\t\tif ( file_exists( $path ) ) {\r\n\t\t\t\t\tinclude $path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers JavaScripts and stylesheets for front-end users and dashboard\r\n\t\t * users. Includes some inline styles and scripts depending on the plugin\r\n\t\t * settings and page request.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function include_scripts_and_styles() {\r\n\r\n\t\t\t// This method might have run already.\r\n\t\t\tif ( wp_script_is( 'invp-slider', 'registered' ) ) {\r\n\t\t\t\t// Abort.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Allow dashicons use on frontend.\r\n\t\t\twp_enqueue_style( 'dashicons' );\r\n",
        "detailedLines": [
          {
            "lineNumber": 1188,
            "text": "\t\t\t\t'shortcode/class-shortcode-sort-by.php',\r"
          },
          {
            "lineNumber": 1189,
            "text": "\t\t\t\t'shortcode/class-shortcode-vin.php',\r"
          },
          {
            "lineNumber": 1190,
            "text": "\t\t\t\t'class-taxonomies.php',\r"
          },
          {
            "lineNumber": 1191,
            "text": "\t\t\t\t'class-taxonomy-overlapper.php',\r"
          },
          {
            "lineNumber": 1192,
            "text": "\t\t\t\t'class-template-provider.php',\r"
          },
          {
            "lineNumber": 1193,
            "text": "\t\t\t\t'class-vehicle-urls-by-vin.php',\r"
          },
          {
            "lineNumber": 1194,
            "text": "\t\t\t\t'widget/class-widget-address.php',\r"
          },
          {
            "lineNumber": 1195,
            "text": "\t\t\t\t'widget/class-widget-carfax.php',\r"
          },
          {
            "lineNumber": 1196,
            "text": "\t\t\t\t'widget/class-widget-fuel-economy.php',\r"
          },
          {
            "lineNumber": 1197,
            "text": "\t\t\t\t'widget/class-widget-google-maps.php',\r"
          },
          {
            "lineNumber": 1198,
            "text": "\t\t\t\t'widget/class-widget-google-maps-v3.php',\r"
          },
          {
            "lineNumber": 1199,
            "text": "\t\t\t\t'widget/class-widget-hours.php',\r"
          },
          {
            "lineNumber": 1200,
            "text": "\t\t\t\t'widget/class-widget-inventory-grid.php',\r"
          },
          {
            "lineNumber": 1201,
            "text": "\t\t\t\t'widget/class-widget-inventory-slider.php',\r"
          },
          {
            "lineNumber": 1202,
            "text": "\t\t\t\t'widget/class-widget-kbb.php',\r"
          },
          {
            "lineNumber": 1203,
            "text": "\t\t\t\t'widget/class-widget-map.php',\r"
          },
          {
            "lineNumber": 1204,
            "text": "\t\t\t\t'widget/class-widget-order-by.php',\r"
          },
          {
            "lineNumber": 1205,
            "text": "\t\t\t\t'widget/class-widget-phones.php',\r"
          },
          {
            "lineNumber": 1206,
            "text": "\t\t\t\t'widget/class-widget-maximum-price-filter.php',\r"
          },
          {
            "lineNumber": 1207,
            "text": "\t\t\t\t'template-tags.php',\r"
          },
          {
            "lineNumber": 1208,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1209,
            "text": "\t\t\tforeach ( $file_names as $file_name ) {\r"
          },
          {
            "lineNumber": 1210,
            "text": "\t\t\t\t$path = plugin_dir_path( INVP_PLUGIN_FILE_PATH ) . 'includes/' . $file_name;\r"
          },
          {
            "lineNumber": 1211,
            "text": "\t\t\t\tif ( file_exists( $path ) ) {\r"
          },
          {
            "lineNumber": 1212,
            "text": "\t\t\t\t\tinclude $path;\r"
          },
          {
            "lineNumber": 1213,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 1214,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1215,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1216,
            "text": "\r"
          },
          {
            "lineNumber": 1217,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1218,
            "text": "\t\t * Registers JavaScripts and stylesheets for front-end users and dashboard\r"
          },
          {
            "lineNumber": 1219,
            "text": "\t\t * users. Includes some inline styles and scripts depending on the plugin\r"
          },
          {
            "lineNumber": 1220,
            "text": "\t\t * settings and page request.\r"
          },
          {
            "lineNumber": 1221,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1222,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 1223,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1224,
            "text": "\t\tpublic static function include_scripts_and_styles() {\r"
          },
          {
            "lineNumber": 1225,
            "text": "\r"
          },
          {
            "lineNumber": 1226,
            "text": "\t\t\t// This method might have run already.\r"
          },
          {
            "lineNumber": 1227,
            "text": "\t\t\tif ( wp_script_is( 'invp-slider', 'registered' ) ) {\r"
          },
          {
            "lineNumber": 1228,
            "text": "\t\t\t\t// Abort.\r"
          },
          {
            "lineNumber": 1229,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1230,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1231,
            "text": "\r"
          },
          {
            "lineNumber": 1232,
            "text": "\t\t\t// Allow dashicons use on frontend.\r"
          },
          {
            "lineNumber": 1233,
            "text": "\t\t\twp_enqueue_style( 'dashicons' );\r"
          },
          {
            "lineNumber": 1234,
            "text": "\r"
          },
          {
            "lineNumber": 1235,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1236,
            "text": "\t\t\t "
          }
        ],
        "originalContents": "\t\t\t\t'shortcode/class-shortcode-vin.php',\r\n\t\t\t\t'class-taxonomies.php',\r\n\t\t\t\t'class-taxonomy-overlapper.php',\r\n\t\t\t\t'class-template-provider.php',\r\n\t\t\t\t'class-vehicle-urls-by-vin.php',\r\n\t\t\t\t'widget/class-widget-address.php',\r\n\t\t\t\t'widget/class-widget-carfax.php',\r\n\t\t\t\t'widget/class-widget-fuel-economy.php',\r\n\t\t\t\t'widget/class-widget-google-maps.php',\r\n\t\t\t\t'widget/class-widget-google-maps-v3.php',\r\n\t\t\t\t'widget/class-widget-hours.php',\r\n\t\t\t\t'widget/class-widget-inventory-grid.php',\r\n\t\t\t\t'widget/class-widget-inventory-slider.php',\r\n\t\t\t\t'widget/class-widget-kbb.php',\r\n\t\t\t\t'widget/class-widget-map.php',\r\n\t\t\t\t'widget/class-widget-order-by.php',\r\n\t\t\t\t'widget/class-widget-phones.php',\r\n\t\t\t\t'widget/class-widget-maximum-price-filter.php',\r\n\t\t\t\t'template-tags.php',\r\n\t\t\t);\r\n\t\t\tforeach ( $file_names as $file_name ) {\r\n\t\t\t\t$path = plugin_dir_path( INVP_PLUGIN_FILE_PATH ) . 'includes/' . $file_name;\r\n\t\t\t\tif ( file_exists( $path ) ) {\r\n\t\t\t\t\tinclude $path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers JavaScripts and stylesheets for front-end users and dashboard\r\n\t\t * users. Includes some inline styles and scripts depending on the plugin\r\n\t\t * settings and page request.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function include_scripts_and_styles() {\r\n\r\n\t\t\t// This method might have run already.\r\n\t\t\tif ( wp_script_is( 'invp-slider', 'registered' ) ) {\r\n\t\t\t\t// Abort.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Allow dashicons use on frontend.\r\n\t\t\twp_enqueue_style( 'dashicons' );\r\n",
        "range": {
          "endPosition": {
            "column": 4,
            "line": 1235
          },
          "startPosition": {
            "line": 1187
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.36305591464042664
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Blocks\r\n *\r\n * Creates blocks\r\n */\r\nclass Inventory_Presser_Blocks {\r\n\r\n\t/**\r\n\t * Adds a block category to hold all our blocks\r\n\t *\r\n\t * @param  array $block_categories\r\n\t * @return array\r\n\t */\r\n\tpublic function add_category( $block_categories ) {\r\n\t\treturn array_merge(\r\n\t\t\t$block_categories,\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r\n\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r\n\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r\n\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r\n\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r\n\r\n\t\t/**\r\n\t\t * When a vehicle is opened in the block editor, add a Description block\r\n\t\t * to the post.\r\n\t\t */\r\n\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a Description Block to the post when a vehicle is opened in the\r\n\t * block editor.\r\n\t *\r\n\t * @param  WP_Post $post The post loaded into the block editor.\r\n\t * @return void\r\n\t */\r\n\tpublic function create_block_description( $post ) {\r\n\t\tglobal $pagenow;\r\n\t\t// Is the user adding or editing a vehicle?\r\n\t\tif ( ! is_admin()\r\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\r\n\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r\n\t\t\t// No.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Does the post content contain a Description block?\r\n\t\t$blocks = parse_blocks( $post-\u003epost_content );\r\n\t\tforeach ( $blocks as $block ) {\r\n\t\t\t// Is this a Description block?\r\n\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r\n\t\t\t\t// Yes. The post already has a Description block.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 3,
            "text": "\r"
          },
          {
            "lineNumber": 4,
            "text": "/**\r"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Blocks\r"
          },
          {
            "lineNumber": 6,
            "text": " *\r"
          },
          {
            "lineNumber": 7,
            "text": " * Creates blocks\r"
          },
          {
            "lineNumber": 8,
            "text": " */\r"
          },
          {
            "lineNumber": 9,
            "text": "class Inventory_Presser_Blocks {\r"
          },
          {
            "lineNumber": 10,
            "text": "\r"
          },
          {
            "lineNumber": 11,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 12,
            "text": "\t * Adds a block category to hold all our blocks\r"
          },
          {
            "lineNumber": 13,
            "text": "\t *\r"
          },
          {
            "lineNumber": 14,
            "text": "\t * @param  array $block_categories\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * @return array\r"
          },
          {
            "lineNumber": 16,
            "text": "\t */\r"
          },
          {
            "lineNumber": 17,
            "text": "\tpublic function add_category( $block_categories ) {\r"
          },
          {
            "lineNumber": 18,
            "text": "\t\treturn array_merge(\r"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t$block_categories,\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t\tarray(\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 22,
            "text": "\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r"
          },
          {
            "lineNumber": 23,
            "text": "\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 24,
            "text": "\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t)\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 28,
            "text": "\t}\r"
          },
          {
            "lineNumber": 29,
            "text": "\r"
          },
          {
            "lineNumber": 30,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 31,
            "text": "\t * Adds hooks\r"
          },
          {
            "lineNumber": 32,
            "text": "\t *\r"
          },
          {
            "lineNumber": 33,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 34,
            "text": "\t */\r"
          },
          {
            "lineNumber": 35,
            "text": "\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 36,
            "text": "\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r"
          },
          {
            "lineNumber": 37,
            "text": "\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r"
          },
          {
            "lineNumber": 38,
            "text": "\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r"
          },
          {
            "lineNumber": 39,
            "text": "\r"
          },
          {
            "lineNumber": 40,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 41,
            "text": "\t\t * When a vehicle is opened in the block editor, add a Description block\r"
          },
          {
            "lineNumber": 42,
            "text": "\t\t * to the post.\r"
          },
          {
            "lineNumber": 43,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 44,
            "text": "\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r"
          },
          {
            "lineNumber": 45,
            "text": "\t}\r"
          },
          {
            "lineNumber": 46,
            "text": "\r"
          },
          {
            "lineNumber": 47,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 48,
            "text": "\t * Adds a Description Block to the post when a vehicle is opened in the\r"
          },
          {
            "lineNumber": 49,
            "text": "\t * block editor.\r"
          },
          {
            "lineNumber": 50,
            "text": "\t *\r"
          },
          {
            "lineNumber": 51,
            "text": "\t * @param  WP_Post $post The post loaded into the block editor.\r"
          },
          {
            "lineNumber": 52,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 53,
            "text": "\t */\r"
          },
          {
            "lineNumber": 54,
            "text": "\tpublic function create_block_description( $post ) {\r"
          },
          {
            "lineNumber": 55,
            "text": "\t\tglobal $pagenow;\r"
          },
          {
            "lineNumber": 56,
            "text": "\t\t// Is the user adding or editing a vehicle?\r"
          },
          {
            "lineNumber": 57,
            "text": "\t\tif ( ! is_admin()\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t|| get_post_type() !== INVP::POST_TYPE\r"
          },
          {
            "lineNumber": 59,
            "text": "\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t// No.\r"
          },
          {
            "lineNumber": 61,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 62,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 63,
            "text": "\r"
          },
          {
            "lineNumber": 64,
            "text": "\t\t// Does the post content contain a Description block?\r"
          },
          {
            "lineNumber": 65,
            "text": "\t\t$blocks = parse_blocks( $post-\u003epost_content );\r"
          },
          {
            "lineNumber": 66,
            "text": "\t\tforeach ( $blocks as $block ) {\r"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t// Is this a Description block?\r"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r"
          },
          {
            "lineNumber": 69,
            "text": "\t\t\t\t// Yes. The post already has a Description block.\r"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 72,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 73,
            "text": "\r"
          },
          {
            "lineNumber": 74,
            "text": "\t\t// The post does not have a Description block. Add one.\r"
          }
        ],
        "originalContents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Blocks\r\n *\r\n * Creates blocks\r\n */\r\nclass Inventory_Presser_Blocks {\r\n\r\n\t/**\r\n\t * Adds a block category to hold all our blocks\r\n\t *\r\n\t * @param  array $block_categories\r\n\t * @return array\r\n\t */\r\n\tpublic function add_category( $block_categories ) {\r\n\t\treturn array_merge(\r\n\t\t\t$block_categories,\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r\n\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r\n\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r\n\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r\n\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r\n\r\n\t\t/**\r\n\t\t * When a vehicle is opened in the block editor, add a Description block\r\n\t\t * to the post.\r\n\t\t */\r\n\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a Description Block to the post when a vehicle is opened in the\r\n\t * block editor.\r\n\t *\r\n\t * @param  WP_Post $post The post loaded into the block editor.\r\n\t * @return void\r\n\t */\r\n\tpublic function create_block_description( $post ) {\r\n\t\tglobal $pagenow;\r\n\t\t// Is the user adding or editing a vehicle?\r\n\t\tif ( ! is_admin()\r\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\r\n\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r\n\t\t\t// No.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Does the post content contain a Description block?\r\n\t\t$blocks = parse_blocks( $post-\u003epost_content );\r\n\t\tforeach ( $blocks as $block ) {\r\n\t\t\t// Is this a Description block?\r\n\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r\n\t\t\t\t// Yes. The post already has a Description block.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 74
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/class-blocks.php"
      },
      "score": 0.3444685935974121
    },
    {
      "codeBlock": {
        "contents": "\n\r\n\t\t\t\t...\n\r\n\t\t\t\tif ( 'boat' === inventory_presser_type.toLowerCase() ) {\r\n\t\t\t\t\t// Yes, add the boat fields.\r\n\t\t\t\t\tfields = el(\r\n\t\t\t\t\t\twp.element.Fragment,\r\n\t\t\t\t\t\t{},\r\n\t\t\t\t\t\tfields,\r\n\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\twp.element.Fragment,\r\n\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\t'h2',\r\n\t\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\t\t'Boat Attributes'\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockField,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'beam',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'beam',\r\n\t\t\t\t\t\t\t\t\tisNumeric: true,\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockField,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'length',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'length',\r\n\t\t\t\t\t\t\t\t\tisNumeric: true,\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockFieldSelect,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'hull_material',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'hull_material',\r\n\t\t\t\t\t\t\t\t\tisNumeric: false,\r\n\t\t\t\t\t\t\t\t\toptionArray: hullMaterialOptions(),\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow add-ons to change the sidebar fields.\r\n\t\t\t\tfields = wp.hooks.applyFilters( 'invp_editor_sidebar_elements', fields, inventory_presser_type );\r\n\t\t\t\treturn el(\r\n\t\t\t\t\tPluginSidebar,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: 'invp-plugin-sidebar',\r\n\t\t\t\t\t\ticon: 'admin-network',\r\n\t\t\t\t\t\ttitle: 'Inventory Presser'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tel(\r\n\t\t\t\t\t\t'div',\r\n\t\t\t\t\t\t{ className: 'invp-editor-sidebar' },\r\n\t\t\t\t\t\tfields\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n} )( window.wp );",
        "detailedLines": [
          {
            "lineNumber": 318,
            "text": "fields = "
          },
          {
            "lineNumber": 513
          },
          {
            "lineNumber": 518,
            "text": "\r"
          },
          {
            "lineNumber": 519,
            "text": "\t\t\t\t\t\t}\r"
          },
          {
            "lineNumber": 520,
            "text": "\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 521,
            "text": "\t\t\t\t);\r"
          },
          {
            "lineNumber": 522,
            "text": "\t\t\t\t// Is this a boat?\r"
          },
          {
            "lineNumber": 523,
            "text": "\t\t\t\tconst inventory_presser_type = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ).inventory_presser_type ?? '';\r"
          },
          {
            "lineNumber": 524,
            "text": "\t\t\t\tif ( 'boat' === inventory_presser_type.toLowerCase() ) {\r"
          },
          {
            "lineNumber": 525,
            "text": "\t\t\t\t\t// Yes, add the boat fields.\r"
          },
          {
            "lineNumber": 526,
            "text": "\t\t\t\t\tfields = el(\r"
          },
          {
            "lineNumber": 527,
            "text": "\t\t\t\t\t\twp.element.Fragment,\r"
          },
          {
            "lineNumber": 528,
            "text": "\t\t\t\t\t\t{},\r"
          },
          {
            "lineNumber": 529,
            "text": "\t\t\t\t\t\tfields,\r"
          },
          {
            "lineNumber": 530,
            "text": "\t\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 531,
            "text": "\t\t\t\t\t\t\twp.element.Fragment,\r"
          },
          {
            "lineNumber": 532,
            "text": "\t\t\t\t\t\t\t{},\r"
          },
          {
            "lineNumber": 533,
            "text": "\t\t\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 534,
            "text": "\t\t\t\t\t\t\t\t'h2',\r"
          },
          {
            "lineNumber": 535,
            "text": "\t\t\t\t\t\t\t\t{},\r"
          },
          {
            "lineNumber": 536,
            "text": "\t\t\t\t\t\t\t\t'Boat Attributes'\r"
          },
          {
            "lineNumber": 537,
            "text": "\t\t\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 538,
            "text": "\t\t\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 539,
            "text": "\t\t\t\t\t\t\t\tMetaBlockField,\r"
          },
          {
            "lineNumber": 540,
            "text": "\t\t\t\t\t\t\t\t{\r"
          },
          {
            "lineNumber": 541,
            "text": "\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'beam',\r"
          },
          {
            "lineNumber": 542,
            "text": "\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'beam',\r"
          },
          {
            "lineNumber": 543,
            "text": "\t\t\t\t\t\t\t\t\tisNumeric: true,\r"
          },
          {
            "lineNumber": 544,
            "text": "\t\t\t\t\t\t\t\t}\r"
          },
          {
            "lineNumber": 545,
            "text": "\t\t\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 546,
            "text": "\t\t\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 547,
            "text": "\t\t\t\t\t\t\t\tMetaBlockField,\r"
          },
          {
            "lineNumber": 548,
            "text": "\t\t\t\t\t\t\t\t{\r"
          },
          {
            "lineNumber": 549,
            "text": "\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'length',\r"
          },
          {
            "lineNumber": 550,
            "text": "\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'length',\r"
          },
          {
            "lineNumber": 551,
            "text": "\t\t\t\t\t\t\t\t\tisNumeric: true,\r"
          },
          {
            "lineNumber": 552,
            "text": "\t\t\t\t\t\t\t\t}\r"
          },
          {
            "lineNumber": 553,
            "text": "\t\t\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 554,
            "text": "\t\t\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 555,
            "text": "\t\t\t\t\t\t\t\tMetaBlockFieldSelect,\r"
          },
          {
            "lineNumber": 556,
            "text": "\t\t\t\t\t\t\t\t{\r"
          },
          {
            "lineNumber": 557,
            "text": "\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'hull_material',\r"
          },
          {
            "lineNumber": 558,
            "text": "\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'hull_material',\r"
          },
          {
            "lineNumber": 559,
            "text": "\t\t\t\t\t\t\t\t\tisNumeric: false,\r"
          },
          {
            "lineNumber": 560,
            "text": "\t\t\t\t\t\t\t\t\toptionArray: hullMaterialOptions(),\r"
          },
          {
            "lineNumber": 561,
            "text": "\t\t\t\t\t\t\t\t}\r"
          },
          {
            "lineNumber": 562,
            "text": "\t\t\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 563,
            "text": "\t\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 564,
            "text": "\t\t\t\t\t);\r"
          },
          {
            "lineNumber": 565,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 566,
            "text": "\r"
          },
          {
            "lineNumber": 567,
            "text": "\t\t\t\t// Allow add-ons to change the sidebar fields.\r"
          },
          {
            "lineNumber": 568,
            "text": "\t\t\t\tfields = wp.hooks.applyFilters( 'invp_editor_sidebar_elements', fields, inventory_presser_type );\r"
          },
          {
            "lineNumber": 569,
            "text": "\t\t\t\treturn el(\r"
          },
          {
            "lineNumber": 570,
            "text": "\t\t\t\t\tPluginSidebar,\r"
          },
          {
            "lineNumber": 571,
            "text": "\t\t\t\t\t{\r"
          },
          {
            "lineNumber": 572,
            "text": "\t\t\t\t\t\tname: 'invp-plugin-sidebar',\r"
          },
          {
            "lineNumber": 573,
            "text": "\t\t\t\t\t\ticon: 'admin-network',\r"
          },
          {
            "lineNumber": 574,
            "text": "\t\t\t\t\t\ttitle: 'Inventory Presser'\r"
          },
          {
            "lineNumber": 575,
            "text": "\t\t\t\t\t},\r"
          },
          {
            "lineNumber": 576,
            "text": "\t\t\t\t\tel(\r"
          },
          {
            "lineNumber": 577,
            "text": "\t\t\t\t\t\t'div',\r"
          },
          {
            "lineNumber": 578,
            "text": "\t\t\t\t\t\t{ className: 'invp-editor-sidebar' },\r"
          },
          {
            "lineNumber": 579,
            "text": "\t\t\t\t\t\tfields\r"
          },
          {
            "lineNumber": 580,
            "text": "\t\t\t\t\t),\r"
          },
          {
            "lineNumber": 581,
            "text": "\t\t\t\t);\r"
          },
          {
            "lineNumber": 582,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 583,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 584,
            "text": "\t);\r"
          },
          {
            "lineNumber": 585,
            "text": "} )( window.wp );"
          }
        ],
        "originalContents": "\r\n\t\t\t\tif ( 'boat' === inventory_presser_type.toLowerCase() ) {\r\n\t\t\t\t\t// Yes, add the boat fields.\r\n\t\t\t\t\tfields = el(\r\n\t\t\t\t\t\twp.element.Fragment,\r\n\t\t\t\t\t\t{},\r\n\t\t\t\t\t\tfields,\r\n\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\twp.element.Fragment,\r\n\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\t'h2',\r\n\t\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\t\t'Boat Attributes'\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockField,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'beam',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'beam',\r\n\t\t\t\t\t\t\t\t\tisNumeric: true,\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockField,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'length',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'length',\r\n\t\t\t\t\t\t\t\t\tisNumeric: true,\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tel(\r\n\t\t\t\t\t\t\t\tMetaBlockFieldSelect,\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfieldName: invp.meta_prefix + 'hull_material',\r\n\t\t\t\t\t\t\t\t\tid:        invp.meta_prefix + 'hull_material',\r\n\t\t\t\t\t\t\t\t\tisNumeric: false,\r\n\t\t\t\t\t\t\t\t\toptionArray: hullMaterialOptions(),\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Allow add-ons to change the sidebar fields.\r\n\t\t\t\tfields = wp.hooks.applyFilters( 'invp_editor_sidebar_elements', fields, inventory_presser_type );\r\n\t\t\t\treturn el(\r\n\t\t\t\t\tPluginSidebar,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: 'invp-plugin-sidebar',\r\n\t\t\t\t\t\ticon: 'admin-network',\r\n\t\t\t\t\t\ttitle: 'Inventory Presser'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tel(\r\n\t\t\t\t\t\t'div',\r\n\t\t\t\t\t\t{ className: 'invp-editor-sidebar' },\r\n\t\t\t\t\t\tfields\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n} )( window.wp );",
        "range": {
          "endPosition": {
            "column": 17,
            "line": 584
          },
          "startPosition": {
            "line": 56
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js"
      },
      "score": 0.3427932858467102
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t/**\r\n\t\t * Provides default values for the plugin settings stored in an option\r\n\t\t * with name INVP::OPTION_NAME.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function set_default_settings() {\r\n\t\t\t$settings = INVP::settings();\r\n\t\t\t// Do not overwrite taxonomies setting if it exists.\r\n\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r\n\t\t\t$show_menu = false;\r\n\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r\n\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r\n\t\t\t\tunset( $settings['show_all_taxonomies'] );\r\n\t\t\t}\r\n\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r\n\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r\n\t\t\t}\r\n\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * This is the driver function of the entire plugin. Includes dependencies\r\n\t\t * and adds all hooks.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function add_hooks() {\r\n\t\t\t// Only do these things once.\r\n\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// include all this plugin's classes that live in external files.\r\n\t\t\t$this-\u003einclude_dependencies();\r\n\r\n\t\t\t// Ensure addon updaters are initialized in multisite.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r\n\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r\n\t\t\t}\r\n\r\n\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r\n\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r\n\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r\n\r\n\t\t\t// Provide a path to .mo files in /languages.\r\n\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Create our post type and taxonomies\r\n\t\t\t */\r\n\r\n\t\t\t// create a custom post type for the vehicles.\r\n\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r\n",
        "detailedLines": [
          {
            "lineNumber": 590,
            "text": "$pieces = explode( ' ', rtrim( $str ) );\r"
          },
          {
            "lineNumber": 591,
            "text": "\t\t\treturn array_pop( $pieces );\r"
          },
          {
            "lineNumber": 592,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 593,
            "text": "\r"
          },
          {
            "lineNumber": 594,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 595,
            "text": "\t\t * Provides default values for the plugin settings stored in an option\r"
          },
          {
            "lineNumber": 596,
            "text": "\t\t * with name INVP::OPTION_NAME.\r"
          },
          {
            "lineNumber": 597,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 598,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 599,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 600,
            "text": "\t\tpublic static function set_default_settings() {\r"
          },
          {
            "lineNumber": 601,
            "text": "\t\t\t$settings = INVP::settings();\r"
          },
          {
            "lineNumber": 602,
            "text": "\t\t\t// Do not overwrite taxonomies setting if it exists.\r"
          },
          {
            "lineNumber": 603,
            "text": "\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 604,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 605,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 606,
            "text": "\r"
          },
          {
            "lineNumber": 607,
            "text": "\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r"
          },
          {
            "lineNumber": 608,
            "text": "\t\t\t$show_menu = false;\r"
          },
          {
            "lineNumber": 609,
            "text": "\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 610,
            "text": "\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r"
          },
          {
            "lineNumber": 611,
            "text": "\t\t\t\tunset( $settings['show_all_taxonomies'] );\r"
          },
          {
            "lineNumber": 612,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 613,
            "text": "\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 614,
            "text": "\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r"
          },
          {
            "lineNumber": 615,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 616,
            "text": "\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r"
          },
          {
            "lineNumber": 617,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 618,
            "text": "\r"
          },
          {
            "lineNumber": 619,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 620,
            "text": "\t\t * This is the driver function of the entire plugin. Includes dependencies\r"
          },
          {
            "lineNumber": 621,
            "text": "\t\t * and adds all hooks.\r"
          },
          {
            "lineNumber": 622,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 623,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 624,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 625,
            "text": "\t\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 626,
            "text": "\t\t\t// Only do these things once.\r"
          },
          {
            "lineNumber": 627,
            "text": "\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r"
          },
          {
            "lineNumber": 628,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 629,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 630,
            "text": "\r"
          },
          {
            "lineNumber": 631,
            "text": "\t\t\t// include all this plugin's classes that live in external files.\r"
          },
          {
            "lineNumber": 632,
            "text": "\t\t\t$this-\u003einclude_dependencies();\r"
          },
          {
            "lineNumber": 633,
            "text": "\r"
          },
          {
            "lineNumber": 634,
            "text": "\t\t\t// Ensure addon updaters are initialized in multisite.\r"
          },
          {
            "lineNumber": 635,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r"
          },
          {
            "lineNumber": 636,
            "text": "\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r"
          },
          {
            "lineNumber": 637,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 638,
            "text": "\r"
          },
          {
            "lineNumber": 639,
            "text": "\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r"
          },
          {
            "lineNumber": 640,
            "text": "\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r"
          },
          {
            "lineNumber": 641,
            "text": "\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r"
          },
          {
            "lineNumber": 642,
            "text": "\r"
          },
          {
            "lineNumber": 643,
            "text": "\t\t\t// Provide a path to .mo files in /languages.\r"
          },
          {
            "lineNumber": 644,
            "text": "\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r"
          },
          {
            "lineNumber": 645,
            "text": "\r"
          },
          {
            "lineNumber": 646,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 647,
            "text": "\t\t\t * Create our post type and taxonomies\r"
          },
          {
            "lineNumber": 648,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 649,
            "text": "\r"
          },
          {
            "lineNumber": 650,
            "text": "\t\t\t// create a custom post type for the vehicles.\r"
          },
          {
            "lineNumber": 651,
            "text": "\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r"
          },
          {
            "lineNumber": 652,
            "text": "\r"
          },
          {
            "lineNumber": 653,
            "text": "\t\t\t// Give all administrator users full capabilities over the custom post type.\r"
          }
        ],
        "originalContents": "\r\n\t\t/**\r\n\t\t * Provides default values for the plugin settings stored in an option\r\n\t\t * with name INVP::OPTION_NAME.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function set_default_settings() {\r\n\t\t\t$settings = INVP::settings();\r\n\t\t\t// Do not overwrite taxonomies setting if it exists.\r\n\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r\n\t\t\t$show_menu = false;\r\n\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r\n\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r\n\t\t\t\tunset( $settings['show_all_taxonomies'] );\r\n\t\t\t}\r\n\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r\n\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r\n\t\t\t}\r\n\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * This is the driver function of the entire plugin. Includes dependencies\r\n\t\t * and adds all hooks.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function add_hooks() {\r\n\t\t\t// Only do these things once.\r\n\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// include all this plugin's classes that live in external files.\r\n\t\t\t$this-\u003einclude_dependencies();\r\n\r\n\t\t\t// Ensure addon updaters are initialized in multisite.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r\n\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r\n\t\t\t}\r\n\r\n\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r\n\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r\n\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r\n\r\n\t\t\t// Provide a path to .mo files in /languages.\r\n\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Create our post type and taxonomies\r\n\t\t\t */\r\n\r\n\t\t\t// create a custom post type for the vehicles.\r\n\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r\n",
        "range": {
          "endPosition": {
            "line": 653
          },
          "startPosition": {
            "column": 3,
            "line": 589
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.32979893684387207
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t// The post does not have a Description block. Add one.\r\n\t\t$blocks[]           = array(\r\n\t\t\t'blockName'    =\u003e 'inventory-presser/description',\r\n\t\t\t'attrs'        =\u003e array(),\r\n\t\t\t'innerBlocks'  =\u003e array(),\r\n\t\t\t'innerHTML'    =\u003e '',\r\n\t\t\t'innerContent' =\u003e array(),\r\n\t\t);\r\n\t\t$post-\u003epost_content = serialize_blocks( $blocks );\r\n\t\twp_update_post( $post );\r\n\t}\r\n\r\n\t/**\r\n\t * Enqueues block editor assets\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function enqueue_block_editor_assets() {\r\n\t\tif ( is_admin() ) {\r\n\t\t\twp_enqueue_script( 'invp-blocks' );\r\n\t\t\twp_enqueue_style( 'invp-block-editor' );\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Registers block types\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function register_block_types() {\r\n\t\tif ( ! function_exists( 'register_block_type' ) ) {\r\n\t\t\t// running on WordPress \u003c 5.0.0, no blocks for you.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$block_types = array(\r\n\t\t\t'year-make-model-and-trim',\r\n\t\t\t'beam', // For boats.\r\n\t\t\t'body-style',\r\n\t\t\t'color',\r\n\t\t\t'description',\r\n\t\t\t'down-payment',\r\n\t\t\t'engine',\r\n\t\t\t'interior-color',\r\n\t\t\t'last-modified',\r\n\t\t\t'length', // For trailers \u0026 boats.\r\n\t\t\t'make',\r\n\t\t\t'model',\r\n\t\t\t'msrp',\r\n\t\t\t'odometer',\r\n\t\t\t'payment',\r\n\t\t\t'price',\r\n\t\t\t'stock-number',\r\n\t\t\t'title-status',\r\n\t\t\t'transmission-speeds',\r\n\t\t\t'trim',\r\n\t\t\t'vin',\r\n\t\t\t'year',\r\n\t\t\t'youtube',\r\n\t\t);\r\n\t\tforeach ( $block_types as $block_type ) {\r\n\t\t\tregister_block_type( dirname( INVP_PLUGIN_FILE_PATH ) . '/build/blocks/' . $block_type . '/block.json' );\r\n\t\t}\r\n\t}\r\n}\r\n",
        "detailedLines": [
          {
            "lineNumber": 69,
            "text": "// Yes. The post already has a Description block.\r"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 72,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 73,
            "text": "\r"
          },
          {
            "lineNumber": 74,
            "text": "\t\t// The post does not have a Description block. Add one.\r"
          },
          {
            "lineNumber": 75,
            "text": "\t\t$blocks[]           = array(\r"
          },
          {
            "lineNumber": 76,
            "text": "\t\t\t'blockName'    =\u003e 'inventory-presser/description',\r"
          },
          {
            "lineNumber": 77,
            "text": "\t\t\t'attrs'        =\u003e array(),\r"
          },
          {
            "lineNumber": 78,
            "text": "\t\t\t'innerBlocks'  =\u003e array(),\r"
          },
          {
            "lineNumber": 79,
            "text": "\t\t\t'innerHTML'    =\u003e '',\r"
          },
          {
            "lineNumber": 80,
            "text": "\t\t\t'innerContent' =\u003e array(),\r"
          },
          {
            "lineNumber": 81,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 82,
            "text": "\t\t$post-\u003epost_content = serialize_blocks( $blocks );\r"
          },
          {
            "lineNumber": 83,
            "text": "\t\twp_update_post( $post );\r"
          },
          {
            "lineNumber": 84,
            "text": "\t}\r"
          },
          {
            "lineNumber": 85,
            "text": "\r"
          },
          {
            "lineNumber": 86,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 87,
            "text": "\t * Enqueues block editor assets\r"
          },
          {
            "lineNumber": 88,
            "text": "\t *\r"
          },
          {
            "lineNumber": 89,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 90,
            "text": "\t */\r"
          },
          {
            "lineNumber": 91,
            "text": "\tpublic function enqueue_block_editor_assets() {\r"
          },
          {
            "lineNumber": 92,
            "text": "\t\tif ( is_admin() ) {\r"
          },
          {
            "lineNumber": 93,
            "text": "\t\t\twp_enqueue_script( 'invp-blocks' );\r"
          },
          {
            "lineNumber": 94,
            "text": "\t\t\twp_enqueue_style( 'invp-block-editor' );\r"
          },
          {
            "lineNumber": 95,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 96,
            "text": "\t}\r"
          },
          {
            "lineNumber": 97,
            "text": "\r"
          },
          {
            "lineNumber": 98,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 99,
            "text": "\t * Registers block types\r"
          },
          {
            "lineNumber": 100,
            "text": "\t *\r"
          },
          {
            "lineNumber": 101,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 102,
            "text": "\t */\r"
          },
          {
            "lineNumber": 103,
            "text": "\tpublic function register_block_types() {\r"
          },
          {
            "lineNumber": 104,
            "text": "\t\tif ( ! function_exists( 'register_block_type' ) ) {\r"
          },
          {
            "lineNumber": 105,
            "text": "\t\t\t// running on WordPress \u003c 5.0.0, no blocks for you.\r"
          },
          {
            "lineNumber": 106,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 107,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 108,
            "text": "\r"
          },
          {
            "lineNumber": 109,
            "text": "\t\t$block_types = array(\r"
          },
          {
            "lineNumber": 110,
            "text": "\t\t\t'year-make-model-and-trim',\r"
          },
          {
            "lineNumber": 111,
            "text": "\t\t\t'beam', // For boats.\r"
          },
          {
            "lineNumber": 112,
            "text": "\t\t\t'body-style',\r"
          },
          {
            "lineNumber": 113,
            "text": "\t\t\t'color',\r"
          },
          {
            "lineNumber": 114,
            "text": "\t\t\t'description',\r"
          },
          {
            "lineNumber": 115,
            "text": "\t\t\t'down-payment',\r"
          },
          {
            "lineNumber": 116,
            "text": "\t\t\t'engine',\r"
          },
          {
            "lineNumber": 117,
            "text": "\t\t\t'interior-color',\r"
          },
          {
            "lineNumber": 118,
            "text": "\t\t\t'last-modified',\r"
          },
          {
            "lineNumber": 119,
            "text": "\t\t\t'length', // For trailers \u0026 boats.\r"
          },
          {
            "lineNumber": 120,
            "text": "\t\t\t'make',\r"
          },
          {
            "lineNumber": 121,
            "text": "\t\t\t'model',\r"
          },
          {
            "lineNumber": 122,
            "text": "\t\t\t'msrp',\r"
          },
          {
            "lineNumber": 123,
            "text": "\t\t\t'odometer',\r"
          },
          {
            "lineNumber": 124,
            "text": "\t\t\t'payment',\r"
          },
          {
            "lineNumber": 125,
            "text": "\t\t\t'price',\r"
          },
          {
            "lineNumber": 126,
            "text": "\t\t\t'stock-number',\r"
          },
          {
            "lineNumber": 127,
            "text": "\t\t\t'title-status',\r"
          },
          {
            "lineNumber": 128,
            "text": "\t\t\t'transmission-speeds',\r"
          },
          {
            "lineNumber": 129,
            "text": "\t\t\t'trim',\r"
          },
          {
            "lineNumber": 130,
            "text": "\t\t\t'vin',\r"
          },
          {
            "lineNumber": 131,
            "text": "\t\t\t'year',\r"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t'youtube',\r"
          },
          {
            "lineNumber": 133,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 134,
            "text": "\t\tforeach ( $block_types as $block_type ) {\r"
          },
          {
            "lineNumber": 135,
            "text": "\t\t\tregister_block_type( dirname( INVP_PLUGIN_FILE_PATH ) . '/build/blocks/' . $block_type . '/block.json' );\r"
          },
          {
            "lineNumber": 136,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 137,
            "text": "\t}\r"
          },
          {
            "lineNumber": 138,
            "text": "}\r"
          }
        ],
        "originalContents": "\r\n\t\t// The post does not have a Description block. Add one.\r\n\t\t$blocks[]           = array(\r\n\t\t\t'blockName'    =\u003e 'inventory-presser/description',\r\n\t\t\t'attrs'        =\u003e array(),\r\n\t\t\t'innerBlocks'  =\u003e array(),\r\n\t\t\t'innerHTML'    =\u003e '',\r\n\t\t\t'innerContent' =\u003e array(),\r\n\t\t);\r\n\t\t$post-\u003epost_content = serialize_blocks( $blocks );\r\n\t\twp_update_post( $post );\r\n\t}\r\n\r\n\t/**\r\n\t * Enqueues block editor assets\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function enqueue_block_editor_assets() {\r\n\t\tif ( is_admin() ) {\r\n\t\t\twp_enqueue_script( 'invp-blocks' );\r\n\t\t\twp_enqueue_style( 'invp-block-editor' );\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Registers block types\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function register_block_types() {\r\n\t\tif ( ! function_exists( 'register_block_type' ) ) {\r\n\t\t\t// running on WordPress \u003c 5.0.0, no blocks for you.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$block_types = array(\r\n\t\t\t'year-make-model-and-trim',\r\n\t\t\t'beam', // For boats.\r\n\t\t\t'body-style',\r\n\t\t\t'color',\r\n\t\t\t'description',\r\n\t\t\t'down-payment',\r\n\t\t\t'engine',\r\n\t\t\t'interior-color',\r\n\t\t\t'last-modified',\r\n\t\t\t'length', // For trailers \u0026 boats.\r\n\t\t\t'make',\r\n\t\t\t'model',\r\n\t\t\t'msrp',\r\n\t\t\t'odometer',\r\n\t\t\t'payment',\r\n\t\t\t'price',\r\n\t\t\t'stock-number',\r\n\t\t\t'title-status',\r\n\t\t\t'transmission-speeds',\r\n\t\t\t'trim',\r\n\t\t\t'vin',\r\n\t\t\t'year',\r\n\t\t\t'youtube',\r\n\t\t);\r\n\t\tforeach ( $block_types as $block_type ) {\r\n\t\t\tregister_block_type( dirname( INVP_PLUGIN_FILE_PATH ) . '/build/blocks/' . $block_type . '/block.json' );\r\n\t\t}\r\n\t}\r\n}\r\n",
        "range": {
          "endPosition": {
            "line": 138
          },
          "startPosition": {
            "column": 4,
            "line": 68
          }
        },
        "relativeWorkspacePath": "includes/class-blocks.php"
      },
      "score": 0.32354456186294556
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t// Give all administrator users full capabilities over the custom post type.\r\n\t\t\tadd_action( 'admin_init', array( $this, 'add_admin_capabilities' ) );\r\n\r\n\t\t\t// register all postmeta fields the CPT uses.\r\n\t\t\tadd_action( 'init', array( $this, 'register_meta_fields' ), 20 );\r\n\r\n\t\t\t// Filter the attachment post type to make sure &#96;parent&#96; is exposed in the REST API.\r\n\t\t\tadd_filter( 'register_post_type_args', array( $this, 'edit_attachment_post_type' ), 10, 2 );\r\n\r\n\t\t\t/**\r\n\t\t\t * Make sure our own classes exist before creating instances in case\r\n\t\t\t * a page load happens during a plugin update when some of these\r\n\t\t\t * files might actually not exist.\r\n\t\t\t */\r\n\r\n\t\t\t// Create custom taxonomies.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomies' ) ) {\r\n\t\t\t\t$taxonomies = new Inventory_Presser_Taxonomies();\r\n\t\t\t\t$taxonomies-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Modify edit-tags.php for our location taxonomy to manage term meta.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {\r\n\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();\r\n\t\t\t\t$location_meta-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Some custom rewrite rules are created and destroyed\r\n\t\t\t */\r\n\r\n\t\t\t// Add custom rewrite rules.\r\n\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are\r\n\t\t\t * flushed to add and remove our custom rewrite rules\r\n\t\t\t */\r\n\r\n\t\t\t// Flush rewrite rules when the plugin is activated.\r\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );\r\n\r\n\t\t\t// Set default settings values.\r\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );\r\n\r\n\t\t\t// Delete an option during deactivation.\r\n\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );\r\n",
        "detailedLines": [
          {
            "lineNumber": 651,
            "text": "\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r"
          },
          {
            "lineNumber": 652,
            "text": "\r"
          },
          {
            "lineNumber": 653,
            "text": "\t\t\t// Give all administrator users full capabilities over the custom post type.\r"
          },
          {
            "lineNumber": 654,
            "text": "\t\t\tadd_action( 'admin_init', array( $this, 'add_admin_capabilities' ) );\r"
          },
          {
            "lineNumber": 655,
            "text": "\r"
          },
          {
            "lineNumber": 656,
            "text": "\t\t\t// register all postmeta fields the CPT uses.\r"
          },
          {
            "lineNumber": 657,
            "text": "\t\t\tadd_action( 'init', array( $this, 'register_meta_fields' ), 20 );\r"
          },
          {
            "lineNumber": 658,
            "text": "\r"
          },
          {
            "lineNumber": 659,
            "text": "\t\t\t// Filter the attachment post type to make sure &#96;parent&#96; is exposed in the REST API.\r"
          },
          {
            "lineNumber": 660,
            "text": "\t\t\tadd_filter( 'register_post_type_args', array( $this, 'edit_attachment_post_type' ), 10, 2 );\r"
          },
          {
            "lineNumber": 661,
            "text": "\r"
          },
          {
            "lineNumber": 662,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 663,
            "text": "\t\t\t * Make sure our own classes exist before creating instances in case\r"
          },
          {
            "lineNumber": 664,
            "text": "\t\t\t * a page load happens during a plugin update when some of these\r"
          },
          {
            "lineNumber": 665,
            "text": "\t\t\t * files might actually not exist.\r"
          },
          {
            "lineNumber": 666,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 667,
            "text": "\r"
          },
          {
            "lineNumber": 668,
            "text": "\t\t\t// Create custom taxonomies.\r"
          },
          {
            "lineNumber": 669,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomies' ) ) {\r"
          },
          {
            "lineNumber": 670,
            "text": "\t\t\t\t$taxonomies = new Inventory_Presser_Taxonomies();\r"
          },
          {
            "lineNumber": 671,
            "text": "\t\t\t\t$taxonomies-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 672,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 673,
            "text": "\r"
          },
          {
            "lineNumber": 674,
            "text": "\t\t\t// Modify edit-tags.php for our location taxonomy to manage term meta.\r"
          },
          {
            "lineNumber": 675,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {\r"
          },
          {
            "lineNumber": 676,
            "text": "\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();\r"
          },
          {
            "lineNumber": 677,
            "text": "\t\t\t\t$location_meta-\u003eadd_hooks();\r"
          },
          {
            "lineNumber": 678,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 679,
            "text": "\r"
          },
          {
            "lineNumber": 680,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 681,
            "text": "\t\t\t * Some custom rewrite rules are created and destroyed\r"
          },
          {
            "lineNumber": 682,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 683,
            "text": "\r"
          },
          {
            "lineNumber": 684,
            "text": "\t\t\t// Add custom rewrite rules.\r"
          },
          {
            "lineNumber": 685,
            "text": "\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );\r"
          },
          {
            "lineNumber": 686,
            "text": "\r"
          },
          {
            "lineNumber": 687,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 688,
            "text": "\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are\r"
          },
          {
            "lineNumber": 689,
            "text": "\t\t\t * flushed to add and remove our custom rewrite rules\r"
          },
          {
            "lineNumber": 690,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 691,
            "text": "\r"
          },
          {
            "lineNumber": 692,
            "text": "\t\t\t// Flush rewrite rules when the plugin is activated.\r"
          },
          {
            "lineNumber": 693,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );\r"
          },
          {
            "lineNumber": 694,
            "text": "\r"
          },
          {
            "lineNumber": 695,
            "text": "\t\t\t// Set default settings values.\r"
          },
          {
            "lineNumber": 696,
            "text": "\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );\r"
          },
          {
            "lineNumber": 697,
            "text": "\r"
          },
          {
            "lineNumber": 698,
            "text": "\t\t\t// Delete an option during deactivation.\r"
          },
          {
            "lineNumber": 699,
            "text": "\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );\r"
          },
          {
            "lineNumber": 700,
            "text": "\r"
          },
          {
            "lineNumber": 701,
            "text": "\t\t\t// Register some widgets included with this plugin.\r"
          }
        ],
        "originalContents": "\r\n\t\t\t// Give all administrator users full capabilities over the custom post type.\r\n\t\t\tadd_action( 'admin_init', array( $this, 'add_admin_capabilities' ) );\r\n\r\n\t\t\t// register all postmeta fields the CPT uses.\r\n\t\t\tadd_action( 'init', array( $this, 'register_meta_fields' ), 20 );\r\n\r\n\t\t\t// Filter the attachment post type to make sure &#96;parent&#96; is exposed in the REST API.\r\n\t\t\tadd_filter( 'register_post_type_args', array( $this, 'edit_attachment_post_type' ), 10, 2 );\r\n\r\n\t\t\t/**\r\n\t\t\t * Make sure our own classes exist before creating instances in case\r\n\t\t\t * a page load happens during a plugin update when some of these\r\n\t\t\t * files might actually not exist.\r\n\t\t\t */\r\n\r\n\t\t\t// Create custom taxonomies.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Taxonomies' ) ) {\r\n\t\t\t\t$taxonomies = new Inventory_Presser_Taxonomies();\r\n\t\t\t\t$taxonomies-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t// Modify edit-tags.php for our location taxonomy to manage term meta.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Admin_Location_Meta' ) ) {\r\n\t\t\t\t$location_meta = new Inventory_Presser_Admin_Location_Meta();\r\n\t\t\t\t$location_meta-\u003eadd_hooks();\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Some custom rewrite rules are created and destroyed\r\n\t\t\t */\r\n\r\n\t\t\t// Add custom rewrite rules.\r\n\t\t\tadd_action( 'generate_rewrite_rules', array( $this, 'add_pretty_search_urls' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Activation and deactivation hooks ensure that the rewrite rules are\r\n\t\t\t * flushed to add and remove our custom rewrite rules\r\n\t\t\t */\r\n\r\n\t\t\t// Flush rewrite rules when the plugin is activated.\r\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'flush_rewrite' ) );\r\n\r\n\t\t\t// Set default settings values.\r\n\t\t\tregister_activation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'set_default_settings' ) );\r\n\r\n\t\t\t// Delete an option during deactivation.\r\n\t\t\tregister_deactivation_hook( INVP_PLUGIN_FILE_PATH, array( __CLASS__, 'delete_rewrite_rules_option' ) );\r\n",
        "range": {
          "endPosition": {
            "line": 701
          },
          "startPosition": {
            "line": 650
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.3233259916305542
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to embed a Google map pointed at one of\r\n\t\t\t * the addresses in our location taxonomy.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r\n\r\n\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r\n\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Sanitizes every member of an array at every level with\r\n\t\t * sanitize_text_field()\r\n\t\t *\r\n\t\t * @param  array $arr\r\n\t\t * @return array\r\n\t\t */\r\n\t\tprotected function sanitize_array( $arr ) {\r\n\t\t\tforeach ( $arr as $key =\u003e $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Saves vehicle attributes into their corresponding post meta fields when\r\n\t\t * the Save or Update button is clicked in the editor.\r\n\t\t *\r\n\t\t * @param  int     $post_id\r\n\t\t * @param  WP_Post $post\r\n\t\t * @param  bool    $is_update\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r\n\t\t\t/**\r\n\t\t\t * Do not continue if the post is being moved to the trash or if this is\r\n\t\t\t * an auto-draft.\r\n\t\t\t */\r\n\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Abort if autosave or AJAX/quick edit.\r\n\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r\n\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r\n\t\t\t) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1769,
            "text": "register_widget( 'Inventory_Presser_Fuel_Economy_Widget' );\r"
          },
          {
            "lineNumber": 1770,
            "text": "\r"
          },
          {
            "lineNumber": 1771,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1772,
            "text": "\t\t\t * Make a widget available to embed a Google map pointed at one of\r"
          },
          {
            "lineNumber": 1773,
            "text": "\t\t\t * the addresses in our location taxonomy.\r"
          },
          {
            "lineNumber": 1774,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1775,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r"
          },
          {
            "lineNumber": 1776,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r"
          },
          {
            "lineNumber": 1777,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r"
          },
          {
            "lineNumber": 1778,
            "text": "\r"
          },
          {
            "lineNumber": 1779,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r"
          },
          {
            "lineNumber": 1780,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r"
          },
          {
            "lineNumber": 1781,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r"
          },
          {
            "lineNumber": 1782,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r"
          },
          {
            "lineNumber": 1783,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r"
          },
          {
            "lineNumber": 1784,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r"
          },
          {
            "lineNumber": 1785,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r"
          },
          {
            "lineNumber": 1786,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r"
          },
          {
            "lineNumber": 1787,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1788,
            "text": "\r"
          },
          {
            "lineNumber": 1789,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1790,
            "text": "\t\t * Sanitizes every member of an array at every level with\r"
          },
          {
            "lineNumber": 1791,
            "text": "\t\t * sanitize_text_field()\r"
          },
          {
            "lineNumber": 1792,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1793,
            "text": "\t\t * @param  array $arr\r"
          },
          {
            "lineNumber": 1794,
            "text": "\t\t * @return array\r"
          },
          {
            "lineNumber": 1795,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1796,
            "text": "\t\tprotected function sanitize_array( $arr ) {\r"
          },
          {
            "lineNumber": 1797,
            "text": "\t\t\tforeach ( $arr as $key =\u003e $value ) {\r"
          },
          {
            "lineNumber": 1798,
            "text": "\t\t\t\tif ( is_array( $value ) ) {\r"
          },
          {
            "lineNumber": 1799,
            "text": "\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r"
          },
          {
            "lineNumber": 1800,
            "text": "\t\t\t\t} else {\r"
          },
          {
            "lineNumber": 1801,
            "text": "\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r"
          },
          {
            "lineNumber": 1802,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 1803,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1804,
            "text": "\t\t\treturn $arr;\r"
          },
          {
            "lineNumber": 1805,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1806,
            "text": "\r"
          },
          {
            "lineNumber": 1807,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1808,
            "text": "\t\t * Saves vehicle attributes into their corresponding post meta fields when\r"
          },
          {
            "lineNumber": 1809,
            "text": "\t\t * the Save or Update button is clicked in the editor.\r"
          },
          {
            "lineNumber": 1810,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1811,
            "text": "\t\t * @param  int     $post_id\r"
          },
          {
            "lineNumber": 1812,
            "text": "\t\t * @param  WP_Post $post\r"
          },
          {
            "lineNumber": 1813,
            "text": "\t\t * @param  bool    $is_update\r"
          },
          {
            "lineNumber": 1814,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 1815,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1816,
            "text": "\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r"
          },
          {
            "lineNumber": 1817,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1818,
            "text": "\t\t\t * Do not continue if the post is being moved to the trash or if this is\r"
          },
          {
            "lineNumber": 1819,
            "text": "\t\t\t * an auto-draft.\r"
          },
          {
            "lineNumber": 1820,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1821,
            "text": "\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r"
          },
          {
            "lineNumber": 1822,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1823,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1824,
            "text": "\r"
          },
          {
            "lineNumber": 1825,
            "text": "\t\t\t// Abort if autosave or AJAX/quick edit.\r"
          },
          {
            "lineNumber": 1826,
            "text": "\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r"
          },
          {
            "lineNumber": 1827,
            "text": "\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r"
          },
          {
            "lineNumber": 1828,
            "text": "\t\t\t) {\r"
          },
          {
            "lineNumber": 1829,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1830,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1831,
            "text": "\r"
          },
          {
            "lineNumber": 1832,
            "text": "\t\t\t// is this a vehicle?\r"
          },
          {
            "lineNumber": 1833,
            "text": "\t\t\tif ( ! empty( $_POST['post_type'] ) \u0026\u0026 INVP::POST_TYPE !== $_POST['post_type'] ) {\r"
          },
          {
            "lineNumber": 1834,
            "text": "\t\t\t\t"
          }
        ],
        "originalContents": "\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to embed a Google map pointed at one of\r\n\t\t\t * the addresses in our location taxonomy.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r\n\r\n\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r\n\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Sanitizes every member of an array at every level with\r\n\t\t * sanitize_text_field()\r\n\t\t *\r\n\t\t * @param  array $arr\r\n\t\t * @return array\r\n\t\t */\r\n\t\tprotected function sanitize_array( $arr ) {\r\n\t\t\tforeach ( $arr as $key =\u003e $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Saves vehicle attributes into their corresponding post meta fields when\r\n\t\t * the Save or Update button is clicked in the editor.\r\n\t\t *\r\n\t\t * @param  int     $post_id\r\n\t\t * @param  WP_Post $post\r\n\t\t * @param  bool    $is_update\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r\n\t\t\t/**\r\n\t\t\t * Do not continue if the post is being moved to the trash or if this is\r\n\t\t\t * an auto-draft.\r\n\t\t\t */\r\n\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Abort if autosave or AJAX/quick edit.\r\n\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r\n\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r\n\t\t\t) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "column": 4,
            "line": 1833
          },
          "startPosition": {
            "column": 3,
            "line": 1768
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.31612429022789
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Taxonomies\r\n *\r\n * Registers and manipulates our custom taxonomies and their terms.\r\n *\r\n * @since      1.3.1\r\n * @package inventory-presser\r\n * @subpackage inventory-presser/includes\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e, John Norton \u003cnorton@fridaynet.com\u003e\r\n */\r\nclass Inventory_Presser_Taxonomies {\r\n\r\n\tconst CRON_HOOK_DELETE_TERMS = 'inventory_presser_delete_unused_terms';\r\n\r\n\t/**\r\n\t * Users can show and hide the taxonomies in the dashboard menu.\r\n\t *\r\n\t * @param  array $taxonomy_data\r\n\t * @return array\r\n\t */\r\n\tpublic function change_taxonomy_show_in_menu_attribute( $taxonomy_data ) {\r\n\t\t$settings = INVP::settings();\r\n\t\tif ( empty( $settings['taxonomies'] ) ) {\r\n\t\t\treturn $taxonomy_data;\r\n\t\t}\r\n\t\t$count = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\t// Should this taxonomy be shown in the dashboard menu under Vehicles?\r\n\t\t\t$taxonomy_data[ $i ]['args']['show_in_menu'] = $settings['taxonomies'][ $taxonomy_data[ $i ]['args']['query_var'] ]['admin_menu'] ?? false;\r\n\t\t}\r\n\t\treturn $taxonomy_data;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all terms in all our taxonomies. Used when uninstalling the\r\n\t * plugin.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function delete_term_data() {\r\n\t\t// remove the terms in taxonomies.\r\n\t\t$taxonomy_data = self::taxonomy_data();\r\n\t\t$count         = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\t$tax   = $taxonomy_data[ $i ]['args']['label'];\r\n\t\t\t$terms = get_terms(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'taxonomy'   =\u003e $tax,\r\n\t\t\t\t\t'fields'     =\u003e 'ids',\r\n\t\t\t\t\t'hide_empty' =\u003e false,\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tforeach ( $terms as $value ) {\r\n\t\t\t\twp_delete_term( $value, $tax );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 3,
            "text": "\r"
          },
          {
            "lineNumber": 4,
            "text": "/**\r"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Taxonomies\r"
          },
          {
            "lineNumber": 6,
            "text": " *\r"
          },
          {
            "lineNumber": 7,
            "text": " * Registers and manipulates our custom taxonomies and their terms.\r"
          },
          {
            "lineNumber": 8,
            "text": " *\r"
          },
          {
            "lineNumber": 9,
            "text": " * @since      1.3.1\r"
          },
          {
            "lineNumber": 10,
            "text": " * @package inventory-presser\r"
          },
          {
            "lineNumber": 11,
            "text": " * @subpackage inventory-presser/includes\r"
          },
          {
            "lineNumber": 12,
            "text": " * @author     Corey Salzano \u003ccorey@friday.systems\u003e, John Norton \u003cnorton@fridaynet.com\u003e\r"
          },
          {
            "lineNumber": 13,
            "text": " */\r"
          },
          {
            "lineNumber": 14,
            "text": "class Inventory_Presser_Taxonomies {\r"
          },
          {
            "lineNumber": 15,
            "text": "\r"
          },
          {
            "lineNumber": 16,
            "text": "\tconst CRON_HOOK_DELETE_TERMS = 'inventory_presser_delete_unused_terms';\r"
          },
          {
            "lineNumber": 17,
            "text": "\r"
          },
          {
            "lineNumber": 18,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 19,
            "text": "\t * Users can show and hide the taxonomies in the dashboard menu.\r"
          },
          {
            "lineNumber": 20,
            "text": "\t *\r"
          },
          {
            "lineNumber": 21,
            "text": "\t * @param  array $taxonomy_data\r"
          },
          {
            "lineNumber": 22,
            "text": "\t * @return array\r"
          },
          {
            "lineNumber": 23,
            "text": "\t */\r"
          },
          {
            "lineNumber": 24,
            "text": "\tpublic function change_taxonomy_show_in_menu_attribute( $taxonomy_data ) {\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t$settings = INVP::settings();\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\tif ( empty( $settings['taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\treturn $taxonomy_data;\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t$count = count( $taxonomy_data );\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\t// Should this taxonomy be shown in the dashboard menu under Vehicles?\r"
          },
          {
            "lineNumber": 32,
            "text": "\t\t\t$taxonomy_data[ $i ]['args']['show_in_menu'] = $settings['taxonomies'][ $taxonomy_data[ $i ]['args']['query_var'] ]['admin_menu'] ?? false;\r"
          },
          {
            "lineNumber": 33,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 34,
            "text": "\t\treturn $taxonomy_data;\r"
          },
          {
            "lineNumber": 35,
            "text": "\t}\r"
          },
          {
            "lineNumber": 36,
            "text": "\r"
          },
          {
            "lineNumber": 37,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 38,
            "text": "\t * Removes all terms in all our taxonomies. Used when uninstalling the\r"
          },
          {
            "lineNumber": 39,
            "text": "\t * plugin.\r"
          },
          {
            "lineNumber": 40,
            "text": "\t *\r"
          },
          {
            "lineNumber": 41,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 42,
            "text": "\t */\r"
          },
          {
            "lineNumber": 43,
            "text": "\tpublic function delete_term_data() {\r"
          },
          {
            "lineNumber": 44,
            "text": "\t\t// remove the terms in taxonomies.\r"
          },
          {
            "lineNumber": 45,
            "text": "\t\t$taxonomy_data = self::taxonomy_data();\r"
          },
          {
            "lineNumber": 46,
            "text": "\t\t$count         = count( $taxonomy_data );\r"
          },
          {
            "lineNumber": 47,
            "text": "\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r"
          },
          {
            "lineNumber": 48,
            "text": "\t\t\t$tax   = $taxonomy_data[ $i ]['args']['label'];\r"
          },
          {
            "lineNumber": 49,
            "text": "\t\t\t$terms = get_terms(\r"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t\t\t'taxonomy'   =\u003e $tax,\r"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t\t\t'fields'     =\u003e 'ids',\r"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\t\t\t'hide_empty' =\u003e false,\r"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\t\t)\r"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 56,
            "text": "\t\t\tforeach ( $terms as $value ) {\r"
          },
          {
            "lineNumber": 57,
            "text": "\t\t\t\twp_delete_term( $value, $tax );\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 59,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 60,
            "text": "\t}\r"
          },
          {
            "lineNumber": 61,
            "text": "\r"
          },
          {
            "lineNumber": 62,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 63,
            "text": "\t * The nature of inserting and deleting vehicles means terms in a few of our\r"
          }
        ],
        "originalContents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Taxonomies\r\n *\r\n * Registers and manipulates our custom taxonomies and their terms.\r\n *\r\n * @since      1.3.1\r\n * @package inventory-presser\r\n * @subpackage inventory-presser/includes\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e, John Norton \u003cnorton@fridaynet.com\u003e\r\n */\r\nclass Inventory_Presser_Taxonomies {\r\n\r\n\tconst CRON_HOOK_DELETE_TERMS = 'inventory_presser_delete_unused_terms';\r\n\r\n\t/**\r\n\t * Users can show and hide the taxonomies in the dashboard menu.\r\n\t *\r\n\t * @param  array $taxonomy_data\r\n\t * @return array\r\n\t */\r\n\tpublic function change_taxonomy_show_in_menu_attribute( $taxonomy_data ) {\r\n\t\t$settings = INVP::settings();\r\n\t\tif ( empty( $settings['taxonomies'] ) ) {\r\n\t\t\treturn $taxonomy_data;\r\n\t\t}\r\n\t\t$count = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\t// Should this taxonomy be shown in the dashboard menu under Vehicles?\r\n\t\t\t$taxonomy_data[ $i ]['args']['show_in_menu'] = $settings['taxonomies'][ $taxonomy_data[ $i ]['args']['query_var'] ]['admin_menu'] ?? false;\r\n\t\t}\r\n\t\treturn $taxonomy_data;\r\n\t}\r\n\r\n\t/**\r\n\t * Removes all terms in all our taxonomies. Used when uninstalling the\r\n\t * plugin.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function delete_term_data() {\r\n\t\t// remove the terms in taxonomies.\r\n\t\t$taxonomy_data = self::taxonomy_data();\r\n\t\t$count         = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\t$tax   = $taxonomy_data[ $i ]['args']['label'];\r\n\t\t\t$terms = get_terms(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'taxonomy'   =\u003e $tax,\r\n\t\t\t\t\t'fields'     =\u003e 'ids',\r\n\t\t\t\t\t'hide_empty' =\u003e false,\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tforeach ( $terms as $value ) {\r\n\t\t\t\twp_delete_term( $value, $tax );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n",
        "range": {
          "endPosition": {
            "line": 63
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/class-taxonomies.php"
      },
      "score": 0.31497490406036377
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Admin_Options\r\n *\r\n * Creates an options page in the dashboard to hold this plugin and its add-ons\r\n * settings.\r\n *\r\n * @since      0.5\r\n * @package    inventory-presser\r\n * @subpackage inventory-presser/includes\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r\n */\r\nclass Inventory_Presser_Admin_Options {\r\n\r\n\t/**\r\n\t * This plugin's option that holds all the settings.\r\n\t *\r\n\t * @var array\r\n\t */\r\n\tprivate $option;\r\n\tconst QUERY_VAR_MANAGE_VEHICLES = 'invp_manage_vehicles';\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\r\n\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\r\n\t\tadd_action( 'admin_menu', array( $this, 'add_options_pages' ) );\r\n\r\n\t\t// Look for a query variable that triggers Delete All Vehicles.\r\n\t\tadd_action( 'admin_init', array( $this, 'detect_manage_vehicles_query_var' ) );\r\n\r\n\t\t/**\r\n\t\t * When the option is updated, check if the additional listings pages\r\n\t\t * settings changed. If they have, flush permalinks.\r\n\t\t */\r\n\t\tadd_action( 'update_option_' . INVP::OPTION_NAME, array( $this, 'maybe_flush_permalinks' ), 10, 2 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an options page to the dashboard to hold all this plugin's settings.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_options_pages() {\r\n\t\tif ( post_type_exists( INVP::POST_TYPE ) ) {\r\n\t\t\t// Taxonomy settings page.\r\n\t\t\tadd_submenu_page(\r\n\t\t\t\t'edit.php?post_type=' . INVP::POST_TYPE,\r\n\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // page_title.\r\n\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // menu_title.\r\n\t\t\t\t'manage_options', // capability.\r\n\t\t\t\t'invp-taxonomies', // menu_slug.\r\n\t\t\t\tarray( $this, 'options_page_content_taxonomies' ) // function.\r\n\t\t\t);\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 3,
            "text": "\r"
          },
          {
            "lineNumber": 4,
            "text": "/**\r"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Admin_Options\r"
          },
          {
            "lineNumber": 6,
            "text": " *\r"
          },
          {
            "lineNumber": 7,
            "text": " * Creates an options page in the dashboard to hold this plugin and its add-ons\r"
          },
          {
            "lineNumber": 8,
            "text": " * settings.\r"
          },
          {
            "lineNumber": 9,
            "text": " *\r"
          },
          {
            "lineNumber": 10,
            "text": " * @since      0.5\r"
          },
          {
            "lineNumber": 11,
            "text": " * @package    inventory-presser\r"
          },
          {
            "lineNumber": 12,
            "text": " * @subpackage inventory-presser/includes\r"
          },
          {
            "lineNumber": 13,
            "text": " * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r"
          },
          {
            "lineNumber": 14,
            "text": " */\r"
          },
          {
            "lineNumber": 15,
            "text": "class Inventory_Presser_Admin_Options {\r"
          },
          {
            "lineNumber": 16,
            "text": "\r"
          },
          {
            "lineNumber": 17,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 18,
            "text": "\t * This plugin's option that holds all the settings.\r"
          },
          {
            "lineNumber": 19,
            "text": "\t *\r"
          },
          {
            "lineNumber": 20,
            "text": "\t * @var array\r"
          },
          {
            "lineNumber": 21,
            "text": "\t */\r"
          },
          {
            "lineNumber": 22,
            "text": "\tprivate $option;\r"
          },
          {
            "lineNumber": 23,
            "text": "\tconst QUERY_VAR_MANAGE_VEHICLES = 'invp_manage_vehicles';\r"
          },
          {
            "lineNumber": 24,
            "text": "\r"
          },
          {
            "lineNumber": 25,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 26,
            "text": "\t * Adds hooks\r"
          },
          {
            "lineNumber": 27,
            "text": "\t *\r"
          },
          {
            "lineNumber": 28,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 29,
            "text": "\t */\r"
          },
          {
            "lineNumber": 30,
            "text": "\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\r"
          },
          {
            "lineNumber": 32,
            "text": "\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\r"
          },
          {
            "lineNumber": 33,
            "text": "\t\tadd_action( 'admin_menu', array( $this, 'add_options_pages' ) );\r"
          },
          {
            "lineNumber": 34,
            "text": "\r"
          },
          {
            "lineNumber": 35,
            "text": "\t\t// Look for a query variable that triggers Delete All Vehicles.\r"
          },
          {
            "lineNumber": 36,
            "text": "\t\tadd_action( 'admin_init', array( $this, 'detect_manage_vehicles_query_var' ) );\r"
          },
          {
            "lineNumber": 37,
            "text": "\r"
          },
          {
            "lineNumber": 38,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 39,
            "text": "\t\t * When the option is updated, check if the additional listings pages\r"
          },
          {
            "lineNumber": 40,
            "text": "\t\t * settings changed. If they have, flush permalinks.\r"
          },
          {
            "lineNumber": 41,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 42,
            "text": "\t\tadd_action( 'update_option_' . INVP::OPTION_NAME, array( $this, 'maybe_flush_permalinks' ), 10, 2 );\r"
          },
          {
            "lineNumber": 43,
            "text": "\t}\r"
          },
          {
            "lineNumber": 44,
            "text": "\r"
          },
          {
            "lineNumber": 45,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 46,
            "text": "\t * Adds an options page to the dashboard to hold all this plugin's settings.\r"
          },
          {
            "lineNumber": 47,
            "text": "\t *\r"
          },
          {
            "lineNumber": 48,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 49,
            "text": "\t */\r"
          },
          {
            "lineNumber": 50,
            "text": "\tpublic function add_options_pages() {\r"
          },
          {
            "lineNumber": 51,
            "text": "\t\tif ( post_type_exists( INVP::POST_TYPE ) ) {\r"
          },
          {
            "lineNumber": 52,
            "text": "\t\t\t// Taxonomy settings page.\r"
          },
          {
            "lineNumber": 53,
            "text": "\t\t\tadd_submenu_page(\r"
          },
          {
            "lineNumber": 54,
            "text": "\t\t\t\t'edit.php?post_type=' . INVP::POST_TYPE,\r"
          },
          {
            "lineNumber": 55,
            "text": "\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // page_title.\r"
          },
          {
            "lineNumber": 56,
            "text": "\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // menu_title.\r"
          },
          {
            "lineNumber": 57,
            "text": "\t\t\t\t'manage_options', // capability.\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t\t'invp-taxonomies', // menu_slug.\r"
          },
          {
            "lineNumber": 59,
            "text": "\t\t\t\tarray( $this, 'options_page_content_taxonomies' ) // function.\r"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 61,
            "text": "\r"
          },
          {
            "lineNumber": 62,
            "text": "\t\t\t// Main options page at Vehicles → Options.\r"
          }
        ],
        "originalContents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Admin_Options\r\n *\r\n * Creates an options page in the dashboard to hold this plugin and its add-ons\r\n * settings.\r\n *\r\n * @since      0.5\r\n * @package    inventory-presser\r\n * @subpackage inventory-presser/includes\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r\n */\r\nclass Inventory_Presser_Admin_Options {\r\n\r\n\t/**\r\n\t * This plugin's option that holds all the settings.\r\n\t *\r\n\t * @var array\r\n\t */\r\n\tprivate $option;\r\n\tconst QUERY_VAR_MANAGE_VEHICLES = 'invp_manage_vehicles';\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\r\n\t\tadd_action( 'admin_init', array( $this, 'add_settings' ) );\r\n\t\tadd_action( 'admin_menu', array( $this, 'add_options_pages' ) );\r\n\r\n\t\t// Look for a query variable that triggers Delete All Vehicles.\r\n\t\tadd_action( 'admin_init', array( $this, 'detect_manage_vehicles_query_var' ) );\r\n\r\n\t\t/**\r\n\t\t * When the option is updated, check if the additional listings pages\r\n\t\t * settings changed. If they have, flush permalinks.\r\n\t\t */\r\n\t\tadd_action( 'update_option_' . INVP::OPTION_NAME, array( $this, 'maybe_flush_permalinks' ), 10, 2 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an options page to the dashboard to hold all this plugin's settings.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_options_pages() {\r\n\t\tif ( post_type_exists( INVP::POST_TYPE ) ) {\r\n\t\t\t// Taxonomy settings page.\r\n\t\t\tadd_submenu_page(\r\n\t\t\t\t'edit.php?post_type=' . INVP::POST_TYPE,\r\n\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // page_title.\r\n\t\t\t\t__( 'Taxonomies', 'inventory-presser' ), // menu_title.\r\n\t\t\t\t'manage_options', // capability.\r\n\t\t\t\t'invp-taxonomies', // menu_slug.\r\n\t\t\t\tarray( $this, 'options_page_content_taxonomies' ) // function.\r\n\t\t\t);\r\n",
        "range": {
          "endPosition": {
            "line": 62
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/admin/class-admin-options.php"
      },
      "score": 0.3148411512374878
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t// Include our object definition dependencies.\r\n\t\t\t$file_names = array(\r\n\t\t\t\t'class-add-custom-fields-to-search.php',\r\n\t\t\t\t'addon/class-addon-license-validator.php',\r\n\t\t\t\t'addon/class-addon-license.php',\r\n\t\t\t\t'addon/class-addon-updater.php',\r\n\t\t\t\t'addon/class-addon.php',\r\n\t\t\t\t'admin/class-admin-bar.php',\r\n\t\t\t\t'admin/class-admin-editor-sidebar.php',\r\n\t\t\t\t'admin/class-admin-location-meta.php',\r\n\t\t\t\t'admin/class-admin-menus.php',\r\n\t\t\t\t'admin/class-admin-options.php',\r\n\t\t\t\t'admin/class-admin-photo-arranger.php',\r\n\t\t\t\t'admin/class-admin-posts-list.php',\r\n\t\t\t\t'class-additional-listings-pages.php',\r\n\t\t\t\t'class-allow-inventory-as-home-page.php',\r\n\t\t\t\t'class-badges.php',\r\n\t\t\t\t'class-blocks.php',\r\n\t\t\t\t'class-business-day.php',\r\n\t\t\t\t'class-invp.php',\r\n\t\t\t\t'class-menu-item-email-a-friend.php',\r\n\t\t\t\t'class-menu-item-print.php',\r\n\t\t\t\t'class-option-manager.php',\r\n\t\t\t\t'class-photo-numberer.php',\r\n\t\t\t\t'class-range-filters.php',\r\n\t\t\t\t'class-redirect-404-vehicles.php',\r\n\t\t\t\t'class-rest.php',\r\n\t\t\t\t'class-schema-org-generator.php',\r\n\t\t\t\t'class-site-health.php',\r\n\t\t\t\t'integrations/class-avada.php',\r\n\t\t\t\t'integrations/class-classic-editor.php',\r\n\t\t\t\t'integrations/class-divi.php',\r\n\t\t\t\t'integrations/class-forms-integration.php',\r\n\t\t\t\t'integrations/class-contact-form-7.php',\r\n\t\t\t\t'integrations/class-gravityforms-field-vehicle.php',\r\n\t\t\t\t'integrations/class-wp-all-import.php',\r\n\t\t\t\t'integrations/class-wpforms.php',\r\n\t\t\t\t'shortcode/class-shortcode-hours-today.php',\r\n\t\t\t\t'shortcode/class-shortcode-iframe.php',\r\n\t\t\t\t'shortcode/class-shortcode-inventory-grid.php',\r\n\t\t\t\t'shortcode/class-shortcode-inventory-slider.php',\r\n\t\t\t\t'shortcode/class-shortcode-photo-slider.php',\r\n\t\t\t\t'shortcode/class-shortcode-archive.php',\r\n\t\t\t\t'shortcode/class-shortcode-archive-vehicle.php',\r\n\t\t\t\t'shortcode/class-shortcode-attribute-table.php',\r\n\t\t\t\t'shortcode/class-shortcode-price.php',\r\n\t\t\t\t'shortcode/class-shortcode-single-vehicle.php',\r\n\t\t\t\t'shortcode/class-shortcode-sort-by.php',\r\n",
        "detailedLines": [
          {
            "lineNumber": 1138,
            "text": "// include composer dependencies.\r"
          },
          {
            "lineNumber": 1139,
            "text": "\t\t\tinclude_once plugin_dir_path( INVP_PLUGIN_FILE_PATH ) . 'vendor/autoload.php';\r"
          },
          {
            "lineNumber": 1140,
            "text": "\r"
          },
          {
            "lineNumber": 1141,
            "text": "\t\t\t// Include our object definition dependencies.\r"
          },
          {
            "lineNumber": 1142,
            "text": "\t\t\t$file_names = array(\r"
          },
          {
            "lineNumber": 1143,
            "text": "\t\t\t\t'class-add-custom-fields-to-search.php',\r"
          },
          {
            "lineNumber": 1144,
            "text": "\t\t\t\t'addon/class-addon-license-validator.php',\r"
          },
          {
            "lineNumber": 1145,
            "text": "\t\t\t\t'addon/class-addon-license.php',\r"
          },
          {
            "lineNumber": 1146,
            "text": "\t\t\t\t'addon/class-addon-updater.php',\r"
          },
          {
            "lineNumber": 1147,
            "text": "\t\t\t\t'addon/class-addon.php',\r"
          },
          {
            "lineNumber": 1148,
            "text": "\t\t\t\t'admin/class-admin-bar.php',\r"
          },
          {
            "lineNumber": 1149,
            "text": "\t\t\t\t'admin/class-admin-editor-sidebar.php',\r"
          },
          {
            "lineNumber": 1150,
            "text": "\t\t\t\t'admin/class-admin-location-meta.php',\r"
          },
          {
            "lineNumber": 1151,
            "text": "\t\t\t\t'admin/class-admin-menus.php',\r"
          },
          {
            "lineNumber": 1152,
            "text": "\t\t\t\t'admin/class-admin-options.php',\r"
          },
          {
            "lineNumber": 1153,
            "text": "\t\t\t\t'admin/class-admin-photo-arranger.php',\r"
          },
          {
            "lineNumber": 1154,
            "text": "\t\t\t\t'admin/class-admin-posts-list.php',\r"
          },
          {
            "lineNumber": 1155,
            "text": "\t\t\t\t'class-additional-listings-pages.php',\r"
          },
          {
            "lineNumber": 1156,
            "text": "\t\t\t\t'class-allow-inventory-as-home-page.php',\r"
          },
          {
            "lineNumber": 1157,
            "text": "\t\t\t\t'class-badges.php',\r"
          },
          {
            "lineNumber": 1158,
            "text": "\t\t\t\t'class-blocks.php',\r"
          },
          {
            "lineNumber": 1159,
            "text": "\t\t\t\t'class-business-day.php',\r"
          },
          {
            "lineNumber": 1160,
            "text": "\t\t\t\t'class-invp.php',\r"
          },
          {
            "lineNumber": 1161,
            "text": "\t\t\t\t'class-menu-item-email-a-friend.php',\r"
          },
          {
            "lineNumber": 1162,
            "text": "\t\t\t\t'class-menu-item-print.php',\r"
          },
          {
            "lineNumber": 1163,
            "text": "\t\t\t\t'class-option-manager.php',\r"
          },
          {
            "lineNumber": 1164,
            "text": "\t\t\t\t'class-photo-numberer.php',\r"
          },
          {
            "lineNumber": 1165,
            "text": "\t\t\t\t'class-range-filters.php',\r"
          },
          {
            "lineNumber": 1166,
            "text": "\t\t\t\t'class-redirect-404-vehicles.php',\r"
          },
          {
            "lineNumber": 1167,
            "text": "\t\t\t\t'class-rest.php',\r"
          },
          {
            "lineNumber": 1168,
            "text": "\t\t\t\t'class-schema-org-generator.php',\r"
          },
          {
            "lineNumber": 1169,
            "text": "\t\t\t\t'class-site-health.php',\r"
          },
          {
            "lineNumber": 1170,
            "text": "\t\t\t\t'integrations/class-avada.php',\r"
          },
          {
            "lineNumber": 1171,
            "text": "\t\t\t\t'integrations/class-classic-editor.php',\r"
          },
          {
            "lineNumber": 1172,
            "text": "\t\t\t\t'integrations/class-divi.php',\r"
          },
          {
            "lineNumber": 1173,
            "text": "\t\t\t\t'integrations/class-forms-integration.php',\r"
          },
          {
            "lineNumber": 1174,
            "text": "\t\t\t\t'integrations/class-contact-form-7.php',\r"
          },
          {
            "lineNumber": 1175,
            "text": "\t\t\t\t'integrations/class-gravityforms-field-vehicle.php',\r"
          },
          {
            "lineNumber": 1176,
            "text": "\t\t\t\t'integrations/class-wp-all-import.php',\r"
          },
          {
            "lineNumber": 1177,
            "text": "\t\t\t\t'integrations/class-wpforms.php',\r"
          },
          {
            "lineNumber": 1178,
            "text": "\t\t\t\t'shortcode/class-shortcode-hours-today.php',\r"
          },
          {
            "lineNumber": 1179,
            "text": "\t\t\t\t'shortcode/class-shortcode-iframe.php',\r"
          },
          {
            "lineNumber": 1180,
            "text": "\t\t\t\t'shortcode/class-shortcode-inventory-grid.php',\r"
          },
          {
            "lineNumber": 1181,
            "text": "\t\t\t\t'shortcode/class-shortcode-inventory-slider.php',\r"
          },
          {
            "lineNumber": 1182,
            "text": "\t\t\t\t'shortcode/class-shortcode-photo-slider.php',\r"
          },
          {
            "lineNumber": 1183,
            "text": "\t\t\t\t'shortcode/class-shortcode-archive.php',\r"
          },
          {
            "lineNumber": 1184,
            "text": "\t\t\t\t'shortcode/class-shortcode-archive-vehicle.php',\r"
          },
          {
            "lineNumber": 1185,
            "text": "\t\t\t\t'shortcode/class-shortcode-attribute-table.php',\r"
          },
          {
            "lineNumber": 1186,
            "text": "\t\t\t\t'shortcode/class-shortcode-price.php',\r"
          },
          {
            "lineNumber": 1187,
            "text": "\t\t\t\t'shortcode/class-shortcode-single-vehicle.php',\r"
          },
          {
            "lineNumber": 1188,
            "text": "\t\t\t\t'shortcode/class-shortcode-sort-by.php',\r"
          },
          {
            "lineNumber": 1189,
            "text": "\t\t\t\t'shortcode/class-shortcode-vin.php',\r"
          },
          {
            "lineNumber": 1190,
            "text": "\t\t\t\t'class-taxonomies.php',\r"
          }
        ],
        "originalContents": "\r\n\t\t\t// Include our object definition dependencies.\r\n\t\t\t$file_names = array(\r\n\t\t\t\t'class-add-custom-fields-to-search.php',\r\n\t\t\t\t'addon/class-addon-license-validator.php',\r\n\t\t\t\t'addon/class-addon-license.php',\r\n\t\t\t\t'addon/class-addon-updater.php',\r\n\t\t\t\t'addon/class-addon.php',\r\n\t\t\t\t'admin/class-admin-bar.php',\r\n\t\t\t\t'admin/class-admin-editor-sidebar.php',\r\n\t\t\t\t'admin/class-admin-location-meta.php',\r\n\t\t\t\t'admin/class-admin-menus.php',\r\n\t\t\t\t'admin/class-admin-options.php',\r\n\t\t\t\t'admin/class-admin-photo-arranger.php',\r\n\t\t\t\t'admin/class-admin-posts-list.php',\r\n\t\t\t\t'class-additional-listings-pages.php',\r\n\t\t\t\t'class-allow-inventory-as-home-page.php',\r\n\t\t\t\t'class-badges.php',\r\n\t\t\t\t'class-blocks.php',\r\n\t\t\t\t'class-business-day.php',\r\n\t\t\t\t'class-invp.php',\r\n\t\t\t\t'class-menu-item-email-a-friend.php',\r\n\t\t\t\t'class-menu-item-print.php',\r\n\t\t\t\t'class-option-manager.php',\r\n\t\t\t\t'class-photo-numberer.php',\r\n\t\t\t\t'class-range-filters.php',\r\n\t\t\t\t'class-redirect-404-vehicles.php',\r\n\t\t\t\t'class-rest.php',\r\n\t\t\t\t'class-schema-org-generator.php',\r\n\t\t\t\t'class-site-health.php',\r\n\t\t\t\t'integrations/class-avada.php',\r\n\t\t\t\t'integrations/class-classic-editor.php',\r\n\t\t\t\t'integrations/class-divi.php',\r\n\t\t\t\t'integrations/class-forms-integration.php',\r\n\t\t\t\t'integrations/class-contact-form-7.php',\r\n\t\t\t\t'integrations/class-gravityforms-field-vehicle.php',\r\n\t\t\t\t'integrations/class-wp-all-import.php',\r\n\t\t\t\t'integrations/class-wpforms.php',\r\n\t\t\t\t'shortcode/class-shortcode-hours-today.php',\r\n\t\t\t\t'shortcode/class-shortcode-iframe.php',\r\n\t\t\t\t'shortcode/class-shortcode-inventory-grid.php',\r\n\t\t\t\t'shortcode/class-shortcode-inventory-slider.php',\r\n\t\t\t\t'shortcode/class-shortcode-photo-slider.php',\r\n\t\t\t\t'shortcode/class-shortcode-archive.php',\r\n\t\t\t\t'shortcode/class-shortcode-archive-vehicle.php',\r\n\t\t\t\t'shortcode/class-shortcode-attribute-table.php',\r\n\t\t\t\t'shortcode/class-shortcode-price.php',\r\n\t\t\t\t'shortcode/class-shortcode-single-vehicle.php',\r\n\t\t\t\t'shortcode/class-shortcode-sort-by.php',\r\n",
        "range": {
          "endPosition": {
            "line": 1190
          },
          "startPosition": {
            "column": 3,
            "line": 1137
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.31075024604797363
    }
  ]
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking the JavaScript file and how it's enqueued:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "registerPlugin|invp-plugin-sidebar" in "js/editor-sidebar.js" • 4 matches</summary>

Output mode: content


| File | Content | Line |
|------|------|------|
| `js/editor-sidebar.js` | `var registerPlugin = wp.plugins.registerPlugin;` | L58 |
| `js/editor-sidebar.js` | `registerPlugin(` | L314 |
| `js/editor-sidebar.js` | `'invp-plugin-sidebar',` | L315 |
| `js/editor-sidebar.js` | `name: 'invp-plugin-sidebar',` | L572 |


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking how the plugin is registered in the JavaScript file:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 69
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/admin/class-admin-editor-sidebar.php",
        "signatures": {}
      },
      "score": 0.3471491038799286
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 65
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-classic-editor.php",
        "signatures": {}
      },
      "score": 0.33715391159057617
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/title-status/edit.js",
        "signatures": {}
      },
      "score": 0.30116385221481323
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 73
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/class-blocks.php",
        "signatures": {}
      },
      "score": 0.2824799120426178
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/model/edit.js",
        "signatures": {}
      },
      "score": 0.27365121245384216
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 49
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/admin/class-admin-bar.php",
        "signatures": {}
      },
      "score": 0.2730391025543213
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 25,
            "line": 315
          },
          "startPosition": {
            "column": 4,
            "line": 275
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js",
        "signatures": {
          "ranges": [
            {
              "endPosition": {
                "column": 1,
                "line": 57
              },
              "startPosition": {
                "column": 1,
                "line": 57
              }
            }
          ]
        }
      },
      "score": 0.2729775011539459
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 4,
            "line": 199
          },
          "startPosition": {
            "column": 3,
            "line": 127
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js",
        "signatures": {
          "ranges": [
            {
              "endPosition": {
                "column": 1,
                "line": 57
              },
              "startPosition": {
                "column": 1,
                "line": 57
              }
            }
          ]
        }
      },
      "score": 0.2710920572280884
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 5,
            "line": 22
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js",
        "signatures": {}
      },
      "score": 0.27102169394493103
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1831
          },
          "startPosition": {
            "column": 1,
            "line": 1770
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.26963603496551514
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/stock-number/edit.js",
        "signatures": {}
      },
      "score": 0.2685616910457611
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/vin/edit.js",
        "signatures": {}
      },
      "score": 0.26849889755249023
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/body-style/edit.js",
        "signatures": {}
      },
      "score": 0.26804161071777344
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 148
          },
          "startPosition": {
            "column": 2,
            "line": 128
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-divi.php",
        "signatures": {}
      },
      "score": 0.2658182382583618
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 2,
            "line": 33
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "src/blocks/beam/edit.js",
        "signatures": {}
      },
      "score": 0.2657959461212158
    }
  ],
  "explanation": "",
  "query": "How to check if we are on widgets.php page or in post editor context?",
  "repositoryInfo": {
    "orthogonalTransformSeed": 6308982098672407,
    "preferredEmbeddingModel": "EMBEDDING_MODEL_UNSPECIFIED",
    "relativeWorkspacePath": ".",
    "repoName": "5a26c3e1-2367-4e37-aaba-63a54ad0ac26",
    "repoOwner": "auth0|user_01JXZMQ8XHQ8Y96GRWHQJCM038"
  },
  "topK": 15
}
```
Result:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "contents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Editor_Sidebar\n *\n * Adds a sidebar to the WordPress editor so that meta fields can be edited\n * outside of blocks.\n */\nclass Inventory_Presser_Admin_Editor_Sidebar {\n\n\t/**\n\t * Registers a JavaScript file\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_register() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_register_script(\n\t\t\t'invp-plugin-sidebar',\n\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),\n\t\t\tINVP_PLUGIN_VERSION,\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Includes the JavaScript file when editing a vehicle in the dashboard.\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_script_enqueue() {\n\t\t// Are we editing a vehicle?\n\t\tglobal $post;\n\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {\n\t\t\treturn;\n\t\t}\n\t\twp_enqueue_script( 'invp-plugin-sidebar' );\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_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );\n\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\n\t}\n\n\t/**\n\t * Includes the wp-api JavaScript\n\t *\n\t * @return void\n\t */\n\tpublic function scripts_and_styles() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_enqueue_script( 'wp-api' );\n\t\twp_enqueue_style(\n\t\t\t'invp-editor-sidebar',\n\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray(),\n\t\t\tINVP_PLUGIN_VERSION\n\t\t);\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Admin_Editor_Sidebar"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * Adds a sidebar to the WordPress editor so that meta fields can be edited"
          },
          {
            "lineNumber": 8,
            "text": " * outside of blocks."
          },
          {
            "lineNumber": 9,
            "text": " */"
          },
          {
            "lineNumber": 10,
            "text": "class Inventory_Presser_Admin_Editor_Sidebar {"
          },
          {
            "lineNumber": 11
          },
          {
            "lineNumber": 12,
            "text": "\t/**"
          },
          {
            "lineNumber": 13,
            "text": "\t * Registers a JavaScript file"
          },
          {
            "lineNumber": 14,
            "text": "\t *"
          },
          {
            "lineNumber": 15,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 16,
            "text": "\t */"
          },
          {
            "lineNumber": 17,
            "text": "\tpublic function sidebar_plugin_register() {"
          },
          {
            "lineNumber": 18,
            "text": "\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';"
          },
          {
            "lineNumber": 19,
            "text": "\t\twp_register_script("
          },
          {
            "lineNumber": 20,
            "text": "\t\t\t'invp-plugin-sidebar',"
          },
          {
            "lineNumber": 21,
            "text": "\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),"
          },
          {
            "lineNumber": 22,
            "text": "\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),"
          },
          {
            "lineNumber": 23,
            "text": "\t\t\tINVP_PLUGIN_VERSION,"
          },
          {
            "lineNumber": 24,
            "text": "\t\t\ttrue"
          },
          {
            "lineNumber": 25,
            "text": "\t\t);"
          },
          {
            "lineNumber": 26,
            "text": "\t}"
          },
          {
            "lineNumber": 27
          },
          {
            "lineNumber": 28,
            "text": "\t/**"
          },
          {
            "lineNumber": 29,
            "text": "\t * Includes the JavaScript file when editing a vehicle in the dashboard."
          },
          {
            "lineNumber": 30,
            "text": "\t *"
          },
          {
            "lineNumber": 31,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 32,
            "text": "\t */"
          },
          {
            "lineNumber": 33,
            "text": "\tpublic function sidebar_plugin_script_enqueue() {"
          },
          {
            "lineNumber": 34,
            "text": "\t\t// Are we editing a vehicle?"
          },
          {
            "lineNumber": 35,
            "text": "\t\tglobal $post;"
          },
          {
            "lineNumber": 36,
            "text": "\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {"
          },
          {
            "lineNumber": 37,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 38,
            "text": "\t\t}"
          },
          {
            "lineNumber": 39,
            "text": "\t\twp_enqueue_script( 'invp-plugin-sidebar' );"
          },
          {
            "lineNumber": 40,
            "text": "\t}"
          },
          {
            "lineNumber": 41
          },
          {
            "lineNumber": 42,
            "text": "\t/**"
          },
          {
            "lineNumber": 43,
            "text": "\t * Adds hooks"
          },
          {
            "lineNumber": 44,
            "text": "\t *"
          },
          {
            "lineNumber": 45,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 46,
            "text": "\t */"
          },
          {
            "lineNumber": 47,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 48,
            "text": "\t\tadd_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );"
          },
          {
            "lineNumber": 49,
            "text": "\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );"
          },
          {
            "lineNumber": 50,
            "text": "\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );"
          },
          {
            "lineNumber": 51,
            "text": "\t}"
          },
          {
            "lineNumber": 52
          },
          {
            "lineNumber": 53,
            "text": "\t/**"
          },
          {
            "lineNumber": 54,
            "text": "\t * Includes the wp-api JavaScript"
          },
          {
            "lineNumber": 55,
            "text": "\t *"
          },
          {
            "lineNumber": 56,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 57,
            "text": "\t */"
          },
          {
            "lineNumber": 58,
            "text": "\tpublic function scripts_and_styles() {"
          },
          {
            "lineNumber": 59,
            "text": "\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';"
          },
          {
            "lineNumber": 60,
            "text": "\t\twp_enqueue_script( 'wp-api' );"
          },
          {
            "lineNumber": 61,
            "text": "\t\twp_enqueue_style("
          },
          {
            "lineNumber": 62,
            "text": "\t\t\t'invp-editor-sidebar',"
          },
          {
            "lineNumber": 63,
            "text": "\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),"
          },
          {
            "lineNumber": 64,
            "text": "\t\t\tarray(),"
          },
          {
            "lineNumber": 65,
            "text": "\t\t\tINVP_PLUGIN_VERSION"
          },
          {
            "lineNumber": 66,
            "text": "\t\t);"
          },
          {
            "lineNumber": 67,
            "text": "\t}"
          },
          {
            "lineNumber": 68,
            "text": "}"
          }
        ],
        "originalContents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Editor_Sidebar\n *\n * Adds a sidebar to the WordPress editor so that meta fields can be edited\n * outside of blocks.\n */\nclass Inventory_Presser_Admin_Editor_Sidebar {\n\n\t/**\n\t * Registers a JavaScript file\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_register() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_register_script(\n\t\t\t'invp-plugin-sidebar',\n\t\t\tplugins_url( \"/js/editor-sidebar{$min}.js\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray( 'invp', 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-api' ),\n\t\t\tINVP_PLUGIN_VERSION,\n\t\t\ttrue\n\t\t);\n\t}\n\n\t/**\n\t * Includes the JavaScript file when editing a vehicle in the dashboard.\n\t *\n\t * @return void\n\t */\n\tpublic function sidebar_plugin_script_enqueue() {\n\t\t// Are we editing a vehicle?\n\t\tglobal $post;\n\t\tif ( empty( $post-\u003epost_type ) || INVP::POST_TYPE !== $post-\u003epost_type ) {\n\t\t\treturn;\n\t\t}\n\t\twp_enqueue_script( 'invp-plugin-sidebar' );\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_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );\n\t\tadd_action( 'init', array( $this, 'sidebar_plugin_register' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );\n\t}\n\n\t/**\n\t * Includes the wp-api JavaScript\n\t *\n\t * @return void\n\t */\n\tpublic function scripts_and_styles() {\n\t\t$min = defined( 'SCRIPT_DEBUG' ) \u0026\u0026 SCRIPT_DEBUG ? '' : '.min';\n\t\twp_enqueue_script( 'wp-api' );\n\t\twp_enqueue_style(\n\t\t\t'invp-editor-sidebar',\n\t\t\tplugins_url( \"/css/editor-sidebar{$min}.css\", INVP_PLUGIN_FILE_PATH ),\n\t\t\tarray(),\n\t\t\tINVP_PLUGIN_VERSION\n\t\t);\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 68
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/admin/class-admin-editor-sidebar.php"
      },
      "score": 0.3471491038799286
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\n/**\r\n * Classic Editor\r\n *\r\n * @package inventory-presser\r\n */\r\n\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Classic_Editor\r\n *\r\n * Adds features to the Classic Editor.\r\n *\r\n * @since      14.10.0\r\n * @package    inventory-presser\r\n * @subpackage inventory-presser/includes/integrations\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r\n */\r\nclass Inventory_Presser_Classic_Editor {\r\n\r\n\tconst NONCE_DELETE_ALL_MEDIA = 'invp_delete_all_media';\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'current_screen', array( $this, 'add_hooks_current_screen' ) );\r\n\r\n\t\t// Define an AJAX handler for the 'Delete All Media' button.\r\n\t\tadd_action( 'wp_ajax_delete_all_post_attachments', array( $this, 'delete_all_post_attachments' ) );\r\n\r\n\t\t// Return information to the editor after the Add Media button is used.\r\n\t\tadd_action( 'wp_ajax_get_add_media_result', array( $this, 'get_add_media_result' ) );\r\n\r\n\t\t// Stop adding media HTML to the post body after Add Media button is used.\r\n\t\tadd_filter( 'media_send_to_editor', array( $this, 'erase_add_media_html' ), 10, 2 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks during the current_screen action filter.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks_current_screen() {\r\n\t\t// Are we editing a vehicle in the Classic Editor?\r\n\t\tif ( ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {\r\n\t\t\t// No. Classic Editor plugin is not active.\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Is the Block Editor enabled as a default, though?\r\n\t\t$block_editor_active = array( 'no-replace', 'block' );\r\n\t\tif ( in_array( get_option( 'classic-editor-replace' ), $block_editor_active, true ) ) {\r\n\t\t\t// Yes.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tglobal $pagenow, $current_screen;\r\n\t\tif ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ), true ) || INVP::POST_TYPE !== $current_screen-\u003epost_type ) {\r\n\t\t\t// No. Not adding or editing editing a vehicle.\r\n\t\t\treturn;\r\n\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "/**\r"
          },
          {
            "lineNumber": 3,
            "text": " * Classic Editor\r"
          },
          {
            "lineNumber": 4,
            "text": " *\r"
          },
          {
            "lineNumber": 5,
            "text": " * @package inventory-presser\r"
          },
          {
            "lineNumber": 6,
            "text": " */\r"
          },
          {
            "lineNumber": 7,
            "text": "\r"
          },
          {
            "lineNumber": 8,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 9,
            "text": "\r"
          },
          {
            "lineNumber": 10,
            "text": "/**\r"
          },
          {
            "lineNumber": 11,
            "text": " * Inventory_Presser_Classic_Editor\r"
          },
          {
            "lineNumber": 12,
            "text": " *\r"
          },
          {
            "lineNumber": 13,
            "text": " * Adds features to the Classic Editor.\r"
          },
          {
            "lineNumber": 14,
            "text": " *\r"
          },
          {
            "lineNumber": 15,
            "text": " * @since      14.10.0\r"
          },
          {
            "lineNumber": 16,
            "text": " * @package    inventory-presser\r"
          },
          {
            "lineNumber": 17,
            "text": " * @subpackage inventory-presser/includes/integrations\r"
          },
          {
            "lineNumber": 18,
            "text": " * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r"
          },
          {
            "lineNumber": 19,
            "text": " */\r"
          },
          {
            "lineNumber": 20,
            "text": "class Inventory_Presser_Classic_Editor {\r"
          },
          {
            "lineNumber": 21,
            "text": "\r"
          },
          {
            "lineNumber": 22,
            "text": "\tconst NONCE_DELETE_ALL_MEDIA = 'invp_delete_all_media';\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 25,
            "text": "\t * Adds hooks\r"
          },
          {
            "lineNumber": 26,
            "text": "\t *\r"
          },
          {
            "lineNumber": 27,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 28,
            "text": "\t */\r"
          },
          {
            "lineNumber": 29,
            "text": "\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\tadd_action( 'current_screen', array( $this, 'add_hooks_current_screen' ) );\r"
          },
          {
            "lineNumber": 31,
            "text": "\r"
          },
          {
            "lineNumber": 32,
            "text": "\t\t// Define an AJAX handler for the 'Delete All Media' button.\r"
          },
          {
            "lineNumber": 33,
            "text": "\t\tadd_action( 'wp_ajax_delete_all_post_attachments', array( $this, 'delete_all_post_attachments' ) );\r"
          },
          {
            "lineNumber": 34,
            "text": "\r"
          },
          {
            "lineNumber": 35,
            "text": "\t\t// Return information to the editor after the Add Media button is used.\r"
          },
          {
            "lineNumber": 36,
            "text": "\t\tadd_action( 'wp_ajax_get_add_media_result', array( $this, 'get_add_media_result' ) );\r"
          },
          {
            "lineNumber": 37,
            "text": "\r"
          },
          {
            "lineNumber": 38,
            "text": "\t\t// Stop adding media HTML to the post body after Add Media button is used.\r"
          },
          {
            "lineNumber": 39,
            "text": "\t\tadd_filter( 'media_send_to_editor', array( $this, 'erase_add_media_html' ), 10, 2 );\r"
          },
          {
            "lineNumber": 40,
            "text": "\t}\r"
          },
          {
            "lineNumber": 41,
            "text": "\r"
          },
          {
            "lineNumber": 42,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 43,
            "text": "\t * Adds hooks during the current_screen action filter.\r"
          },
          {
            "lineNumber": 44,
            "text": "\t *\r"
          },
          {
            "lineNumber": 45,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 46,
            "text": "\t */\r"
          },
          {
            "lineNumber": 47,
            "text": "\tpublic function add_hooks_current_screen() {\r"
          },
          {
            "lineNumber": 48,
            "text": "\t\t// Are we editing a vehicle in the Classic Editor?\r"
          },
          {
            "lineNumber": 49,
            "text": "\t\tif ( ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {\r"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t// No. Classic Editor plugin is not active.\r"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 52,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 53,
            "text": "\t\t// Is the Block Editor enabled as a default, though?\r"
          },
          {
            "lineNumber": 54,
            "text": "\t\t$block_editor_active = array( 'no-replace', 'block' );\r"
          },
          {
            "lineNumber": 55,
            "text": "\t\tif ( in_array( get_option( 'classic-editor-replace' ), $block_editor_active, true ) ) {\r"
          },
          {
            "lineNumber": 56,
            "text": "\t\t\t// Yes.\r"
          },
          {
            "lineNumber": 57,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 59,
            "text": "\r"
          },
          {
            "lineNumber": 60,
            "text": "\t\tglobal $pagenow, $current_screen;\r"
          },
          {
            "lineNumber": 61,
            "text": "\t\tif ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ), true ) || INVP::POST_TYPE !== $current_screen-\u003epost_type ) {\r"
          },
          {
            "lineNumber": 62,
            "text": "\t\t\t// No. Not adding or editing editing a vehicle.\r"
          },
          {
            "lineNumber": 63,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 64,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 65,
            "text": "\r"
          },
          {
            "lineNumber": 66,
            "text": "\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes_to_cpt' ) );\r"
          }
        ],
        "originalContents": "\u003c?php\r\n/**\r\n * Classic Editor\r\n *\r\n * @package inventory-presser\r\n */\r\n\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Classic_Editor\r\n *\r\n * Adds features to the Classic Editor.\r\n *\r\n * @since      14.10.0\r\n * @package    inventory-presser\r\n * @subpackage inventory-presser/includes/integrations\r\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\r\n */\r\nclass Inventory_Presser_Classic_Editor {\r\n\r\n\tconst NONCE_DELETE_ALL_MEDIA = 'invp_delete_all_media';\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'current_screen', array( $this, 'add_hooks_current_screen' ) );\r\n\r\n\t\t// Define an AJAX handler for the 'Delete All Media' button.\r\n\t\tadd_action( 'wp_ajax_delete_all_post_attachments', array( $this, 'delete_all_post_attachments' ) );\r\n\r\n\t\t// Return information to the editor after the Add Media button is used.\r\n\t\tadd_action( 'wp_ajax_get_add_media_result', array( $this, 'get_add_media_result' ) );\r\n\r\n\t\t// Stop adding media HTML to the post body after Add Media button is used.\r\n\t\tadd_filter( 'media_send_to_editor', array( $this, 'erase_add_media_html' ), 10, 2 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks during the current_screen action filter.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks_current_screen() {\r\n\t\t// Are we editing a vehicle in the Classic Editor?\r\n\t\tif ( ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {\r\n\t\t\t// No. Classic Editor plugin is not active.\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Is the Block Editor enabled as a default, though?\r\n\t\t$block_editor_active = array( 'no-replace', 'block' );\r\n\t\tif ( in_array( get_option( 'classic-editor-replace' ), $block_editor_active, true ) ) {\r\n\t\t\t// Yes.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tglobal $pagenow, $current_screen;\r\n\t\tif ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ), true ) || INVP::POST_TYPE !== $current_screen-\u003epost_type ) {\r\n\t\t\t// No. Not adding or editing editing a vehicle.\r\n\t\t\treturn;\r\n\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 66
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/integrations/class-classic-editor.php"
      },
      "score": 0.33715391159057617
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'title_status' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Title Status', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'title_status' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'title_status']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'title_status' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'Title Status', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'title_status' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'title_status']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'title_status' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Title Status', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'title_status' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'title_status']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/title-status/edit.js"
      },
      "score": 0.30116385221481323
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Blocks\r\n *\r\n * Creates blocks\r\n */\r\nclass Inventory_Presser_Blocks {\r\n\r\n\t/**\r\n\t * Adds a block category to hold all our blocks\r\n\t *\r\n\t * @param  array $block_categories\r\n\t * @return array\r\n\t */\r\n\tpublic function add_category( $block_categories ) {\r\n\t\treturn array_merge(\r\n\t\t\t$block_categories,\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r\n\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r\n\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r\n\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r\n\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r\n\r\n\t\t/**\r\n\t\t * When a vehicle is opened in the block editor, add a Description block\r\n\t\t * to the post.\r\n\t\t */\r\n\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a Description Block to the post when a vehicle is opened in the\r\n\t * block editor.\r\n\t *\r\n\t * @param  WP_Post $post The post loaded into the block editor.\r\n\t * @return void\r\n\t */\r\n\tpublic function create_block_description( $post ) {\r\n\t\tglobal $pagenow;\r\n\t\t// Is the user adding or editing a vehicle?\r\n\t\tif ( ! is_admin()\r\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\r\n\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r\n\t\t\t// No.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Does the post content contain a Description block?\r\n\t\t$blocks = parse_blocks( $post-\u003epost_content );\r\n\t\tforeach ( $blocks as $block ) {\r\n\t\t\t// Is this a Description block?\r\n\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r\n\t\t\t\t// Yes. The post already has a Description block.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 3,
            "text": "\r"
          },
          {
            "lineNumber": 4,
            "text": "/**\r"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Blocks\r"
          },
          {
            "lineNumber": 6,
            "text": " *\r"
          },
          {
            "lineNumber": 7,
            "text": " * Creates blocks\r"
          },
          {
            "lineNumber": 8,
            "text": " */\r"
          },
          {
            "lineNumber": 9,
            "text": "class Inventory_Presser_Blocks {\r"
          },
          {
            "lineNumber": 10,
            "text": "\r"
          },
          {
            "lineNumber": 11,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 12,
            "text": "\t * Adds a block category to hold all our blocks\r"
          },
          {
            "lineNumber": 13,
            "text": "\t *\r"
          },
          {
            "lineNumber": 14,
            "text": "\t * @param  array $block_categories\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * @return array\r"
          },
          {
            "lineNumber": 16,
            "text": "\t */\r"
          },
          {
            "lineNumber": 17,
            "text": "\tpublic function add_category( $block_categories ) {\r"
          },
          {
            "lineNumber": 18,
            "text": "\t\treturn array_merge(\r"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t$block_categories,\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t\tarray(\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 22,
            "text": "\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r"
          },
          {
            "lineNumber": 23,
            "text": "\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 24,
            "text": "\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t)\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 28,
            "text": "\t}\r"
          },
          {
            "lineNumber": 29,
            "text": "\r"
          },
          {
            "lineNumber": 30,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 31,
            "text": "\t * Adds hooks\r"
          },
          {
            "lineNumber": 32,
            "text": "\t *\r"
          },
          {
            "lineNumber": 33,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 34,
            "text": "\t */\r"
          },
          {
            "lineNumber": 35,
            "text": "\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 36,
            "text": "\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r"
          },
          {
            "lineNumber": 37,
            "text": "\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r"
          },
          {
            "lineNumber": 38,
            "text": "\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r"
          },
          {
            "lineNumber": 39,
            "text": "\r"
          },
          {
            "lineNumber": 40,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 41,
            "text": "\t\t * When a vehicle is opened in the block editor, add a Description block\r"
          },
          {
            "lineNumber": 42,
            "text": "\t\t * to the post.\r"
          },
          {
            "lineNumber": 43,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 44,
            "text": "\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r"
          },
          {
            "lineNumber": 45,
            "text": "\t}\r"
          },
          {
            "lineNumber": 46,
            "text": "\r"
          },
          {
            "lineNumber": 47,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 48,
            "text": "\t * Adds a Description Block to the post when a vehicle is opened in the\r"
          },
          {
            "lineNumber": 49,
            "text": "\t * block editor.\r"
          },
          {
            "lineNumber": 50,
            "text": "\t *\r"
          },
          {
            "lineNumber": 51,
            "text": "\t * @param  WP_Post $post The post loaded into the block editor.\r"
          },
          {
            "lineNumber": 52,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 53,
            "text": "\t */\r"
          },
          {
            "lineNumber": 54,
            "text": "\tpublic function create_block_description( $post ) {\r"
          },
          {
            "lineNumber": 55,
            "text": "\t\tglobal $pagenow;\r"
          },
          {
            "lineNumber": 56,
            "text": "\t\t// Is the user adding or editing a vehicle?\r"
          },
          {
            "lineNumber": 57,
            "text": "\t\tif ( ! is_admin()\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\t\t|| get_post_type() !== INVP::POST_TYPE\r"
          },
          {
            "lineNumber": 59,
            "text": "\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r"
          },
          {
            "lineNumber": 60,
            "text": "\t\t\t// No.\r"
          },
          {
            "lineNumber": 61,
            "text": "\t\t\treturn;\r"
          },
          {
            "lineNumber": 62,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 63,
            "text": "\r"
          },
          {
            "lineNumber": 64,
            "text": "\t\t// Does the post content contain a Description block?\r"
          },
          {
            "lineNumber": 65,
            "text": "\t\t$blocks = parse_blocks( $post-\u003epost_content );\r"
          },
          {
            "lineNumber": 66,
            "text": "\t\tforeach ( $blocks as $block ) {\r"
          },
          {
            "lineNumber": 67,
            "text": "\t\t\t// Is this a Description block?\r"
          },
          {
            "lineNumber": 68,
            "text": "\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r"
          },
          {
            "lineNumber": 69,
            "text": "\t\t\t\t// Yes. The post already has a Description block.\r"
          },
          {
            "lineNumber": 70,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 71,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 72,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 73,
            "text": "\r"
          },
          {
            "lineNumber": 74,
            "text": "\t\t// The post does not have a Description block. Add one.\r"
          }
        ],
        "originalContents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_Blocks\r\n *\r\n * Creates blocks\r\n */\r\nclass Inventory_Presser_Blocks {\r\n\r\n\t/**\r\n\t * Adds a block category to hold all our blocks\r\n\t *\r\n\t * @param  array $block_categories\r\n\t * @return array\r\n\t */\r\n\tpublic function add_category( $block_categories ) {\r\n\t\treturn array_merge(\r\n\t\t\t$block_categories,\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'slug'  =\u003e 'inventory-presser',\r\n\t\t\t\t\t'title' =\u003e __( 'Inventory Presser', 'inventory-presser' ),\r\n\t\t\t\t\t'icon'  =\u003e 'dashicons-admin-network', // it's a key.\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\tadd_action( 'init', array( $this, 'register_block_types' ) );\r\n\t\tadd_action( 'enqueue_block_assets', array( $this, 'enqueue_block_editor_assets' ) );\r\n\t\tadd_filter( 'block_categories_all', array( $this, 'add_category' ), 10, 1 );\r\n\r\n\t\t/**\r\n\t\t * When a vehicle is opened in the block editor, add a Description block\r\n\t\t * to the post.\r\n\t\t */\r\n\t\tadd_action( 'the_post', array( $this, 'create_block_description' ), 10, 1 );\r\n\t}\r\n\r\n\t/**\r\n\t * Adds a Description Block to the post when a vehicle is opened in the\r\n\t * block editor.\r\n\t *\r\n\t * @param  WP_Post $post The post loaded into the block editor.\r\n\t * @return void\r\n\t */\r\n\tpublic function create_block_description( $post ) {\r\n\t\tglobal $pagenow;\r\n\t\t// Is the user adding or editing a vehicle?\r\n\t\tif ( ! is_admin()\r\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\r\n\t\t\t|| ( 'post-new.php' !== $pagenow \u0026\u0026 'post.php' !== $pagenow ) ) {\r\n\t\t\t// No.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Does the post content contain a Description block?\r\n\t\t$blocks = parse_blocks( $post-\u003epost_content );\r\n\t\tforeach ( $blocks as $block ) {\r\n\t\t\t// Is this a Description block?\r\n\t\t\tif ( ! empty( $block['blockName'] ) \u0026\u0026 'inventory-presser/description' === $block['blockName'] ) {\r\n\t\t\t\t// Yes. The post already has a Description block.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 74
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/class-blocks.php"
      },
      "score": 0.2824799120426178
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'model' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Model', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'model' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'model']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'model' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'Model', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'model' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'model']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'model' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Model', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'model' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'model']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/model/edit.js"
      },
      "score": 0.27365121245384216
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Bar\n *\n * Adds vehicles to the Admin Bar.\n *\n * @since      14.10.0\n * @package    inventory-presser\n * @subpackage inventory-presser/includes/admin\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\n */\nclass Inventory_Presser_Admin_Bar {\n\n\t/**\n\t * Adds a Vehicle button to the Admin Bar\n\t *\n\t * @param WP_Admin_Bar $admin_bar The WP_Admin_Bar object.\n\t * @return void\n\t */\n\tpublic function add_vehicles_to_admin_bar( $admin_bar ) {\n\t\t// Do not add an admin bar item if we are looking at the dashboard.\n\t\t// Only show this item to users who can edit posts.\n\t\tif ( is_admin() || ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$admin_bar-\u003eadd_node(\n\t\t\tarray(\n\t\t\t\t'id'     =\u003e 'wp-admin-bar-vehicles',\n\t\t\t\t'title'  =\u003e __( 'Vehicles', 'inventory-presser' ),\n\t\t\t\t'href'   =\u003e admin_url( 'edit.php?post_type=' . INVP::POST_TYPE ),\n\t\t\t\t'parent' =\u003e 'site-name',\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Adds hooks\n\t *\n\t * @return void\n\t */\n\tpublic function add_hooks() {\n\t\t// Add a link to the main menu of the Admin bar.\n\t\tadd_action( 'admin_bar_menu', array( $this, 'add_vehicles_to_admin_bar' ), 100, 1 );\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Admin_Bar"
          },
          {
            "lineNumber": 6,
            "text": " *"
          },
          {
            "lineNumber": 7,
            "text": " * Adds vehicles to the Admin Bar."
          },
          {
            "lineNumber": 8,
            "text": " *"
          },
          {
            "lineNumber": 9,
            "text": " * @since      14.10.0"
          },
          {
            "lineNumber": 10,
            "text": " * @package    inventory-presser"
          },
          {
            "lineNumber": 11,
            "text": " * @subpackage inventory-presser/includes/admin"
          },
          {
            "lineNumber": 12,
            "text": " * @author     Corey Salzano \u003ccorey@friday.systems\u003e"
          },
          {
            "lineNumber": 13,
            "text": " */"
          },
          {
            "lineNumber": 14,
            "text": "class Inventory_Presser_Admin_Bar {"
          },
          {
            "lineNumber": 15
          },
          {
            "lineNumber": 16,
            "text": "\t/**"
          },
          {
            "lineNumber": 17,
            "text": "\t * Adds a Vehicle button to the Admin Bar"
          },
          {
            "lineNumber": 18,
            "text": "\t *"
          },
          {
            "lineNumber": 19,
            "text": "\t * @param WP_Admin_Bar $admin_bar The WP_Admin_Bar object."
          },
          {
            "lineNumber": 20,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 21,
            "text": "\t */"
          },
          {
            "lineNumber": 22,
            "text": "\tpublic function add_vehicles_to_admin_bar( $admin_bar ) {"
          },
          {
            "lineNumber": 23,
            "text": "\t\t// Do not add an admin bar item if we are looking at the dashboard."
          },
          {
            "lineNumber": 24,
            "text": "\t\t// Only show this item to users who can edit posts."
          },
          {
            "lineNumber": 25,
            "text": "\t\tif ( is_admin() || ! current_user_can( 'edit_posts' ) ) {"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\treturn;"
          },
          {
            "lineNumber": 27,
            "text": "\t\t}"
          },
          {
            "lineNumber": 28
          },
          {
            "lineNumber": 29,
            "text": "\t\t$admin_bar-\u003eadd_node("
          },
          {
            "lineNumber": 30,
            "text": "\t\t\tarray("
          },
          {
            "lineNumber": 31,
            "text": "\t\t\t\t'id'     =\u003e 'wp-admin-bar-vehicles',"
          },
          {
            "lineNumber": 32,
            "text": "\t\t\t\t'title'  =\u003e __( 'Vehicles', 'inventory-presser' ),"
          },
          {
            "lineNumber": 33,
            "text": "\t\t\t\t'href'   =\u003e admin_url( 'edit.php?post_type=' . INVP::POST_TYPE ),"
          },
          {
            "lineNumber": 34,
            "text": "\t\t\t\t'parent' =\u003e 'site-name',"
          },
          {
            "lineNumber": 35,
            "text": "\t\t\t)"
          },
          {
            "lineNumber": 36,
            "text": "\t\t);"
          },
          {
            "lineNumber": 37,
            "text": "\t}"
          },
          {
            "lineNumber": 38
          },
          {
            "lineNumber": 39,
            "text": "\t/**"
          },
          {
            "lineNumber": 40,
            "text": "\t * Adds hooks"
          },
          {
            "lineNumber": 41,
            "text": "\t *"
          },
          {
            "lineNumber": 42,
            "text": "\t * @return void"
          },
          {
            "lineNumber": 43,
            "text": "\t */"
          },
          {
            "lineNumber": 44,
            "text": "\tpublic function add_hooks() {"
          },
          {
            "lineNumber": 45,
            "text": "\t\t// Add a link to the main menu of the Admin bar."
          },
          {
            "lineNumber": 46,
            "text": "\t\tadd_action( 'admin_bar_menu', array( $this, 'add_vehicles_to_admin_bar' ), 100, 1 );"
          },
          {
            "lineNumber": 47,
            "text": "\t}"
          },
          {
            "lineNumber": 48,
            "text": "}"
          }
        ],
        "originalContents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Admin_Bar\n *\n * Adds vehicles to the Admin Bar.\n *\n * @since      14.10.0\n * @package    inventory-presser\n * @subpackage inventory-presser/includes/admin\n * @author     Corey Salzano \u003ccorey@friday.systems\u003e\n */\nclass Inventory_Presser_Admin_Bar {\n\n\t/**\n\t * Adds a Vehicle button to the Admin Bar\n\t *\n\t * @param WP_Admin_Bar $admin_bar The WP_Admin_Bar object.\n\t * @return void\n\t */\n\tpublic function add_vehicles_to_admin_bar( $admin_bar ) {\n\t\t// Do not add an admin bar item if we are looking at the dashboard.\n\t\t// Only show this item to users who can edit posts.\n\t\tif ( is_admin() || ! current_user_can( 'edit_posts' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$admin_bar-\u003eadd_node(\n\t\t\tarray(\n\t\t\t\t'id'     =\u003e 'wp-admin-bar-vehicles',\n\t\t\t\t'title'  =\u003e __( 'Vehicles', 'inventory-presser' ),\n\t\t\t\t'href'   =\u003e admin_url( 'edit.php?post_type=' . INVP::POST_TYPE ),\n\t\t\t\t'parent' =\u003e 'site-name',\n\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Adds hooks\n\t *\n\t * @return void\n\t */\n\tpublic function add_hooks() {\n\t\t// Add a link to the main menu of the Admin bar.\n\t\tadd_action( 'admin_bar_menu', array( $this, 'add_vehicles_to_admin_bar' ), 100, 1 );\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 48
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/admin/class-admin-bar.php"
      },
      "score": 0.2730391025543213
    },
    {
      "codeBlock": {
        "contents": "\n\r\n\r\n\t...\n\r\n\r\n\t// Boolean fields are checkboxes.\r\n\tvar MetaBlockCheckboxField = compose(\r\n\t\twithDispatch(\r\n\t\t\tfunction( dispatch, props ) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tsetMetaFieldValue: function( value ) {\r\n\t\t\t\t\t\tdispatch( 'core/editor' ).editPost(\r\n\t\t\t\t\t\t\t{ meta: { [ props.fieldName ]: value } }\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t),\r\n\t\twithSelect(\r\n\t\t\tfunction( select, props ) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tmetaFieldValue: select( 'core/editor' )\r\n\t\t\t\t\t .getEditedPostAttribute( 'meta' )\r\n\t\t\t\t\t [ props.fieldName ],\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t)\r\n\t)(\r\n\t\tfunction( props ) {\r\n\t\t\treturn el(\r\n\t\t\t\tCheckbox,\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: getLabel( props.fieldName ),\r\n\t\t\t\t\tchecked: props.metaFieldValue,\r\n\t\t\t\t\tonChange: function( value ) {\r\n\t\t\t\t\t\tprops.setMetaFieldValue( value );\r\n\t\t\t\t\t},\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n\r\n\tregisterPlugin(\r\n\t\t'invp-plugin-sidebar',",
        "detailedLines": [
          {
            "lineNumber": 240,
            "text": "MetaBlockFieldSelect = "
          },
          {
            "lineNumber": 263
          },
          {
            "lineNumber": 270,
            "text": "\r"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\t\t},\r"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 273,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 274,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 275,
            "text": "\t);\r"
          },
          {
            "lineNumber": 276,
            "text": "\r"
          },
          {
            "lineNumber": 277,
            "text": "\t// Boolean fields are checkboxes.\r"
          },
          {
            "lineNumber": 278,
            "text": "\tvar MetaBlockCheckboxField = compose(\r"
          },
          {
            "lineNumber": 279,
            "text": "\t\twithDispatch(\r"
          },
          {
            "lineNumber": 280,
            "text": "\t\t\tfunction( dispatch, props ) {\r"
          },
          {
            "lineNumber": 281,
            "text": "\t\t\t\treturn {\r"
          },
          {
            "lineNumber": 282,
            "text": "\t\t\t\t\tsetMetaFieldValue: function( value ) {\r"
          },
          {
            "lineNumber": 283,
            "text": "\t\t\t\t\t\tdispatch( 'core/editor' ).editPost(\r"
          },
          {
            "lineNumber": 284,
            "text": "\t\t\t\t\t\t\t{ meta: { [ props.fieldName ]: value } }\r"
          },
          {
            "lineNumber": 285,
            "text": "\t\t\t\t\t\t);\r"
          },
          {
            "lineNumber": 286,
            "text": "\t\t\t\t\t}\r"
          },
          {
            "lineNumber": 287,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 288,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 289,
            "text": "\t\t),\r"
          },
          {
            "lineNumber": 290,
            "text": "\t\twithSelect(\r"
          },
          {
            "lineNumber": 291,
            "text": "\t\t\tfunction( select, props ) {\r"
          },
          {
            "lineNumber": 292,
            "text": "\t\t\t\treturn {\r"
          },
          {
            "lineNumber": 293,
            "text": "\t\t\t\t\tmetaFieldValue: select( 'core/editor' )\r"
          },
          {
            "lineNumber": 294,
            "text": "\t\t\t\t\t .getEditedPostAttribute( 'meta' )\r"
          },
          {
            "lineNumber": 295,
            "text": "\t\t\t\t\t [ props.fieldName ],\r"
          },
          {
            "lineNumber": 296,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 297,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 298,
            "text": "\t\t)\r"
          },
          {
            "lineNumber": 299,
            "text": "\t)(\r"
          },
          {
            "lineNumber": 300,
            "text": "\t\tfunction( props ) {\r"
          },
          {
            "lineNumber": 301,
            "text": "\t\t\treturn el(\r"
          },
          {
            "lineNumber": 302,
            "text": "\t\t\t\tCheckbox,\r"
          },
          {
            "lineNumber": 303,
            "text": "\t\t\t\t{\r"
          },
          {
            "lineNumber": 304,
            "text": "\t\t\t\t\tlabel: getLabel( props.fieldName ),\r"
          },
          {
            "lineNumber": 305,
            "text": "\t\t\t\t\tchecked: props.metaFieldValue,\r"
          },
          {
            "lineNumber": 306,
            "text": "\t\t\t\t\tonChange: function( value ) {\r"
          },
          {
            "lineNumber": 307,
            "text": "\t\t\t\t\t\tprops.setMetaFieldValue( value );\r"
          },
          {
            "lineNumber": 308,
            "text": "\t\t\t\t\t},\r"
          },
          {
            "lineNumber": 309,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 310,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 311,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 312,
            "text": "\t);\r"
          },
          {
            "lineNumber": 313,
            "text": "\r"
          },
          {
            "lineNumber": 314,
            "text": "\tregisterPlugin(\r"
          },
          {
            "lineNumber": 315,
            "text": "\t\t'invp-plugin-sidebar',\r"
          },
          {
            "lineNumber": 316,
            "text": "\t\t{\r"
          },
          {
            "lineNumber": 317,
            "text": "\t\t\trender: function() {\r"
          },
          {
            "lineNumber": 318,
            "text": "\t\t\t\tvar fields = el"
          }
        ],
        "originalContents": "\r\n\r\n\t// Boolean fields are checkboxes.\r\n\tvar MetaBlockCheckboxField = compose(\r\n\t\twithDispatch(\r\n\t\t\tfunction( dispatch, props ) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tsetMetaFieldValue: function( value ) {\r\n\t\t\t\t\t\tdispatch( 'core/editor' ).editPost(\r\n\t\t\t\t\t\t\t{ meta: { [ props.fieldName ]: value } }\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t),\r\n\t\twithSelect(\r\n\t\t\tfunction( select, props ) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tmetaFieldValue: select( 'core/editor' )\r\n\t\t\t\t\t .getEditedPostAttribute( 'meta' )\r\n\t\t\t\t\t [ props.fieldName ],\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t)\r\n\t)(\r\n\t\tfunction( props ) {\r\n\t\t\treturn el(\r\n\t\t\t\tCheckbox,\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: getLabel( props.fieldName ),\r\n\t\t\t\t\tchecked: props.metaFieldValue,\r\n\t\t\t\t\tonChange: function( value ) {\r\n\t\t\t\t\t\tprops.setMetaFieldValue( value );\r\n\t\t\t\t\t},\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n\r\n\tregisterPlugin(\r\n\t\t'invp-plugin-sidebar',",
        "range": {
          "endPosition": {
            "line": 584
          },
          "startPosition": {
            "line": 56
          }
        },
        "relativeWorkspacePath": "js/editor-sidebar.js"
      },
      "score": 0.2729775011539459
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * This file name is no longer accurate. Contains JavaScript to customize the\r\n * Block Editor beyond just this plugin's editor sidebar.\r\n */\r\n\r\n/**\r\n * Hide taxonomy meta boxes in the Block Editor. Users can customize which\r\n * taxonomies are active and shown at Vehicles \u003e Taxonomies.\r\n */\r\nwp.api.loadPromise.done( function() {\r\n\tvar post = new wp.api.models.Inventory( { id: wp.media.view.settings.post.id } );\r\n\tpost.fetch().then( ( post ) =\u003e {\r\n\t\tvar inventoryTypes = new wp.api.collections.Inventory_type();\r\n\t\tinventoryTypes.fetch().then( ( types ) =\u003e {\r\n\t\t\ttypes.forEach( ( type ) =\u003e {\r\n\t\t\t\tif ( -1 !== post.inventory_type.indexOf( type.id ) ) {\r\n\t\t\t\t\tinvp_block_editor_hide_taxonomies( type.slug );\r\n\t\t\t\t}\r\n\t\t\t} );\r\n\t\t} );\r\n\t} );\r\n} );",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * This file name is no longer accurate. Contains JavaScript to customize the\r"
          },
          {
            "lineNumber": 3,
            "text": " * Block Editor beyond just this plugin's editor sidebar.\r"
          },
          {
            "lineNumber": 4,
            "text": " */\r"
          },
          {
            "lineNumber": 5,
            "text": "\r"
          },
          {
            "lineNumber": 6,
            "text": "/**\r"
          },
          {
            "lineNumber": 7,
            "text": " * Hide taxonomy meta boxes in the Block Editor. Users can customize which\r"
          },
          {
            "lineNumber": 8,
            "text": " * taxonomies are active and shown at Vehicles \u003e Taxonomies.\r"
          },
          {
            "lineNumber": 9,
            "text": " */\r"
          },
          {
            "lineNumber": 10,
            "text": "wp.api.loadPromise.done( function() {\r"
          },
          {
            "lineNumber": 11,
            "text": "\tvar post = new wp.api.models.Inventory( { id: wp.media.view.settings.post.id } );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tpost.fetch().then( ( post ) =\u003e {\r"
          },
          {
            "lineNumber": 13,
            "text": "\t\tvar inventoryTypes = new wp.api.collections.Inventory_type();\r"
          },
          {
            "lineNumber": 14,
            "text": "\t\tinventoryTypes.fetch().then( ( types ) =\u003e {\r"
          },
          {
            "lineNumber": 15,
            "text": "\t\t\ttypes.forEach( ( type ) =\u003e {\r"
          },
          {
            "lineNumber": 16,
            "text": "\t\t\t\tif ( -1 !== post.inventory_type.indexOf( type.id ) ) {\r"
          },
          {
            "lineNumber": 17,
            "text": "\t\t\t\t\tinvp_block_editor_hide_taxonomies( type.slug );\r"
          },
          {
            "lineNumber": 18,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t} );\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t} );\r"
          },
          {
            "lineNumber": 21,
            "text": "\t} );\r"
          },
          {
            "lineNumber": 22,
            "text": "} );\r"
          },
          {
            "isSignature": true,
            "lineNumber": 23,
            "text": "function invp_block_editor_hide_taxonomies( typeSlug ) {\r"
          },
          {
            "lineNumber": 24,
            "text": "\tfor ( var taxonomy"
          },
          {
            "isSignature": true,
            "lineNumber": 38,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * This file name is no longer accurate. Contains JavaScript to customize the\r\n * Block Editor beyond just this plugin's editor sidebar.\r\n */\r\n\r\n/**\r\n * Hide taxonomy meta boxes in the Block Editor. Users can customize which\r\n * taxonomies are active and shown at Vehicles \u003e Taxonomies.\r\n */\r\nwp.api.loadPromise.done( function() {\r\n\tvar post = new wp.api.models.Inventory( { id: wp.media.view.settings.post.id } );\r\n\tpost.fetch().then( ( post ) =\u003e {\r\n\t\tvar inventoryTypes = new wp.api.collections.Inventory_type();\r\n\t\tinventoryTypes.fetch().then( ( types ) =\u003e {\r\n\t\t\ttypes.forEach( ( type ) =\u003e {\r\n\t\t\t\tif ( -1 !== post.inventory_type.indexOf( type.id ) ) {\r\n\t\t\t\t\tinvp_block_editor_hide_taxonomies( type.slug );\r\n\t\t\t\t}\r\n\t\t\t} );\r\n\t\t} );\r\n\t} );\r\n} );",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 37
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "js/editor-sidebar.js"
      },
      "score": 0.27102169394493103
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to embed a Google map pointed at one of\r\n\t\t\t * the addresses in our location taxonomy.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r\n\r\n\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r\n\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Sanitizes every member of an array at every level with\r\n\t\t * sanitize_text_field()\r\n\t\t *\r\n\t\t * @param  array $arr\r\n\t\t * @return array\r\n\t\t */\r\n\t\tprotected function sanitize_array( $arr ) {\r\n\t\t\tforeach ( $arr as $key =\u003e $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Saves vehicle attributes into their corresponding post meta fields when\r\n\t\t * the Save or Update button is clicked in the editor.\r\n\t\t *\r\n\t\t * @param  int     $post_id\r\n\t\t * @param  WP_Post $post\r\n\t\t * @param  bool    $is_update\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r\n\t\t\t/**\r\n\t\t\t * Do not continue if the post is being moved to the trash or if this is\r\n\t\t\t * an auto-draft.\r\n\t\t\t */\r\n\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Abort if autosave or AJAX/quick edit.\r\n\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r\n\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r\n\t\t\t) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1769,
            "text": "register_widget( 'Inventory_Presser_Fuel_Economy_Widget' );\r"
          },
          {
            "lineNumber": 1770,
            "text": "\r"
          },
          {
            "lineNumber": 1771,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1772,
            "text": "\t\t\t * Make a widget available to embed a Google map pointed at one of\r"
          },
          {
            "lineNumber": 1773,
            "text": "\t\t\t * the addresses in our location taxonomy.\r"
          },
          {
            "lineNumber": 1774,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1775,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r"
          },
          {
            "lineNumber": 1776,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r"
          },
          {
            "lineNumber": 1777,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r"
          },
          {
            "lineNumber": 1778,
            "text": "\r"
          },
          {
            "lineNumber": 1779,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r"
          },
          {
            "lineNumber": 1780,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r"
          },
          {
            "lineNumber": 1781,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r"
          },
          {
            "lineNumber": 1782,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r"
          },
          {
            "lineNumber": 1783,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r"
          },
          {
            "lineNumber": 1784,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r"
          },
          {
            "lineNumber": 1785,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r"
          },
          {
            "lineNumber": 1786,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r"
          },
          {
            "lineNumber": 1787,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1788,
            "text": "\r"
          },
          {
            "lineNumber": 1789,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1790,
            "text": "\t\t * Sanitizes every member of an array at every level with\r"
          },
          {
            "lineNumber": 1791,
            "text": "\t\t * sanitize_text_field()\r"
          },
          {
            "lineNumber": 1792,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1793,
            "text": "\t\t * @param  array $arr\r"
          },
          {
            "lineNumber": 1794,
            "text": "\t\t * @return array\r"
          },
          {
            "lineNumber": 1795,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1796,
            "text": "\t\tprotected function sanitize_array( $arr ) {\r"
          },
          {
            "lineNumber": 1797,
            "text": "\t\t\tforeach ( $arr as $key =\u003e $value ) {\r"
          },
          {
            "lineNumber": 1798,
            "text": "\t\t\t\tif ( is_array( $value ) ) {\r"
          },
          {
            "lineNumber": 1799,
            "text": "\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r"
          },
          {
            "lineNumber": 1800,
            "text": "\t\t\t\t} else {\r"
          },
          {
            "lineNumber": 1801,
            "text": "\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r"
          },
          {
            "lineNumber": 1802,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 1803,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1804,
            "text": "\t\t\treturn $arr;\r"
          },
          {
            "lineNumber": 1805,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1806,
            "text": "\r"
          },
          {
            "lineNumber": 1807,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1808,
            "text": "\t\t * Saves vehicle attributes into their corresponding post meta fields when\r"
          },
          {
            "lineNumber": 1809,
            "text": "\t\t * the Save or Update button is clicked in the editor.\r"
          },
          {
            "lineNumber": 1810,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1811,
            "text": "\t\t * @param  int     $post_id\r"
          },
          {
            "lineNumber": 1812,
            "text": "\t\t * @param  WP_Post $post\r"
          },
          {
            "lineNumber": 1813,
            "text": "\t\t * @param  bool    $is_update\r"
          },
          {
            "lineNumber": 1814,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 1815,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1816,
            "text": "\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r"
          },
          {
            "lineNumber": 1817,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1818,
            "text": "\t\t\t * Do not continue if the post is being moved to the trash or if this is\r"
          },
          {
            "lineNumber": 1819,
            "text": "\t\t\t * an auto-draft.\r"
          },
          {
            "lineNumber": 1820,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1821,
            "text": "\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r"
          },
          {
            "lineNumber": 1822,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1823,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1824,
            "text": "\r"
          },
          {
            "lineNumber": 1825,
            "text": "\t\t\t// Abort if autosave or AJAX/quick edit.\r"
          },
          {
            "lineNumber": 1826,
            "text": "\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r"
          },
          {
            "lineNumber": 1827,
            "text": "\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r"
          },
          {
            "lineNumber": 1828,
            "text": "\t\t\t) {\r"
          },
          {
            "lineNumber": 1829,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1830,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1831,
            "text": "\r"
          },
          {
            "lineNumber": 1832,
            "text": "\t\t\t// is this a vehicle?\r"
          },
          {
            "lineNumber": 1833,
            "text": "\t\t\tif ( ! empty( $_POST['post_type'] ) \u0026\u0026 INVP::POST_TYPE !== $_POST['post_type'] ) {\r"
          },
          {
            "lineNumber": 1834,
            "text": "\t\t\t\t"
          }
        ],
        "originalContents": "\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to embed a Google map pointed at one of\r\n\t\t\t * the addresses in our location taxonomy.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Google_Maps_Widget_V3' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Map_Widget' );\r\n\r\n\t\t\tregister_widget( 'Inventory_Presser_Carfax_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Grid' );\r\n\t\t\tregister_widget( 'Inventory_Presser_KBB_Widget' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Address' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Hours' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Location_Phones' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Slider' );\r\n\t\t\tregister_widget( 'Inventory_Presser_Maximum_Price_Filter' );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Sanitizes every member of an array at every level with\r\n\t\t * sanitize_text_field()\r\n\t\t *\r\n\t\t * @param  array $arr\r\n\t\t * @return array\r\n\t\t */\r\n\t\tprotected function sanitize_array( $arr ) {\r\n\t\t\tforeach ( $arr as $key =\u003e $value ) {\r\n\t\t\t\tif ( is_array( $value ) ) {\r\n\t\t\t\t\t$arr[ $key ] = $this-\u003esanitize_array( $value );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr[ $key ] = sanitize_text_field( $value );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $arr;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Saves vehicle attributes into their corresponding post meta fields when\r\n\t\t * the Save or Update button is clicked in the editor.\r\n\t\t *\r\n\t\t * @param  int     $post_id\r\n\t\t * @param  WP_Post $post\r\n\t\t * @param  bool    $is_update\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function save_vehicle_post_meta( $post_id, $post, $is_update ) {\r\n\t\t\t/**\r\n\t\t\t * Do not continue if the post is being moved to the trash or if this is\r\n\t\t\t * an auto-draft.\r\n\t\t\t */\r\n\t\t\tif ( in_array( $post-\u003epost_status, array( 'trash', 'auto-draft' ), true ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Abort if autosave or AJAX/quick edit.\r\n\t\t\tif ( ( defined( 'DOING_AUTOSAVE' ) \u0026\u0026 DOING_AUTOSAVE )\r\n\t\t\t\t|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r\n\t\t\t) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "column": 4,
            "line": 1833
          },
          "startPosition": {
            "column": 3,
            "line": 1768
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.26963603496551514
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'stock_number' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Stock Number', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'stock_number' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'stock_number']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'stock_number' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'Stock Number', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'stock_number' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'stock_number']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'stock_number' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Stock Number', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'stock_number' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'stock_number']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/stock-number/edit.js"
      },
      "score": 0.2685616910457611
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'vin' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'VIN', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'vin' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'vin']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'vin' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'VIN', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'vin' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'vin']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'vin' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'VIN', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'vin' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'vin']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/vin/edit.js"
      },
      "score": 0.26849889755249023
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'body_style' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Body Style', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'body_style' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'body_style']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'body_style' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'Body Style', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'body_style' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'body_style']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'body_style' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Body Style', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'body_style' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'body_style']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/body-style/edit.js"
      },
      "score": 0.26804161071777344
    },
    {
      "codeBlock": {
        "contents": "public function remove_post_type_block_editor( $post_types ) {\n\t\t// Is this the block editor creating a new vehicle?\n\t\tglobal $pagenow;\n\t\tif ( ! is_admin()\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\n\t\t\t|| 'post-new.php' !== $pagenow ) {\n\t\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Is our post type managed by the Divi Builder?\n\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );\n\t\tif ( false === $index ) {\n\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Yes. Remove it from the list of post types to prevent the Divi nag.\n\t\tunset( $post_types[ $index ] );\n\t\treturn array_values( $post_types );\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 126,
            "text": "\t * @return string[]"
          },
          {
            "lineNumber": 127,
            "text": "\t */"
          },
          {
            "lineNumber": 128,
            "text": "\tpublic function remove_post_type_block_editor( $post_types ) {"
          },
          {
            "lineNumber": 129,
            "text": "\t\t// Is this the block editor creating a new vehicle?"
          },
          {
            "lineNumber": 130,
            "text": "\t\tglobal $pagenow;"
          },
          {
            "lineNumber": 131,
            "text": "\t\tif ( ! is_admin()"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t|| get_post_type() !== INVP::POST_TYPE"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t|| 'post-new.php' !== $pagenow ) {"
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 135,
            "text": "\t\t\treturn $post_types;"
          },
          {
            "lineNumber": 136,
            "text": "\t\t}"
          },
          {
            "lineNumber": 137,
            "text": "\t\t// Is our post type managed by the Divi Builder?"
          },
          {
            "lineNumber": 138,
            "text": "\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );"
          },
          {
            "lineNumber": 139,
            "text": "\t\tif ( false === $index ) {"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t// No."
          },
          {
            "lineNumber": 141,
            "text": "\t\t\treturn $post_types;"
          },
          {
            "lineNumber": 142,
            "text": "\t\t}"
          },
          {
            "lineNumber": 143,
            "text": "\t\t// Yes. Remove it from the list of post types to prevent the Divi nag."
          },
          {
            "lineNumber": 144,
            "text": "\t\tunset( $post_types[ $index ] );"
          },
          {
            "lineNumber": 145,
            "text": "\t\treturn array_values( $post_types );"
          },
          {
            "lineNumber": 146,
            "text": "\t}"
          },
          {
            "lineNumber": 147,
            "text": "}"
          }
        ],
        "originalContents": "public function remove_post_type_block_editor( $post_types ) {\n\t\t// Is this the block editor creating a new vehicle?\n\t\tglobal $pagenow;\n\t\tif ( ! is_admin()\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\n\t\t\t|| 'post-new.php' !== $pagenow ) {\n\t\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Is our post type managed by the Divi Builder?\n\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );\n\t\tif ( false === $index ) {\n\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Yes. Remove it from the list of post types to prevent the Divi nag.\n\t\tunset( $post_types[ $index ] );\n\t\treturn array_values( $post_types );\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 147
          },
          "startPosition": {
            "line": 125
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-divi.php"
      },
      "score": 0.2658182382583618
    },
    {
      "codeBlock": {
        "contents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'beam' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Beam', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'beam' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'beam']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "/**\r"
          },
          {
            "lineNumber": 2,
            "text": " * WordPress dependencies\r"
          },
          {
            "lineNumber": 3,
            "text": " */\r"
          },
          {
            "lineNumber": 4,
            "text": "import { __ } from '@wordpress/i18n';\r"
          },
          {
            "lineNumber": 5,
            "text": "import { TextControl } from '@wordpress/components';\r"
          },
          {
            "lineNumber": 6,
            "text": "import { useEntityProp } from '@wordpress/core-data';\r"
          },
          {
            "lineNumber": 7,
            "text": "import { useBlockProps } from '@wordpress/block-editor';\r"
          },
          {
            "lineNumber": 8,
            "text": "\r"
          },
          {
            "isSignature": true,
            "lineNumber": 9,
            "text": "export default function Edit( { isSelected, context } ) {\r"
          },
          {
            "lineNumber": 10,
            "text": "\tconst { postType } = context;\r"
          },
          {
            "lineNumber": 11,
            "text": "\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r"
          },
          {
            "lineNumber": 12,
            "text": "\tconst blockProps = useBlockProps();\r"
          },
          {
            "lineNumber": 13,
            "text": "\r"
          },
          {
            "lineNumber": 14,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 15,
            "text": "\t * Use isSelected to render the lost focus output that mimics the front-end\r"
          },
          {
            "lineNumber": 16,
            "text": "\t *\r"
          },
          {
            "lineNumber": 17,
            "text": "\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r"
          },
          {
            "lineNumber": 18,
            "text": "\t */\r"
          },
          {
            "lineNumber": 19,
            "text": "\tif ( ! isSelected ) {\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t// Do not show the input field when the block is not selected.\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'beam' ] } \u003c/div\u003e );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t}\r"
          },
          {
            "lineNumber": 23,
            "text": "\r"
          },
          {
            "lineNumber": 24,
            "text": "\treturn (\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t\u003cdiv { ...blockProps }\u003e\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\u003cTextControl\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\tlabel    = { __( 'Beam', 'inventory-presser' ) }\r"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'beam' ] }\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'beam']: newValue } )}\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t/\u003e\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\u003c/div\u003e\r"
          },
          {
            "lineNumber": 32,
            "text": "\t);\r"
          },
          {
            "isSignature": true,
            "lineNumber": 33,
            "text": "}"
          }
        ],
        "originalContents": "/**\r\n * WordPress dependencies\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\nimport { TextControl } from '@wordpress/components';\r\nimport { useEntityProp } from '@wordpress/core-data';\r\nimport { useBlockProps } from '@wordpress/block-editor';\r\n\r\nexport default function Edit( { isSelected, context } ) {\r\n\tconst { postType } = context;\r\n\tconst [ meta, setMeta ] = useEntityProp( 'postType', postType, 'meta' );\r\n\tconst blockProps = useBlockProps();\r\n\r\n\t/**\r\n\t * Use isSelected to render the lost focus output that mimics the front-end\r\n\t *\r\n\t * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#isselected\r\n\t */\r\n\tif ( ! isSelected ) {\r\n\t\t// Do not show the input field when the block is not selected.\r\n\t\treturn ( \u003cdiv { ...blockProps }\u003e { meta[ invp_blocks.meta_prefix + 'beam' ] } \u003c/div\u003e );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\u003cdiv { ...blockProps }\u003e\r\n\t\t\t\u003cTextControl\r\n\t\t\t\tlabel    = { __( 'Beam', 'inventory-presser' ) }\r\n\t\t\t\tvalue    = { meta[ invp_blocks.meta_prefix + 'beam' ] }\r\n\t\t\t\tonChange = {(newValue) =\u003e setMeta( { ...meta, [invp_blocks.meta_prefix + 'beam']: newValue } )}\r\n\t\t\t/\u003e\r\n\t\t\u003c/div\u003e\r\n\t);\r\n}",
        "range": {
          "endPosition": {
            "column": 1,
            "line": 32
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "src/blocks/beam/edit.js"
      },
      "score": 0.2657959461212158
    }
  ]
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

The issue: `enqueue_block_assets` runs on all block editor pages, including `widgets.php`. The current check may not prevent enqueuing there, and the script tries to register a Gutenberg plugin that shouldn't run on the widgets page.

Adding a check to only enqueue on post editor pages:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Updating the method to only enqueue on post editor pages, not on `widgets.php`:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/admin/class-admin-editor-sidebar.php</summary>

**Chunk 1**
Lines added: 6, lines removed: 1

```diff
@@ -32,6 +32,11 @@
  	 */
  	public function sidebar_plugin_script_enqueue() {
+ 		// Are we on a post editor page?
+ 		global $pagenow, $post;
+ 		if ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ), true ) ) {
+ 			return;
+ 		}
+ 
  		// Are we editing a vehicle?
- 		global $post;
  		if ( empty( $post-&gt;post_type ) || INVP::POST_TYPE !== $post-&gt;post_type ) {
  			return;
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking for linting errors:


_**Agent (default)**_

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


Parameters:

```json
{
  "paths": [
    "includes/admin/class-admin-editor-sidebar.php"
  ]
}
```
Result:

```json
{
  "path": "includes/admin/class-admin-editor-sidebar.php"
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

## The Problem

The `invp-plugin-sidebar` script is a Gutenberg editor plugin that registers a sidebar for editing vehicle meta fields. The `enqueue_block_assets` hook runs on all block editor pages, including `widgets.php`. On the widgets page, the script tried to register the plugin, but the required editor context (like `wp-edit-post`) isn't available, causing the error.

## The Fix

Added a check in `sidebar_plugin_script_enqueue()` to only enqueue the script on post editor pages (`post.php` or `post-new.php`), not on `widgets.php` or other admin pages.

The script now:
1. Checks if we're on a post editor page (`post.php` or `post-new.php`)
2. Then checks if we're editing a vehicle post type
3. Only then enqueues the script

This prevents the script from loading on the widgets page, eliminating the error. The sidebar will still work when editing vehicles in the post editor.

Refresh `wp-admin/widgets.php`; the error should be gone.

---

_**User (2025-11-09 00:29:34Z)**_

here's the console errors



JQMIGRATE: Migrate is installed with logging active, version 3.4.1 jquery-migrate.js:104:17

Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools react-dom.js:29905:19

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. node.js:409:1

Store "core/interface" is already registered. data.js:2963:15

XHRGET

https://buyrichsautos.test/wp-json/wp/v2/inventory/0

[HTTP/2 404  394ms]



Uncaught TypeError: can't access property "inventory_presser_type", wp.data.select(...).getEditedPostAttribute(...) is undefined

    render https://buyrichsautos.test/wp-content/plugins/inventory-presser/js/editor-sidebar.js?ver=15.2.4:523

    renderWithHooks https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:15496

    mountIndeterminateComponent https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:20113

    beginWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:21636

    callCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4151

    invokeGuardedCallbackDev https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4200

    invokeGuardedCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4264

    beginWork$1 https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:27500

    performUnitOfWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26606

    workLoopSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26515

    renderRootSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26483

    performConcurrentWorkOnRoot https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:25787

    workLoop https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2653

    flushWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2626

    performWorkUntilDeadline https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2920

    EventHandlerNonNull* https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2958

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:13

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:14

editor-sidebar.js:523:68

Uncaught TypeError: can't access property "inventory_presser_type", wp.data.select(...).getEditedPostAttribute(...) is undefined

    render https://buyrichsautos.test/wp-content/plugins/inventory-presser/js/editor-sidebar.js?ver=15.2.4:523

    renderWithHooks https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:15496

    mountIndeterminateComponent https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:20113

    beginWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:21636

    callCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4151

    invokeGuardedCallbackDev https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4200

    invokeGuardedCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4264

    beginWork$1 https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:27500

    performUnitOfWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26606

    workLoopSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26515

    renderRootSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26483

    recoverFromConcurrentError https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:25899

    performConcurrentWorkOnRoot https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:25799

    workLoop https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2653

    flushWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2626

    performWorkUntilDeadline https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2920

    EventHandlerNonNull* https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2958

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:13

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:14

editor-sidebar.js:523:68

The above error occurred in the <render> component:



render@https://buyrichsautos.test/wp-content/plugins/inventory-presser/js/editor-sidebar.js?ver=15.2.4:523:68

PluginErrorBoundary@https://buyrichsautos.test/wp-includes/js/dist/plugins.js?ver=7313a68349c296697e15:301:5

div

PluginArea@https://buyrichsautos.test/wp-includes/js/dist/plugins.js?ver=7313a68349c296697e15:611:20

BlockRefsProvider@https://buyrichsautos.test/wp-includes/js/dist/block-editor.js?ver=915e7b96a5bc793b8673:28345:27

Provider@https://buyrichsautos.test/wp-includes/js/dist/components.js?ver=2f2a5ecdb5f215b015e6:34283:18

ExperimentalBlockEditorProvider<@https://buyrichsautos.test/wp-includes/js/dist/block-editor.js?ver=915e7b96a5bc793b8673:39147:7

with_registry_provider_withRegistryProvider</<@https://buyrichsautos.test/wp-includes/js/dist/block-editor.js?ver=915e7b96a5bc793b8673:38599:140

SlotFillProvider@https://buyrichsautos.test/wp-includes/js/dist/components.js?ver=2f2a5ecdb5f215b015e6:34138:26

provider_SlotFillProvider@https://buyrichsautos.test/wp-includes/js/dist/components.js?ver=2f2a5ecdb5f215b015e6:34221:35

Provider@https://buyrichsautos.test/wp-includes/js/dist/components.js?ver=2f2a5ecdb5f215b015e6:34283:18

WidgetAreasBlockEditorProvider@https://buyrichsautos.test/wp-includes/js/dist/edit-widgets.js?ver=47b223cb88d85c713a6b:3072:40

div

ErrorBoundary@https://buyrichsautos.test/wp-includes/js/dist/edit-widgets.js?ver=47b223cb88d85c713a6b:2831:5

Layout@https://buyrichsautos.test/wp-includes/js/dist/edit-widgets.js?ver=47b223cb88d85c713a6b:4823:16



React will try to recreate this component tree from scratch using the error boundary you provided, PluginErrorBoundary. react-dom.js:18714:17

GET

https://buyrichsautos.test/favicon.ico

[HTTP/2 404  324ms]



XHROPTIONS

https://buyrichsautos.test/wp-json/wp/v2/settings?_locale=user

[HTTP/2 200  323ms]



XHRGET

https://buyrichsautos.test/wp-json/wp/v2/types?context=view&_locale=user

[HTTP/2 200  377ms]



Source map error: Error: NetworkError when attempting to fetch resource.

Resource URL: https://buyrichsautos.test/wp-includes/js/dist/data.js?ver=2797f012cdb7d180a746

Source Map URL: redux.mjs.map

XHROPTIONS

https://buyrichsautos.test/wp-json/wp/v2/settings?_locale=user

[HTTP/2 200  386ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  498ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  506ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  519ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  604ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/encode?_locale=user

[HTTP/2 200  927ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  1010ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  926ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_hours/encode?_locale=user

[HTTP/2 200  927ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  1376ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  1358ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  1227ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  1888ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  1837ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  1555ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  1376ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_map/encode?_locale=user

[HTTP/2 200  2423ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_google_maps_v3/encode?_locale=user

[HTTP/2 200  2038ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  1865ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  1857ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  2372ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_inventory_grid/encode?_locale=user

[HTTP/2 200  2424ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  2383ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  2886ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  2891ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  2594ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/encode?_locale=user

[HTTP/2 200  2839ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  2868ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_fuel_economy_widget/encode?_locale=user

[HTTP/2 200  3194ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/text/encode?_locale=user

[HTTP/2 200  3186ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  3327ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/search/encode?_locale=user

[HTTP/2 200  2997ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  3544ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  3429ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_map/encode?_locale=user

[HTTP/2 200  3201ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  3630ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_price_filters/encode?_locale=user

[HTTP/2 200  3541ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  3552ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  3844ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  3747ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_hours/encode?_locale=user

[HTTP/2 200  4084ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/encode?_locale=user

[HTTP/2 200  3889ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  3822ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  3831ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  4219ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  4138ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/encode?_locale=user

[HTTP/2 200  4143ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  4144ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  4745ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  4572ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/encode?_locale=user

[HTTP/2 200  4562ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  4512ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  4512ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  4488ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  4970ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_inventory_grid/encode?_locale=user

[HTTP/2 200  4864ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_map/encode?_locale=user

[HTTP/2 200  4824ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_google_maps_v3/encode?_locale=user

[HTTP/2 200  4759ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/encode?_locale=user

[HTTP/2 200  4760ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  5158ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  5127ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  5041ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  4985ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/encode?_locale=user

[HTTP/2 200  5304ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  5388ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/encode?_locale=user

[HTTP/2 200  5658ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/search/encode?_locale=user

[HTTP/2 200  5460ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_map/encode?_locale=user

[HTTP/2 200  5717ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_fuel_economy_widget/encode?_locale=user

[HTTP/2 200  5683ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/text/encode?_locale=user

[HTTP/2 200  5587ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  5911ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  5840ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/encode?_locale=user

[HTTP/2 200  5738ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/encode?_locale=user

[HTTP/2 200  5986ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_price_filters/encode?_locale=user

[HTTP/2 200  5901ms]



XHRGET

https://buyrichsautos.test/wp-json/wp/v2/settings?_locale=user

[HTTP/2 200  5805ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

[HTTP/2 200  5755ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

NS_BINDING_ABORTED



Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc

XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

[HTTP/2 200  5867ms]



Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc

XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

[HTTP/2 200  5713ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

[HTTP/2 200  5660ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

[HTTP/2 200  5517ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_hours/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/render?_locale=user

[HTTP/2 200  5752ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_hours/render?_locale=user

[HTTP/2 200  5829ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

[HTTP/2 200  5833ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

[HTTP/2 200  5537ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_make_list/render?_locale=user

[HTTP/2 200  5488ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

[HTTP/2 200  5683ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

[HTTP/2 200  5756ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

[HTTP/2 200  5664ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

[HTTP/2 200  5437ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

[HTTP/2 200  5424ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

[HTTP/2 200  5691ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_google_maps/render?_locale=user

[HTTP/2 200  5629ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/invp_search_filters/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_inventory_grid/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_inventory_grid/render?_locale=user

[HTTP/2 200  5292ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

[HTTP/2 200  4998ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_address/render?_locale=user

[HTTP/2 200  4838ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

[HTTP/2 200  5053ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

[HTTP/2 200  5013ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

[HTTP/2 200  5202ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/search/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/search/render?_locale=user

[HTTP/2 200  5036ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/text/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/text/render?_locale=user

[HTTP/2 200  4916ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_slick/render?_locale=user

[HTTP/2 200  5147ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

[HTTP/2 200  4964ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_price_filters/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

[HTTP/2 200  4925ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_price_filters/render?_locale=user

[HTTP/2 200  4842ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_phone/render?_locale=user

[HTTP/2 200  4912ms]



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

NS_BINDING_ABORTED



XHRPOST

https://buyrichsautos.test/wp-json/wp/v2/widget-types/_invp_drop_down_search/render?_locale=user

[HTTP/2 200  5118ms]



Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc

Source map error: Error: URL constructor:  is not a valid URL.

Stack in the worker:resolveSourceMapURL@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:56:22

getOriginalURLs@resource://devtools/client/shared/source-map-loader/source-map.js:74:24

workerHandler/</<@resource://devtools/client/shared/worker-utils.js:115:52

workerHandler/<@resource://devtools/client/shared/worker-utils.js:113:13



Resource URL: about:srcdoc

Source Map URL: 

Source map error: Error: URL constructor:  is not a valid URL.

Stack in the worker:resolveSourceMapURL@resource://devtools/client/shared/source-map-loader/utils/fetchSourceMap.js:56:22

getOriginalURLs@resource://devtools/client/shared/source-map-loader/source-map.js:74:24

workerHandler/</<@resource://devtools/client/shared/worker-utils.js:115:52

workerHandler/<@resource://devtools/client/shared/worker-utils.js:113:13



Resource URL: about:srcdoc

Source Map URL: 

Content-Security-Policy warnings 5

XHRGET

https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true

[HTTP/2 200  48ms]



Content-Security-Policy warnings 5

Content-Security-Policy warnings 5

XHRGET

https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true

[HTTP/2 200  53ms]



XHRGET

https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true

[HTTP/2 200  70ms]



JQMIGRATE: Migrate is installed with logging active, version 3.4.1 2 jquery-migrate.js:104:17

JQMIGRATE: Migrate is installed with logging active, version 3.4.1 jquery-migrate.js:104:17



---

_**Agent (default)**_

The script is still loading on `widgets.php` and accessing post attributes that don't exist there. Checking the JavaScript code around the error:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

The script accesses post editor data that doesn't exist on the widgets page. Checking the render function context and adding a guard:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "getEditedPostAttribute|core/editor" in "js/editor-sidebar.js" • 15 matches</summary>

Output mode: content


| File | Content | Line |
|------|------|------|
| `js/editor-sidebar.js` | `wp.data.dispatch( 'core/editor').removeEditorPanel( 'taxonomy-panel-' + taxonomy.replace( '-', '_' ) );` | L27 |
| `js/editor-sidebar.js` | `wp.data.dispatch( 'core/editor').removeEditorPanel( 'taxonomy-panel-' + taxonomy.replace( '-', '_' ) );` | L35 |
| `js/editor-sidebar.js` | `dispatch( 'core/editor' ).editPost(` | L158 |
| `js/editor-sidebar.js` | `metaFieldValue: select( 'core/editor' )` | L168 |
| `js/editor-sidebar.js` | `.getEditedPostAttribute( 'meta' )` | L169 |
| `js/editor-sidebar.js` | `dispatch( 'core/editor' ).editPost(` | L207 |
| `js/editor-sidebar.js` | `metaFieldValue: select( 'core/editor' )` | L217 |
| `js/editor-sidebar.js` | `.getEditedPostAttribute( 'meta' )` | L218 |
| `js/editor-sidebar.js` | `dispatch( 'core/editor' ).editPost(` | L245 |
| `js/editor-sidebar.js` | `metaFieldValue: select( 'core/editor' )` | L255 |
| `js/editor-sidebar.js` | `.getEditedPostAttribute( 'meta' )` | L256 |
| `js/editor-sidebar.js` | `dispatch( 'core/editor' ).editPost(` | L283 |
| `js/editor-sidebar.js` | `metaFieldValue: select( 'core/editor' )` | L293 |
| `js/editor-sidebar.js` | `.getEditedPostAttribute( 'meta' )` | L294 |
| `js/editor-sidebar.js` | `const inventory_presser_type = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ).inventory_presser_type ?? '';` | L523 |


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Adding a guard in the JavaScript to check for a post editor context before accessing post attributes. Reviewing the render function to add the check:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Adding a guard at the start of the render function to check for a post editor context before accessing post attributes:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 7, lines removed: 0

```diff
@@ -316,4 +316,11 @@
  		{
  			render: function() {
+ 				// Check if we're in a post editor context (not widgets editor)
+ 				var editorStore = wp.data.select( 'core/editor' );
+ 				if ( ! editorStore || ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory' ) {
+ 					// Not in post editor or not editing a vehicle, return null
+ 					return null;
+ 				}
+ 
  				var fields = el(
  					wp.element.Fragment,
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 3, lines removed: 2

```diff
@@ -528,6 +528,7 @@
  				);
  				// Is this a boat?
- 				const inventory_presser_type = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ).inventory_presser_type ?? '';
- 				if ( 'boat' === inventory_presser_type.toLowerCase() ) {
+ 				var meta = editorStore.getEditedPostAttribute( 'meta' );
+ 				var inventory_presser_type = ( meta &amp;&amp; meta.inventory_presser_type ) ? meta.inventory_presser_type : '';
+ 				if ( inventory_presser_type &amp;&amp; 'boat' === inventory_presser_type.toLowerCase() ) {
  					// Yes, add the boat fields.
  					fields = el(
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking the top of the file for code that runs immediately and might cause issues:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Adding guards to the top-level code that runs immediately:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 5, lines removed: 0

```diff
@@ -9,4 +9,9 @@
   */
  wp.api.loadPromise.done( function() {
+ 	// Only run in post editor, not widgets editor
+ 	if ( ! wp.media || ! wp.media.view || ! wp.media.view.settings || ! wp.media.view.settings.post || ! wp.media.view.settings.post.id ) {
+ 		return;
+ 	}
+ 
  	var post = new wp.api.models.Inventory( { id: wp.media.view.settings.post.id } );
  	post.fetch().then( ( post ) =&gt; {
```

**Chunk 2**
Lines added: 5, lines removed: 0

```diff
@@ -22,4 +27,9 @@
  } );
  function invp_block_editor_hide_taxonomies( typeSlug ) {
+ 	// Only run if core/editor store exists (post editor context)
+ 	if ( ! wp.data || ! wp.data.dispatch || ! wp.data.dispatch( 'core/editor' ) ) {
+ 		return;
+ 	}
+ 
  	for ( var taxonomy in invp.taxonomies ) {
  		// If the user has disabled this taxonomy, remove its meta box.
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Fixing the store existence check:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 1, lines removed: 1

```diff
@@ -28,5 +28,5 @@
  function invp_block_editor_hide_taxonomies( typeSlug ) {
  	// Only run if core/editor store exists (post editor context)
- 	if ( ! wp.data || ! wp.data.dispatch || ! wp.data.dispatch( 'core/editor' ) ) {
+ 	if ( ! wp.data || ! wp.data.dispatch || ! wp.data.select( 'core/editor' ) ) {
  		return;
  	}
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "paths": [
    "js/editor-sidebar.js"
  ]
}
```
Result:

```json
{
  "path": "js/editor-sidebar.js"
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Verifying the post type constant used in the check:


_**Agent (default)**_

<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "POST_TYPE|inventory" in "includes/admin/class-admin-editor-sidebar.php" • 1 match</summary>

Output mode: content


| File | Content | Line |
|------|------|------|
| `includes/admin/class-admin-editor-sidebar.php` | `if ( empty( $post->post_type ) \|\| INVP::POST_TYPE !== $post->post_type ) \{` | L41 |


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 60
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.3730672001838684
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 399
          },
          "startPosition": {
            "column": 1,
            "line": 362
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.30182963609695435
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1058
          },
          "startPosition": {
            "column": 1,
            "line": 1011
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.2800348401069641
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 65
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/class-rest.php",
        "signatures": {}
      },
      "score": 0.279427707195282
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 41
          },
          "startPosition": {
            "column": 1,
            "line": 1
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-forms-integration.php",
        "signatures": {}
      },
      "score": 0.2735396921634674
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 551
          },
          "startPosition": {
            "column": 1,
            "line": 491
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.2713010311126709
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1164
          },
          "startPosition": {
            "column": 1,
            "line": 1107
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.2691971957683563
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 652
          },
          "startPosition": {
            "column": 1,
            "line": 593
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.268588662147522
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 148
          },
          "startPosition": {
            "column": 2,
            "line": 128
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-divi.php",
        "signatures": {}
      },
      "score": 0.2655237317085266
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 285
          },
          "startPosition": {
            "column": 1,
            "line": 233
          }
        },
        "relativeWorkspacePath": "includes/class-taxonomies.php",
        "signatures": {}
      },
      "score": 0.26270896196365356
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 175
          },
          "startPosition": {
            "column": 1,
            "line": 158
          }
        },
        "relativeWorkspacePath": "includes/class-template-provider.php",
        "signatures": {}
      },
      "score": 0.25409719347953796
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1418
          },
          "startPosition": {
            "column": 1,
            "line": 1368
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.2507534921169281
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1770
          },
          "startPosition": {
            "column": 1,
            "line": 1697
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.24497880041599274
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 1877
          },
          "startPosition": {
            "column": 1,
            "line": 1831
          }
        },
        "relativeWorkspacePath": "inventory-presser.php",
        "signatures": {}
      },
      "score": 0.2444383054971695
    },
    {
      "codeBlock": {
        "range": {
          "endPosition": {
            "column": 1,
            "line": 435
          },
          "startPosition": {
            "column": 2,
            "line": 377
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php",
        "signatures": {}
      },
      "score": 0.24401170015335083
    }
  ],
  "explanation": "",
  "query": "What is the value of INVP::POST_TYPE constant?",
  "repositoryInfo": {
    "orthogonalTransformSeed": 6308982098672407,
    "preferredEmbeddingModel": "EMBEDDING_MODEL_UNSPECIFIED",
    "relativeWorkspacePath": ".",
    "repoName": "5a26c3e1-2367-4e37-aaba-63a54ad0ac26",
    "repoOwner": "auth0|user_01JXZMQ8XHQ8Y96GRWHQJCM038"
  },
  "topK": 15
}
```
Result:

```json
{
  "codeResults": [
    {
      "codeBlock": {
        "contents": "\u003c?php\r\n/**\r\n * @package inventory-presser\r\n */\r\n\r\ndefined( 'ABSPATH' ) || exit;\r\n/**\r\n * INVP\r\n *\r\n * This API class offers static methods that are useful to more than one other\r\n * class in this plugin.\r\n */\r\nclass INVP {\r\n\r\n\tconst LOCATION_MAX_PHONES    = 10; // The maximum number of phones a single address holds.\r\n\tconst LOCATION_MAX_HOURS     = 5; // The maximum number of sets of hours a single address holds.\r\n\tconst POST_TYPE              = 'inventory_vehicle';\r\n\tconst OPTION_NAME            = 'inventory_presser';\r\n\tconst OPTION_PAGE            = 'dealership-options';\r\n\tconst OPTION_PAGE_TAXONOMIES = 'invp-taxonomies';\r\n\r\n\t/**\r\n\t * Returns an array of base colors. A vehicle painted Ruby Red Metallic has\r\n\t * a base color of \"Red\". Base colors allow vehicles to be categorized by\r\n\t * color.\r\n\t *\r\n\t * @return array\r\n\t */\r\n\tpublic static function base_colors() {\r\n\t\treturn apply_filters(\r\n\t\t\t'invp_base_colors',\r\n\t\t\tarray(\r\n\t\t\t\t__( 'Beige', 'inventory-presser' ),\r\n\t\t\t\t__( 'Black', 'inventory-presser' ),\r\n\t\t\t\t__( 'Blue', 'inventory-presser' ),\r\n\t\t\t\t__( 'Brown', 'inventory-presser' ),\r\n\t\t\t\t__( 'Burgundy', 'inventory-presser' ),\r\n\t\t\t\t__( 'Gold', 'inventory-presser' ),\r\n\t\t\t\t__( 'Grey', 'inventory-presser' ),\r\n\t\t\t\t__( 'Green', 'inventory-presser' ),\r\n\t\t\t\t__( 'Ivory', 'inventory-presser' ),\r\n\t\t\t\t__( 'Orange', 'inventory-presser' ),\r\n\t\t\t\t__( 'Purple', 'inventory-presser' ),\r\n\t\t\t\t__( 'Red', 'inventory-presser' ),\r\n\t\t\t\t__( 'Silver', 'inventory-presser' ),\r\n\t\t\t\t__( 'White', 'inventory-presser' ),\r\n\t\t\t\t__( 'Yellow', 'inventory-presser' ),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the currency symbol. Default is a United States dollar sign.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function currency_symbol() {\r\n\t\treturn apply_filters( 'invp_currency_symbol', '$' );\r\n\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "/**\r"
          },
          {
            "lineNumber": 3,
            "text": " * @package inventory-presser\r"
          },
          {
            "lineNumber": 4,
            "text": " */\r"
          },
          {
            "lineNumber": 5,
            "text": "\r"
          },
          {
            "lineNumber": 6,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 7,
            "text": "/**\r"
          },
          {
            "lineNumber": 8,
            "text": " * INVP\r"
          },
          {
            "lineNumber": 9,
            "text": " *\r"
          },
          {
            "lineNumber": 10,
            "text": " * This API class offers static methods that are useful to more than one other\r"
          },
          {
            "lineNumber": 11,
            "text": " * class in this plugin.\r"
          },
          {
            "lineNumber": 12,
            "text": " */\r"
          },
          {
            "lineNumber": 13,
            "text": "class INVP {\r"
          },
          {
            "lineNumber": 14,
            "text": "\r"
          },
          {
            "lineNumber": 15,
            "text": "\tconst LOCATION_MAX_PHONES    = 10; // The maximum number of phones a single address holds.\r"
          },
          {
            "lineNumber": 16,
            "text": "\tconst LOCATION_MAX_HOURS     = 5; // The maximum number of sets of hours a single address holds.\r"
          },
          {
            "lineNumber": 17,
            "text": "\tconst POST_TYPE              = 'inventory_vehicle';\r"
          },
          {
            "lineNumber": 18,
            "text": "\tconst OPTION_NAME            = 'inventory_presser';\r"
          },
          {
            "lineNumber": 19,
            "text": "\tconst OPTION_PAGE            = 'dealership-options';\r"
          },
          {
            "lineNumber": 20,
            "text": "\tconst OPTION_PAGE_TAXONOMIES = 'invp-taxonomies';\r"
          },
          {
            "lineNumber": 21,
            "text": "\r"
          },
          {
            "lineNumber": 22,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 23,
            "text": "\t * Returns an array of base colors. A vehicle painted Ruby Red Metallic has\r"
          },
          {
            "lineNumber": 24,
            "text": "\t * a base color of \"Red\". Base colors allow vehicles to be categorized by\r"
          },
          {
            "lineNumber": 25,
            "text": "\t * color.\r"
          },
          {
            "lineNumber": 26,
            "text": "\t *\r"
          },
          {
            "lineNumber": 27,
            "text": "\t * @return array\r"
          },
          {
            "lineNumber": 28,
            "text": "\t */\r"
          },
          {
            "lineNumber": 29,
            "text": "\tpublic static function base_colors() {\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\treturn apply_filters(\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\t'invp_base_colors',\r"
          },
          {
            "lineNumber": 32,
            "text": "\t\t\tarray(\r"
          },
          {
            "lineNumber": 33,
            "text": "\t\t\t\t__( 'Beige', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 34,
            "text": "\t\t\t\t__( 'Black', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 35,
            "text": "\t\t\t\t__( 'Blue', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 36,
            "text": "\t\t\t\t__( 'Brown', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 37,
            "text": "\t\t\t\t__( 'Burgundy', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 38,
            "text": "\t\t\t\t__( 'Gold', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 39,
            "text": "\t\t\t\t__( 'Grey', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 40,
            "text": "\t\t\t\t__( 'Green', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 41,
            "text": "\t\t\t\t__( 'Ivory', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 42,
            "text": "\t\t\t\t__( 'Orange', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 43,
            "text": "\t\t\t\t__( 'Purple', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 44,
            "text": "\t\t\t\t__( 'Red', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 45,
            "text": "\t\t\t\t__( 'Silver', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 46,
            "text": "\t\t\t\t__( 'White', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\t\t__( 'Yellow', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 48,
            "text": "\t\t\t)\r"
          },
          {
            "lineNumber": 49,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 50,
            "text": "\t}\r"
          },
          {
            "lineNumber": 51,
            "text": "\r"
          },
          {
            "lineNumber": 52,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 53,
            "text": "\t * Returns the currency symbol. Default is a United States dollar sign.\r"
          },
          {
            "lineNumber": 54,
            "text": "\t *\r"
          },
          {
            "lineNumber": 55,
            "text": "\t * @return string\r"
          },
          {
            "lineNumber": 56,
            "text": "\t */\r"
          },
          {
            "lineNumber": 57,
            "text": "\tpublic static function currency_symbol() {\r"
          },
          {
            "lineNumber": 58,
            "text": "\t\treturn apply_filters( 'invp_currency_symbol', '$' );\r"
          },
          {
            "lineNumber": 59,
            "text": "\t}\r"
          },
          {
            "lineNumber": 60,
            "text": "\r"
          },
          {
            "lineNumber": 61,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 62,
            "text": "\t * This function will operate as an uninstall utility. Removes all the\r"
          }
        ],
        "originalContents": "\u003c?php\r\n/**\r\n * @package inventory-presser\r\n */\r\n\r\ndefined( 'ABSPATH' ) || exit;\r\n/**\r\n * INVP\r\n *\r\n * This API class offers static methods that are useful to more than one other\r\n * class in this plugin.\r\n */\r\nclass INVP {\r\n\r\n\tconst LOCATION_MAX_PHONES    = 10; // The maximum number of phones a single address holds.\r\n\tconst LOCATION_MAX_HOURS     = 5; // The maximum number of sets of hours a single address holds.\r\n\tconst POST_TYPE              = 'inventory_vehicle';\r\n\tconst OPTION_NAME            = 'inventory_presser';\r\n\tconst OPTION_PAGE            = 'dealership-options';\r\n\tconst OPTION_PAGE_TAXONOMIES = 'invp-taxonomies';\r\n\r\n\t/**\r\n\t * Returns an array of base colors. A vehicle painted Ruby Red Metallic has\r\n\t * a base color of \"Red\". Base colors allow vehicles to be categorized by\r\n\t * color.\r\n\t *\r\n\t * @return array\r\n\t */\r\n\tpublic static function base_colors() {\r\n\t\treturn apply_filters(\r\n\t\t\t'invp_base_colors',\r\n\t\t\tarray(\r\n\t\t\t\t__( 'Beige', 'inventory-presser' ),\r\n\t\t\t\t__( 'Black', 'inventory-presser' ),\r\n\t\t\t\t__( 'Blue', 'inventory-presser' ),\r\n\t\t\t\t__( 'Brown', 'inventory-presser' ),\r\n\t\t\t\t__( 'Burgundy', 'inventory-presser' ),\r\n\t\t\t\t__( 'Gold', 'inventory-presser' ),\r\n\t\t\t\t__( 'Grey', 'inventory-presser' ),\r\n\t\t\t\t__( 'Green', 'inventory-presser' ),\r\n\t\t\t\t__( 'Ivory', 'inventory-presser' ),\r\n\t\t\t\t__( 'Orange', 'inventory-presser' ),\r\n\t\t\t\t__( 'Purple', 'inventory-presser' ),\r\n\t\t\t\t__( 'Red', 'inventory-presser' ),\r\n\t\t\t\t__( 'Silver', 'inventory-presser' ),\r\n\t\t\t\t__( 'White', 'inventory-presser' ),\r\n\t\t\t\t__( 'Yellow', 'inventory-presser' ),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the currency symbol. Default is a United States dollar sign.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function currency_symbol() {\r\n\t\treturn apply_filters( 'invp_currency_symbol', '$' );\r\n\t}\r\n",
        "range": {
          "endPosition": {
            "line": 62
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.3730672001838684
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t$termlink = $post_type-\u003erewrite['slug'] . $termlink;\r\n\t\t\treturn $termlink;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers the post type that holds vehicles.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function create_post_type() {\r\n\t\t\t// creates a custom post type that will be used by this plugin.\r\n\t\t\tregister_post_type(\r\n\t\t\t\tINVP::POST_TYPE,\r\n\t\t\t\tapply_filters(\r\n\t\t\t\t\t'invp_post_type_args',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'capability_type' =\u003e INVP::POST_TYPE,\r\n\t\t\t\t\t\t'map_meta_cap'    =\u003e true,\r\n\t\t\t\t\t\t'description'     =\u003e __( 'Vehicles for sale', 'inventory-presser' ),\r\n\t\t\t\t\t\t'has_archive'     =\u003e true,\r\n\t\t\t\t\t\t'hierarchical'    =\u003e false,\r\n\t\t\t\t\t\t'labels'          =\u003e array(\r\n\t\t\t\t\t\t\t'name'                  =\u003e _x( 'Vehicles', 'Post type general name', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'singular_name'         =\u003e _x( 'Vehicle', 'Post type singular name', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'menu_name'             =\u003e _x( 'Vehicles', 'Admin Menu text', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'name_admin_bar'        =\u003e _x( 'Vehicle', 'Add New on Toolbar', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'add_new'               =\u003e __( 'Add New', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'add_new_item'          =\u003e __( 'Add New Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'new_item'              =\u003e __( 'New Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'edit_item'             =\u003e __( 'Edit Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'view_item'             =\u003e __( 'View Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'all_items'             =\u003e __( 'All Vehicles', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'search_items'          =\u003e __( 'Search Vehicles', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'parent_item_colon'     =\u003e __( 'Parent Vehicles:', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'not_found'             =\u003e __( 'No vehicles found.', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'not_found_in_trash'    =\u003e __( 'No vehicles found in Trash.', 'inventory-presser' ),\r\n",
        "detailedLines": [
          {
            "lineNumber": 359,
            "text": "\t\t\tif ( empty( $post_type ) ) {\r"
          },
          {
            "lineNumber": 360,
            "text": "\t\t\t\treturn $termlink;\r"
          },
          {
            "lineNumber": 361,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 362,
            "text": "\r"
          },
          {
            "lineNumber": 363,
            "text": "\t\t\t$termlink = $post_type-\u003erewrite['slug'] . $termlink;\r"
          },
          {
            "lineNumber": 364,
            "text": "\t\t\treturn $termlink;\r"
          },
          {
            "lineNumber": 365,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 366,
            "text": "\r"
          },
          {
            "lineNumber": 367,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 368,
            "text": "\t\t * Registers the post type that holds vehicles.\r"
          },
          {
            "lineNumber": 369,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 370,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 371,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 372,
            "text": "\t\tpublic static function create_post_type() {\r"
          },
          {
            "lineNumber": 373,
            "text": "\t\t\t// creates a custom post type that will be used by this plugin.\r"
          },
          {
            "lineNumber": 374,
            "text": "\t\t\tregister_post_type(\r"
          },
          {
            "lineNumber": 375,
            "text": "\t\t\t\tINVP::POST_TYPE,\r"
          },
          {
            "lineNumber": 376,
            "text": "\t\t\t\tapply_filters(\r"
          },
          {
            "lineNumber": 377,
            "text": "\t\t\t\t\t'invp_post_type_args',\r"
          },
          {
            "lineNumber": 378,
            "text": "\t\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 379,
            "text": "\t\t\t\t\t\t'capability_type' =\u003e INVP::POST_TYPE,\r"
          },
          {
            "lineNumber": 380,
            "text": "\t\t\t\t\t\t'map_meta_cap'    =\u003e true,\r"
          },
          {
            "lineNumber": 381,
            "text": "\t\t\t\t\t\t'description'     =\u003e __( 'Vehicles for sale', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 382,
            "text": "\t\t\t\t\t\t'has_archive'     =\u003e true,\r"
          },
          {
            "lineNumber": 383,
            "text": "\t\t\t\t\t\t'hierarchical'    =\u003e false,\r"
          },
          {
            "lineNumber": 384,
            "text": "\t\t\t\t\t\t'labels'          =\u003e array(\r"
          },
          {
            "lineNumber": 385,
            "text": "\t\t\t\t\t\t\t'name'                  =\u003e _x( 'Vehicles', 'Post type general name', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 386,
            "text": "\t\t\t\t\t\t\t'singular_name'         =\u003e _x( 'Vehicle', 'Post type singular name', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 387,
            "text": "\t\t\t\t\t\t\t'menu_name'             =\u003e _x( 'Vehicles', 'Admin Menu text', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 388,
            "text": "\t\t\t\t\t\t\t'name_admin_bar'        =\u003e _x( 'Vehicle', 'Add New on Toolbar', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 389,
            "text": "\t\t\t\t\t\t\t'add_new'               =\u003e __( 'Add New', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 390,
            "text": "\t\t\t\t\t\t\t'add_new_item'          =\u003e __( 'Add New Vehicle', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 391,
            "text": "\t\t\t\t\t\t\t'new_item'              =\u003e __( 'New Vehicle', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 392,
            "text": "\t\t\t\t\t\t\t'edit_item'             =\u003e __( 'Edit Vehicle', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 393,
            "text": "\t\t\t\t\t\t\t'view_item'             =\u003e __( 'View Vehicle', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 394,
            "text": "\t\t\t\t\t\t\t'all_items'             =\u003e __( 'All Vehicles', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 395,
            "text": "\t\t\t\t\t\t\t'search_items'          =\u003e __( 'Search Vehicles', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 396,
            "text": "\t\t\t\t\t\t\t'parent_item_colon'     =\u003e __( 'Parent Vehicles:', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 397,
            "text": "\t\t\t\t\t\t\t'not_found'             =\u003e __( 'No vehicles found.', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 398,
            "text": "\t\t\t\t\t\t\t'not_found_in_trash'    =\u003e __( 'No vehicles found in Trash.', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 399,
            "text": "\t\t\t\t\t\t\t'archives'              =\u003e _x( 'Inventory', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'inventory-presser' ),\r"
          }
        ],
        "originalContents": "\r\n\t\t\t$termlink = $post_type-\u003erewrite['slug'] . $termlink;\r\n\t\t\treturn $termlink;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers the post type that holds vehicles.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function create_post_type() {\r\n\t\t\t// creates a custom post type that will be used by this plugin.\r\n\t\t\tregister_post_type(\r\n\t\t\t\tINVP::POST_TYPE,\r\n\t\t\t\tapply_filters(\r\n\t\t\t\t\t'invp_post_type_args',\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'capability_type' =\u003e INVP::POST_TYPE,\r\n\t\t\t\t\t\t'map_meta_cap'    =\u003e true,\r\n\t\t\t\t\t\t'description'     =\u003e __( 'Vehicles for sale', 'inventory-presser' ),\r\n\t\t\t\t\t\t'has_archive'     =\u003e true,\r\n\t\t\t\t\t\t'hierarchical'    =\u003e false,\r\n\t\t\t\t\t\t'labels'          =\u003e array(\r\n\t\t\t\t\t\t\t'name'                  =\u003e _x( 'Vehicles', 'Post type general name', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'singular_name'         =\u003e _x( 'Vehicle', 'Post type singular name', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'menu_name'             =\u003e _x( 'Vehicles', 'Admin Menu text', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'name_admin_bar'        =\u003e _x( 'Vehicle', 'Add New on Toolbar', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'add_new'               =\u003e __( 'Add New', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'add_new_item'          =\u003e __( 'Add New Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'new_item'              =\u003e __( 'New Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'edit_item'             =\u003e __( 'Edit Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'view_item'             =\u003e __( 'View Vehicle', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'all_items'             =\u003e __( 'All Vehicles', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'search_items'          =\u003e __( 'Search Vehicles', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'parent_item_colon'     =\u003e __( 'Parent Vehicles:', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'not_found'             =\u003e __( 'No vehicles found.', 'inventory-presser' ),\r\n\t\t\t\t\t\t\t'not_found_in_trash'    =\u003e __( 'No vehicles found in Trash.', 'inventory-presser' ),\r\n",
        "range": {
          "endPosition": {
            "line": 399
          },
          "startPosition": {
            "line": 358
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.30182963609695435
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t$options = $vehicle-\u003emeta-\u003einventory_presser_options_array;\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_options_array );\r\n\t\t\t// Remove dealer-specific data.\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_accident_free );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_one_owner );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_top_condition );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_report );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_dealer_id );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_leads_id );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_location );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_nextgear_inspection_url );\r\n\r\n\t\t\t$post = array(\r\n\t\t\t\t'post_author'       =\u003e $current_user_id,\r\n\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,\r\n\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,\r\n\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,\r\n\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,\r\n\t\t\t\t'post_status'       =\u003e 'publish',\r\n\t\t\t\t'comment_status'    =\u003e 'closed',\r\n\t\t\t\t'ping_status'       =\u003e 'closed',\r\n\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,\r\n\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,\r\n\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,\r\n\t\t\t\t'post_parent'       =\u003e 0,\r\n\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,\r\n\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,\r\n\t\t\t);\r\n\r\n\t\t\t$id = wp_insert_post( $post );\r\n\t\t\tforeach ( $options as $option ) {\r\n\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );\r\n\t\t\t}\r\n\r\n\t\t\t$endpoint_media = add_query_arg(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),\r\n\t\t\t\t\t'order'   =\u003e 'asc',\r\n\t\t\t\t),\r\n\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref\r\n\t\t\t);\r\n\t\t\t$response       = wp_remote_get( $endpoint_media );\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1009,
            "text": "continue;\r"
          },
          {
            "lineNumber": 1010,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1011,
            "text": "\r"
          },
          {
            "lineNumber": 1012,
            "text": "\t\t\t$options = $vehicle-\u003emeta-\u003einventory_presser_options_array;\r"
          },
          {
            "lineNumber": 1013,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_options_array );\r"
          },
          {
            "lineNumber": 1014,
            "text": "\t\t\t// Remove dealer-specific data.\r"
          },
          {
            "lineNumber": 1015,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon );\r"
          },
          {
            "lineNumber": 1016,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_accident_free );\r"
          },
          {
            "lineNumber": 1017,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_one_owner );\r"
          },
          {
            "lineNumber": 1018,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_top_condition );\r"
          },
          {
            "lineNumber": 1019,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_report );\r"
          },
          {
            "lineNumber": 1020,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_dealer_id );\r"
          },
          {
            "lineNumber": 1021,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_leads_id );\r"
          },
          {
            "lineNumber": 1022,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_location );\r"
          },
          {
            "lineNumber": 1023,
            "text": "\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_nextgear_inspection_url );\r"
          },
          {
            "lineNumber": 1024,
            "text": "\r"
          },
          {
            "lineNumber": 1025,
            "text": "\t\t\t$post = array(\r"
          },
          {
            "lineNumber": 1026,
            "text": "\t\t\t\t'post_author'       =\u003e $current_user_id,\r"
          },
          {
            "lineNumber": 1027,
            "text": "\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,\r"
          },
          {
            "lineNumber": 1028,
            "text": "\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,\r"
          },
          {
            "lineNumber": 1029,
            "text": "\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,\r"
          },
          {
            "lineNumber": 1030,
            "text": "\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,\r"
          },
          {
            "lineNumber": 1031,
            "text": "\t\t\t\t'post_status'       =\u003e 'publish',\r"
          },
          {
            "lineNumber": 1032,
            "text": "\t\t\t\t'comment_status'    =\u003e 'closed',\r"
          },
          {
            "lineNumber": 1033,
            "text": "\t\t\t\t'ping_status'       =\u003e 'closed',\r"
          },
          {
            "lineNumber": 1034,
            "text": "\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,\r"
          },
          {
            "lineNumber": 1035,
            "text": "\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,\r"
          },
          {
            "lineNumber": 1036,
            "text": "\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,\r"
          },
          {
            "lineNumber": 1037,
            "text": "\t\t\t\t'post_parent'       =\u003e 0,\r"
          },
          {
            "lineNumber": 1038,
            "text": "\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,\r"
          },
          {
            "lineNumber": 1039,
            "text": "\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,\r"
          },
          {
            "lineNumber": 1040,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1041,
            "text": "\r"
          },
          {
            "lineNumber": 1042,
            "text": "\t\t\t$id = wp_insert_post( $post );\r"
          },
          {
            "lineNumber": 1043,
            "text": "\t\t\tforeach ( $options as $option ) {\r"
          },
          {
            "lineNumber": 1044,
            "text": "\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );\r"
          },
          {
            "lineNumber": 1045,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1046,
            "text": "\r"
          },
          {
            "lineNumber": 1047,
            "text": "\t\t\t$endpoint_media = add_query_arg(\r"
          },
          {
            "lineNumber": 1048,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 1049,
            "text": "\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),\r"
          },
          {
            "lineNumber": 1050,
            "text": "\t\t\t\t\t'order'   =\u003e 'asc',\r"
          },
          {
            "lineNumber": 1051,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 1052,
            "text": "\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref\r"
          },
          {
            "lineNumber": 1053,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1054,
            "text": "\t\t\t$response       = wp_remote_get( $endpoint_media );\r"
          },
          {
            "lineNumber": 1055,
            "text": "\t\t\tif ( is_wp_error( $response ) ) {\r"
          },
          {
            "lineNumber": 1056,
            "text": "\t\t\t\tcontinue;\r"
          },
          {
            "lineNumber": 1057,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1058,
            "text": "\r"
          },
          {
            "lineNumber": 1059,
            "text": "\t\t\t$media = json_decode( wp_remote_retrieve_body( $response ) );\r"
          }
        ],
        "originalContents": "\r\n\t\t\t$options = $vehicle-\u003emeta-\u003einventory_presser_options_array;\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_options_array );\r\n\t\t\t// Remove dealer-specific data.\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_accident_free );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_one_owner );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_icon_top_condition );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_carfax_url_report );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_dealer_id );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_leads_id );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_location );\r\n\t\t\tunset( $vehicle-\u003emeta-\u003einventory_presser_nextgear_inspection_url );\r\n\r\n\t\t\t$post = array(\r\n\t\t\t\t'post_author'       =\u003e $current_user_id,\r\n\t\t\t\t'post_date'         =\u003e $vehicle-\u003edate,\r\n\t\t\t\t'post_date_gmt'     =\u003e $vehicle-\u003edate_gmt,\r\n\t\t\t\t'post_content'      =\u003e $vehicle-\u003econtent-\u003erendered,\r\n\t\t\t\t'post_title'        =\u003e $vehicle-\u003etitle-\u003erendered,\r\n\t\t\t\t'post_status'       =\u003e 'publish',\r\n\t\t\t\t'comment_status'    =\u003e 'closed',\r\n\t\t\t\t'ping_status'       =\u003e 'closed',\r\n\t\t\t\t'post_name'         =\u003e $vehicle-\u003eslug,\r\n\t\t\t\t'post_modified'     =\u003e $vehicle-\u003emodified,\r\n\t\t\t\t'post_modified_gmt' =\u003e $vehicle-\u003emodified_gmt,\r\n\t\t\t\t'post_parent'       =\u003e 0,\r\n\t\t\t\t'post_type'         =\u003e $vehicle-\u003etype,\r\n\t\t\t\t'meta_input'        =\u003e (array) $vehicle-\u003emeta,\r\n\t\t\t);\r\n\r\n\t\t\t$id = wp_insert_post( $post );\r\n\t\t\tforeach ( $options as $option ) {\r\n\t\t\t\tadd_post_meta( $id, apply_filters( 'invp_prefix_meta_key', 'options_array' ), $option );\r\n\t\t\t}\r\n\r\n\t\t\t$endpoint_media = add_query_arg(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'orderby' =\u003e apply_filters( 'invp_prefix_meta_key', 'photo_number' ),\r\n\t\t\t\t\t'order'   =\u003e 'asc',\r\n\t\t\t\t),\r\n\t\t\t\t$vehicle-\u003e_links-\u003e{'wp:attachment'}[0]-\u003ehref\r\n\t\t\t);\r\n\t\t\t$response       = wp_remote_get( $endpoint_media );\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 1059
          },
          "startPosition": {
            "column": 4,
            "line": 1008
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.2800348401069641
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_REST\r\n *\r\n * Adds routes to the REST API at /wp-json/invp/\r\n */\r\nclass Inventory_Presser_REST {\r\n\t/**\r\n\t * add_hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\t/*\r\n\t\t\tAdds\r\n\t\t\t\t/invp/v1/settings\r\n\t\t\t\t/invp/v1/feed-complete routes.\r\n\t\t*/\r\n\t\tadd_action( 'rest_api_init', array( $this, 'add_routes' ) );\r\n\t\t// Adds the inventory_type_slugs field to the response of the /wp-json/wp/v2/inventory_vehicle route.\r\n\t\tadd_action( 'rest_api_init', array( $this, 'add_inventory_type_slugs_to_posts' ) );\r\n\r\n\t\t// Allow attachments to be ordered by the inventory_presser_photo_number meta value.\r\n\t\tadd_filter( 'rest_attachment_collection_params', array( $this, 'allow_orderby_photo_number' ) );\r\n\t\tadd_filter( 'rest_attachment_query', array( $this, 'orderby_photo_number' ), 10, 2 );\r\n\r\n\t\tif ( defined( 'INVP::POST_TYPE' ) ) {\r\n\t\t\t// Allow vehicles to be returned in a random order.\r\n\t\t\tadd_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an attribute &#96;inventory_type_slugs&#96; to the response of the\r\n\t * /wp-json/wp/v2/inventory route.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_inventory_type_slugs_to_posts() {\r\n\t\tregister_rest_field(\r\n\t\t\tINVP::POST_TYPE,\r\n\t\t\t'inventory_type_slugs',\r\n\t\t\tarray(\r\n\t\t\t\t'get_callback' =\u003e array( $this, 'get_the_type_slugs' ),\r\n\t\t\t\t'schema'       =\u003e array(\r\n\t\t\t\t\t'description' =\u003e __( 'The type taxonomy term slugs.', 'inventory-presser' ),\r\n\t\t\t\t\t'type'        =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the photo_number meta field to the allowed orderby values.\r\n\t *\r\n\t * @param  array $params\r\n\t * @return array\r\n\t */\r\n\tpublic function allow_orderby_photo_number( $params ) {\r\n\t\t$params['orderby']['enum'][] = apply_filters( 'invp_prefix_meta_key', 'photo_number' );\r\n\t\treturn $params;\r\n\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php\r"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;\r"
          },
          {
            "lineNumber": 3,
            "text": "\r"
          },
          {
            "lineNumber": 4,
            "text": "/**\r"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_REST\r"
          },
          {
            "lineNumber": 6,
            "text": " *\r"
          },
          {
            "lineNumber": 7,
            "text": " * Adds routes to the REST API at /wp-json/invp/\r"
          },
          {
            "lineNumber": 8,
            "text": " */\r"
          },
          {
            "lineNumber": 9,
            "text": "class Inventory_Presser_REST {\r"
          },
          {
            "lineNumber": 10,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 11,
            "text": "\t * add_hooks\r"
          },
          {
            "lineNumber": 12,
            "text": "\t *\r"
          },
          {
            "lineNumber": 13,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 14,
            "text": "\t */\r"
          },
          {
            "lineNumber": 15,
            "text": "\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 16,
            "text": "\t\t/*\r"
          },
          {
            "lineNumber": 17,
            "text": "\t\t\tAdds\r"
          },
          {
            "lineNumber": 18,
            "text": "\t\t\t\t/invp/v1/settings\r"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t\t/invp/v1/feed-complete routes.\r"
          },
          {
            "lineNumber": 20,
            "text": "\t\t*/\r"
          },
          {
            "lineNumber": 21,
            "text": "\t\tadd_action( 'rest_api_init', array( $this, 'add_routes' ) );\r"
          },
          {
            "lineNumber": 22,
            "text": "\t\t// Adds the inventory_type_slugs field to the response of the /wp-json/wp/v2/inventory_vehicle route.\r"
          },
          {
            "lineNumber": 23,
            "text": "\t\tadd_action( 'rest_api_init', array( $this, 'add_inventory_type_slugs_to_posts' ) );\r"
          },
          {
            "lineNumber": 24,
            "text": "\r"
          },
          {
            "lineNumber": 25,
            "text": "\t\t// Allow attachments to be ordered by the inventory_presser_photo_number meta value.\r"
          },
          {
            "lineNumber": 26,
            "text": "\t\tadd_filter( 'rest_attachment_collection_params', array( $this, 'allow_orderby_photo_number' ) );\r"
          },
          {
            "lineNumber": 27,
            "text": "\t\tadd_filter( 'rest_attachment_query', array( $this, 'orderby_photo_number' ), 10, 2 );\r"
          },
          {
            "lineNumber": 28,
            "text": "\r"
          },
          {
            "lineNumber": 29,
            "text": "\t\tif ( defined( 'INVP::POST_TYPE' ) ) {\r"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t// Allow vehicles to be returned in a random order.\r"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\tadd_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );\r"
          },
          {
            "lineNumber": 32,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 33,
            "text": "\t}\r"
          },
          {
            "lineNumber": 34,
            "text": "\r"
          },
          {
            "lineNumber": 35,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 36,
            "text": "\t * Adds an attribute &#96;inventory_type_slugs&#96; to the response of the\r"
          },
          {
            "lineNumber": 37,
            "text": "\t * /wp-json/wp/v2/inventory route.\r"
          },
          {
            "lineNumber": 38,
            "text": "\t *\r"
          },
          {
            "lineNumber": 39,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 40,
            "text": "\t */\r"
          },
          {
            "lineNumber": 41,
            "text": "\tpublic function add_inventory_type_slugs_to_posts() {\r"
          },
          {
            "lineNumber": 42,
            "text": "\t\tregister_rest_field(\r"
          },
          {
            "lineNumber": 43,
            "text": "\t\t\tINVP::POST_TYPE,\r"
          },
          {
            "lineNumber": 44,
            "text": "\t\t\t'inventory_type_slugs',\r"
          },
          {
            "lineNumber": 45,
            "text": "\t\t\tarray(\r"
          },
          {
            "lineNumber": 46,
            "text": "\t\t\t\t'get_callback' =\u003e array( $this, 'get_the_type_slugs' ),\r"
          },
          {
            "lineNumber": 47,
            "text": "\t\t\t\t'schema'       =\u003e array(\r"
          },
          {
            "lineNumber": 48,
            "text": "\t\t\t\t\t'description' =\u003e __( 'The type taxonomy term slugs.', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 49,
            "text": "\t\t\t\t\t'type'        =\u003e 'string',\r"
          },
          {
            "lineNumber": 50,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 51,
            "text": "\t\t\t)\r"
          },
          {
            "lineNumber": 52,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 53,
            "text": "\t}\r"
          },
          {
            "lineNumber": 54,
            "text": "\r"
          },
          {
            "lineNumber": 55,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 56,
            "text": "\t * Adds the photo_number meta field to the allowed orderby values.\r"
          },
          {
            "lineNumber": 57,
            "text": "\t *\r"
          },
          {
            "lineNumber": 58,
            "text": "\t * @param  array $params\r"
          },
          {
            "lineNumber": 59,
            "text": "\t * @return array\r"
          },
          {
            "lineNumber": 60,
            "text": "\t */\r"
          },
          {
            "lineNumber": 61,
            "text": "\tpublic function allow_orderby_photo_number( $params ) {\r"
          },
          {
            "lineNumber": 62,
            "text": "\t\t$params['orderby']['enum'][] = apply_filters( 'invp_prefix_meta_key', 'photo_number' );\r"
          },
          {
            "lineNumber": 63,
            "text": "\t\treturn $params;\r"
          },
          {
            "lineNumber": 64,
            "text": "\t}\r"
          },
          {
            "lineNumber": 65,
            "text": "\r"
          },
          {
            "lineNumber": 66,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 67,
            "text": "\t * Allow vehicles to be returned in a random order.\r"
          }
        ],
        "originalContents": "\u003c?php\r\ndefined( 'ABSPATH' ) || exit;\r\n\r\n/**\r\n * Inventory_Presser_REST\r\n *\r\n * Adds routes to the REST API at /wp-json/invp/\r\n */\r\nclass Inventory_Presser_REST {\r\n\t/**\r\n\t * add_hooks\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_hooks() {\r\n\t\t/*\r\n\t\t\tAdds\r\n\t\t\t\t/invp/v1/settings\r\n\t\t\t\t/invp/v1/feed-complete routes.\r\n\t\t*/\r\n\t\tadd_action( 'rest_api_init', array( $this, 'add_routes' ) );\r\n\t\t// Adds the inventory_type_slugs field to the response of the /wp-json/wp/v2/inventory_vehicle route.\r\n\t\tadd_action( 'rest_api_init', array( $this, 'add_inventory_type_slugs_to_posts' ) );\r\n\r\n\t\t// Allow attachments to be ordered by the inventory_presser_photo_number meta value.\r\n\t\tadd_filter( 'rest_attachment_collection_params', array( $this, 'allow_orderby_photo_number' ) );\r\n\t\tadd_filter( 'rest_attachment_query', array( $this, 'orderby_photo_number' ), 10, 2 );\r\n\r\n\t\tif ( defined( 'INVP::POST_TYPE' ) ) {\r\n\t\t\t// Allow vehicles to be returned in a random order.\r\n\t\t\tadd_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds an attribute &#96;inventory_type_slugs&#96; to the response of the\r\n\t * /wp-json/wp/v2/inventory route.\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic function add_inventory_type_slugs_to_posts() {\r\n\t\tregister_rest_field(\r\n\t\t\tINVP::POST_TYPE,\r\n\t\t\t'inventory_type_slugs',\r\n\t\t\tarray(\r\n\t\t\t\t'get_callback' =\u003e array( $this, 'get_the_type_slugs' ),\r\n\t\t\t\t'schema'       =\u003e array(\r\n\t\t\t\t\t'description' =\u003e __( 'The type taxonomy term slugs.', 'inventory-presser' ),\r\n\t\t\t\t\t'type'        =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the photo_number meta field to the allowed orderby values.\r\n\t *\r\n\t * @param  array $params\r\n\t * @return array\r\n\t */\r\n\tpublic function allow_orderby_photo_number( $params ) {\r\n\t\t$params['orderby']['enum'][] = apply_filters( 'invp_prefix_meta_key', 'photo_number' );\r\n\t\treturn $params;\r\n\t}\r\n",
        "range": {
          "endPosition": {
            "line": 67
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/class-rest.php"
      },
      "score": 0.279427707195282
    },
    {
      "codeBlock": {
        "contents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Forms_Integration\n */\nabstract class Inventory_Presser_Forms_Integration {\n\t/**\n\t * Given a submitted form value like \"2020 Toyota Sienna LE, 10329A\",\n\t * find and return the vehicle's post ID.\n\t *\n\t * @param  string $value An \u003coption\u003e value of a drop down containing vehicles in lead form.\n\t * @return int|false\n\t */\n\tprotected function extract_post_id_from_value( $value ) {\n\t\t// submitted \"2020 Toyota Sienna LE, 10329A\".\n\t\t$pieces = explode( ', ', $value );\n\t\tif ( 1 === count( $pieces ) ) {\n\t\t\t// delimiter not found.\n\t\t\treturn false;\n\t\t}\n\t\t$stock_number = $pieces[ count( $pieces ) - 1 ];\n\t\t$post_ids     = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields'         =\u003e 'ids',\n\t\t\t\t'meta_key'       =\u003e apply_filters( 'invp_prefix_meta_key', 'stock_number' ),\n\t\t\t\t'meta_value'     =\u003e $stock_number,\n\t\t\t\t'post_status'    =\u003e 'publish',\n\t\t\t\t'post_type'      =\u003e INVP::POST_TYPE,\n\t\t\t\t'posts_per_page' =\u003e 1,\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $post_ids ) || ! is_array( $post_ids ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $post_ids[0];\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 1,
            "text": "\u003c?php"
          },
          {
            "lineNumber": 2,
            "text": "defined( 'ABSPATH' ) || exit;"
          },
          {
            "lineNumber": 3
          },
          {
            "lineNumber": 4,
            "text": "/**"
          },
          {
            "lineNumber": 5,
            "text": " * Inventory_Presser_Forms_Integration"
          },
          {
            "lineNumber": 6,
            "text": " */"
          },
          {
            "lineNumber": 7,
            "text": "abstract class Inventory_Presser_Forms_Integration {"
          },
          {
            "lineNumber": 8,
            "text": "\t/**"
          },
          {
            "lineNumber": 9,
            "text": "\t * Given a submitted form value like \"2020 Toyota Sienna LE, 10329A\","
          },
          {
            "lineNumber": 10,
            "text": "\t * find and return the vehicle's post ID."
          },
          {
            "lineNumber": 11,
            "text": "\t *"
          },
          {
            "lineNumber": 12,
            "text": "\t * @param  string $value An \u003coption\u003e value of a drop down containing vehicles in lead form."
          },
          {
            "lineNumber": 13,
            "text": "\t * @return int|false"
          },
          {
            "lineNumber": 14,
            "text": "\t */"
          },
          {
            "lineNumber": 15,
            "text": "\tprotected function extract_post_id_from_value( $value ) {"
          },
          {
            "lineNumber": 16,
            "text": "\t\t// submitted \"2020 Toyota Sienna LE, 10329A\"."
          },
          {
            "lineNumber": 17,
            "text": "\t\t$pieces = explode( ', ', $value );"
          },
          {
            "lineNumber": 18,
            "text": "\t\tif ( 1 === count( $pieces ) ) {"
          },
          {
            "lineNumber": 19,
            "text": "\t\t\t// delimiter not found."
          },
          {
            "lineNumber": 20,
            "text": "\t\t\treturn false;"
          },
          {
            "lineNumber": 21,
            "text": "\t\t}"
          },
          {
            "lineNumber": 22,
            "text": "\t\t$stock_number = $pieces[ count( $pieces ) - 1 ];"
          },
          {
            "lineNumber": 23,
            "text": "\t\t$post_ids     = get_posts("
          },
          {
            "lineNumber": 24,
            "text": "\t\t\tarray("
          },
          {
            "lineNumber": 25,
            "text": "\t\t\t\t'fields'         =\u003e 'ids',"
          },
          {
            "lineNumber": 26,
            "text": "\t\t\t\t'meta_key'       =\u003e apply_filters( 'invp_prefix_meta_key', 'stock_number' ),"
          },
          {
            "lineNumber": 27,
            "text": "\t\t\t\t'meta_value'     =\u003e $stock_number,"
          },
          {
            "lineNumber": 28,
            "text": "\t\t\t\t'post_status'    =\u003e 'publish',"
          },
          {
            "lineNumber": 29,
            "text": "\t\t\t\t'post_type'      =\u003e INVP::POST_TYPE,"
          },
          {
            "lineNumber": 30,
            "text": "\t\t\t\t'posts_per_page' =\u003e 1,"
          },
          {
            "lineNumber": 31,
            "text": "\t\t\t)"
          },
          {
            "lineNumber": 32,
            "text": "\t\t);"
          },
          {
            "lineNumber": 33
          },
          {
            "lineNumber": 34,
            "text": "\t\tif ( empty( $post_ids ) || ! is_array( $post_ids ) ) {"
          },
          {
            "lineNumber": 35,
            "text": "\t\t\treturn false;"
          },
          {
            "lineNumber": 36,
            "text": "\t\t}"
          },
          {
            "lineNumber": 37
          },
          {
            "lineNumber": 38,
            "text": "\t\treturn $post_ids[0];"
          },
          {
            "lineNumber": 39,
            "text": "\t}"
          },
          {
            "lineNumber": 40,
            "text": "}"
          }
        ],
        "originalContents": "\u003c?php\ndefined( 'ABSPATH' ) || exit;\n\n/**\n * Inventory_Presser_Forms_Integration\n */\nabstract class Inventory_Presser_Forms_Integration {\n\t/**\n\t * Given a submitted form value like \"2020 Toyota Sienna LE, 10329A\",\n\t * find and return the vehicle's post ID.\n\t *\n\t * @param  string $value An \u003coption\u003e value of a drop down containing vehicles in lead form.\n\t * @return int|false\n\t */\n\tprotected function extract_post_id_from_value( $value ) {\n\t\t// submitted \"2020 Toyota Sienna LE, 10329A\".\n\t\t$pieces = explode( ', ', $value );\n\t\tif ( 1 === count( $pieces ) ) {\n\t\t\t// delimiter not found.\n\t\t\treturn false;\n\t\t}\n\t\t$stock_number = $pieces[ count( $pieces ) - 1 ];\n\t\t$post_ids     = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields'         =\u003e 'ids',\n\t\t\t\t'meta_key'       =\u003e apply_filters( 'invp_prefix_meta_key', 'stock_number' ),\n\t\t\t\t'meta_value'     =\u003e $stock_number,\n\t\t\t\t'post_status'    =\u003e 'publish',\n\t\t\t\t'post_type'      =\u003e INVP::POST_TYPE,\n\t\t\t\t'posts_per_page' =\u003e 1,\n\t\t\t)\n\t\t);\n\n\t\tif ( empty( $post_ids ) || ! is_array( $post_ids ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $post_ids[0];\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 40
          },
          "startPosition": {}
        },
        "relativeWorkspacePath": "includes/integrations/class-forms-integration.php"
      },
      "score": 0.2735396921634674
    },
    {
      "codeBlock": {
        "contents": "\r\n\t/**\r\n\t * Produces an array of arrays that define all the meta fields that\r\n\t * define our vehicle post type for all vehicle types including boats.\r\n\t *\r\n\t * @return array An array of arrays, defining the meta fields that are registered and used by this class.\r\n\t */\r\n\tpublic static function keys_and_types() {\r\n\t\treturn apply_filters(\r\n\t\t\t'invp_meta_fields',\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'Availability', 'inventory-presser' ),\r\n\t\t\t\t\t'name'   =\u003e 'availability',\r\n\t\t\t\t\t'sample' =\u003e __( 'For Sale', 'inventory-presser' ),\r\n\t\t\t\t\t'type'   =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Beam', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'beam', // for boats.\r\n\t\t\t\t\t'type'  =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'Body Style', 'inventory-presser' ),\r\n\t\t\t\t\t'name'   =\u003e 'body_style',\r\n\t\t\t\t\t'sample' =\u003e __( 'EXTENDED CAB PICKUP', 'inventory-presser' ),\r\n\t\t\t\t\t'type'   =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'KBB Book Value', 'inventory-presser' ), // Kelley Blue Book.\r\n\t\t\t\t\t'name'   =\u003e 'book_value_kbb',\r\n\t\t\t\t\t'sample' =\u003e 13500,\r\n\t\t\t\t\t'type'   =\u003e 'number',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'NADA Book Value', 'inventory-presser' ), // NADA Guides.\r\n\t\t\t\t\t'name'   =\u003e 'book_value_nada',\r\n\t\t\t\t\t'sample' =\u003e 13500,\r\n\t\t\t\t\t'type'   =\u003e 'number',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Car ID', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'car_id', // unique identifier.\r\n\t\t\t\t\t'type'  =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax Accident Free', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_accident_free',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax Have Report', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_have_report',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax One Owner', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_one_owner',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n",
        "detailedLines": [
          {
            "lineNumber": 489,
            "text": "return array_column( self::keys_and_types(), 'name' );\r"
          },
          {
            "lineNumber": 490,
            "text": "\t}\r"
          },
          {
            "lineNumber": 491,
            "text": "\r"
          },
          {
            "lineNumber": 492,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 493,
            "text": "\t * Produces an array of arrays that define all the meta fields that\r"
          },
          {
            "lineNumber": 494,
            "text": "\t * define our vehicle post type for all vehicle types including boats.\r"
          },
          {
            "lineNumber": 495,
            "text": "\t *\r"
          },
          {
            "lineNumber": 496,
            "text": "\t * @return array An array of arrays, defining the meta fields that are registered and used by this class.\r"
          },
          {
            "lineNumber": 497,
            "text": "\t */\r"
          },
          {
            "lineNumber": 498,
            "text": "\tpublic static function keys_and_types() {\r"
          },
          {
            "lineNumber": 499,
            "text": "\t\treturn apply_filters(\r"
          },
          {
            "lineNumber": 500,
            "text": "\t\t\t'invp_meta_fields',\r"
          },
          {
            "lineNumber": 501,
            "text": "\t\t\tarray(\r"
          },
          {
            "lineNumber": 502,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 503,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'Availability', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 504,
            "text": "\t\t\t\t\t'name'   =\u003e 'availability',\r"
          },
          {
            "lineNumber": 505,
            "text": "\t\t\t\t\t'sample' =\u003e __( 'For Sale', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 506,
            "text": "\t\t\t\t\t'type'   =\u003e 'string',\r"
          },
          {
            "lineNumber": 507,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 508,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 509,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Beam', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 510,
            "text": "\t\t\t\t\t'name'  =\u003e 'beam', // for boats.\r"
          },
          {
            "lineNumber": 511,
            "text": "\t\t\t\t\t'type'  =\u003e 'string',\r"
          },
          {
            "lineNumber": 512,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 513,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 514,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'Body Style', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 515,
            "text": "\t\t\t\t\t'name'   =\u003e 'body_style',\r"
          },
          {
            "lineNumber": 516,
            "text": "\t\t\t\t\t'sample' =\u003e __( 'EXTENDED CAB PICKUP', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 517,
            "text": "\t\t\t\t\t'type'   =\u003e 'string',\r"
          },
          {
            "lineNumber": 518,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 519,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 520,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'KBB Book Value', 'inventory-presser' ), // Kelley Blue Book.\r"
          },
          {
            "lineNumber": 521,
            "text": "\t\t\t\t\t'name'   =\u003e 'book_value_kbb',\r"
          },
          {
            "lineNumber": 522,
            "text": "\t\t\t\t\t'sample' =\u003e 13500,\r"
          },
          {
            "lineNumber": 523,
            "text": "\t\t\t\t\t'type'   =\u003e 'number',\r"
          },
          {
            "lineNumber": 524,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 525,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 526,
            "text": "\t\t\t\t\t'label'  =\u003e __( 'NADA Book Value', 'inventory-presser' ), // NADA Guides.\r"
          },
          {
            "lineNumber": 527,
            "text": "\t\t\t\t\t'name'   =\u003e 'book_value_nada',\r"
          },
          {
            "lineNumber": 528,
            "text": "\t\t\t\t\t'sample' =\u003e 13500,\r"
          },
          {
            "lineNumber": 529,
            "text": "\t\t\t\t\t'type'   =\u003e 'number',\r"
          },
          {
            "lineNumber": 530,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 531,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 532,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Car ID', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 533,
            "text": "\t\t\t\t\t'name'  =\u003e 'car_id', // unique identifier.\r"
          },
          {
            "lineNumber": 534,
            "text": "\t\t\t\t\t'type'  =\u003e 'string',\r"
          },
          {
            "lineNumber": 535,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 536,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 537,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Accident Free', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 538,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_accident_free',\r"
          },
          {
            "lineNumber": 539,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',\r"
          },
          {
            "lineNumber": 540,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 541,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 542,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Have Report', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 543,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_have_report',\r"
          },
          {
            "lineNumber": 544,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',\r"
          },
          {
            "lineNumber": 545,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 546,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 547,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax One Owner', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 548,
            "text": "\t\t\t\t\t'name'  =\u003e 'carfax_one_owner',\r"
          },
          {
            "lineNumber": 549,
            "text": "\t\t\t\t\t'type'  =\u003e 'boolean',\r"
          },
          {
            "lineNumber": 550,
            "text": "\t\t\t\t),\r"
          },
          {
            "lineNumber": 551,
            "text": "\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 552,
            "text": "\t\t\t\t\t'label' =\u003e __( 'Carfax Top Condition', 'inventory-presser' ),\r"
          }
        ],
        "originalContents": "\r\n\t/**\r\n\t * Produces an array of arrays that define all the meta fields that\r\n\t * define our vehicle post type for all vehicle types including boats.\r\n\t *\r\n\t * @return array An array of arrays, defining the meta fields that are registered and used by this class.\r\n\t */\r\n\tpublic static function keys_and_types() {\r\n\t\treturn apply_filters(\r\n\t\t\t'invp_meta_fields',\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'Availability', 'inventory-presser' ),\r\n\t\t\t\t\t'name'   =\u003e 'availability',\r\n\t\t\t\t\t'sample' =\u003e __( 'For Sale', 'inventory-presser' ),\r\n\t\t\t\t\t'type'   =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Beam', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'beam', // for boats.\r\n\t\t\t\t\t'type'  =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'Body Style', 'inventory-presser' ),\r\n\t\t\t\t\t'name'   =\u003e 'body_style',\r\n\t\t\t\t\t'sample' =\u003e __( 'EXTENDED CAB PICKUP', 'inventory-presser' ),\r\n\t\t\t\t\t'type'   =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'KBB Book Value', 'inventory-presser' ), // Kelley Blue Book.\r\n\t\t\t\t\t'name'   =\u003e 'book_value_kbb',\r\n\t\t\t\t\t'sample' =\u003e 13500,\r\n\t\t\t\t\t'type'   =\u003e 'number',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label'  =\u003e __( 'NADA Book Value', 'inventory-presser' ), // NADA Guides.\r\n\t\t\t\t\t'name'   =\u003e 'book_value_nada',\r\n\t\t\t\t\t'sample' =\u003e 13500,\r\n\t\t\t\t\t'type'   =\u003e 'number',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Car ID', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'car_id', // unique identifier.\r\n\t\t\t\t\t'type'  =\u003e 'string',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax Accident Free', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_accident_free',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax Have Report', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_have_report',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'label' =\u003e __( 'Carfax One Owner', 'inventory-presser' ),\r\n\t\t\t\t\t'name'  =\u003e 'carfax_one_owner',\r\n\t\t\t\t\t'type'  =\u003e 'boolean',\r\n\t\t\t\t),\r\n",
        "range": {
          "endPosition": {
            "line": 552
          },
          "startPosition": {
            "column": 2,
            "line": 488
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.2713010311126709
    },
    {
      "codeBlock": {
        "contents": "\r\n\t/**\r\n\t * Given a $meta array collection of a post's entire meta data, retrieves\r\n\t * the single or first value stored in $key.\r\n\t *\r\n\t * @param  array  $meta\r\n\t * @param  string $key  A meta key.\r\n\t * @return string|bool A single meta value or false if the value does not exist\r\n\t */\r\n\tprotected static function meta_array_value_single( $meta, $key ) {\r\n\t\treturn isset( $meta[ $key ][0] ) ? $meta[ $key ][0] : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the prefix added to all vehicle post meta keys.\r\n\t *\r\n\t * @return string The prefix added to all vehicle post meta keys\r\n\t */\r\n\tpublic static function meta_prefix() {\r\n\t\treturn apply_filters( 'invp_meta_prefix', 'inventory_presser_' );\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether or not a provided $post_meta_key is a number data\r\n\t * type.\r\n\t *\r\n\t * @param  string $post_meta_key\r\n\t * @return bool True if the given $post_meta_key is a number data type.\r\n\t */\r\n\tpublic static function meta_value_is_number( $post_meta_key ) {\r\n\t\tforeach ( self::keys_and_types() as $key_and_type ) {\r\n\t\t\tif ( apply_filters( 'invp_prefix_meta_key', $key_and_type['name'] ?? '' ) === $post_meta_key ) {\r\n\t\t\t\treturn 'number' === $key_and_type['type'] ?? '' || 'integer' === $key_and_type['type'] ?? '';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Provides the option group string that is needed for register_setting()\r\n\t * calls.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function option_group() {\r\n\t\treturn apply_filters( 'invp_option_group', 'dealership_options_option_group' );\r\n\t}\r\n\r\n\t/**\r\n\t * Provides the option page string that determines where the settings\r\n\t * sections are rendered.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function option_page() {\r\n\t\treturn apply_filters( 'invp_option_page', self::OPTION_PAGE . '-admin' );\r\n\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1101,
            "text": "set_post_thumbnail( $id, $media_id );\r"
          },
          {
            "lineNumber": 1102,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 1103,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1104,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1105,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1106,
            "text": "\r"
          },
          {
            "lineNumber": 1107,
            "text": "\r"
          },
          {
            "lineNumber": 1108,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1109,
            "text": "\t * Given a $meta array collection of a post's entire meta data, retrieves\r"
          },
          {
            "lineNumber": 1110,
            "text": "\t * the single or first value stored in $key.\r"
          },
          {
            "lineNumber": 1111,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1112,
            "text": "\t * @param  array  $meta\r"
          },
          {
            "lineNumber": 1113,
            "text": "\t * @param  string $key  A meta key.\r"
          },
          {
            "lineNumber": 1114,
            "text": "\t * @return string|bool A single meta value or false if the value does not exist\r"
          },
          {
            "lineNumber": 1115,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1116,
            "text": "\tprotected static function meta_array_value_single( $meta, $key ) {\r"
          },
          {
            "lineNumber": 1117,
            "text": "\t\treturn isset( $meta[ $key ][0] ) ? $meta[ $key ][0] : false;\r"
          },
          {
            "lineNumber": 1118,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1119,
            "text": "\r"
          },
          {
            "lineNumber": 1120,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1121,
            "text": "\t * Returns the prefix added to all vehicle post meta keys.\r"
          },
          {
            "lineNumber": 1122,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1123,
            "text": "\t * @return string The prefix added to all vehicle post meta keys\r"
          },
          {
            "lineNumber": 1124,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1125,
            "text": "\tpublic static function meta_prefix() {\r"
          },
          {
            "lineNumber": 1126,
            "text": "\t\treturn apply_filters( 'invp_meta_prefix', 'inventory_presser_' );\r"
          },
          {
            "lineNumber": 1127,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1128,
            "text": "\r"
          },
          {
            "lineNumber": 1129,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1130,
            "text": "\t * Indicates whether or not a provided $post_meta_key is a number data\r"
          },
          {
            "lineNumber": 1131,
            "text": "\t * type.\r"
          },
          {
            "lineNumber": 1132,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1133,
            "text": "\t * @param  string $post_meta_key\r"
          },
          {
            "lineNumber": 1134,
            "text": "\t * @return bool True if the given $post_meta_key is a number data type.\r"
          },
          {
            "lineNumber": 1135,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1136,
            "text": "\tpublic static function meta_value_is_number( $post_meta_key ) {\r"
          },
          {
            "lineNumber": 1137,
            "text": "\t\tforeach ( self::keys_and_types() as $key_and_type ) {\r"
          },
          {
            "lineNumber": 1138,
            "text": "\t\t\tif ( apply_filters( 'invp_prefix_meta_key', $key_and_type['name'] ?? '' ) === $post_meta_key ) {\r"
          },
          {
            "lineNumber": 1139,
            "text": "\t\t\t\treturn 'number' === $key_and_type['type'] ?? '' || 'integer' === $key_and_type['type'] ?? '';\r"
          },
          {
            "lineNumber": 1140,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1141,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1142,
            "text": "\t\treturn false;\r"
          },
          {
            "lineNumber": 1143,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1144,
            "text": "\r"
          },
          {
            "lineNumber": 1145,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1146,
            "text": "\t * Provides the option group string that is needed for register_setting()\r"
          },
          {
            "lineNumber": 1147,
            "text": "\t * calls.\r"
          },
          {
            "lineNumber": 1148,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1149,
            "text": "\t * @return string\r"
          },
          {
            "lineNumber": 1150,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1151,
            "text": "\tpublic static function option_group() {\r"
          },
          {
            "lineNumber": 1152,
            "text": "\t\treturn apply_filters( 'invp_option_group', 'dealership_options_option_group' );\r"
          },
          {
            "lineNumber": 1153,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1154,
            "text": "\r"
          },
          {
            "lineNumber": 1155,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1156,
            "text": "\t * Provides the option page string that determines where the settings\r"
          },
          {
            "lineNumber": 1157,
            "text": "\t * sections are rendered.\r"
          },
          {
            "lineNumber": 1158,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1159,
            "text": "\t * @return string\r"
          },
          {
            "lineNumber": 1160,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1161,
            "text": "\tpublic static function option_page() {\r"
          },
          {
            "lineNumber": 1162,
            "text": "\t\treturn apply_filters( 'invp_option_page', self::OPTION_PAGE . '-admin' );\r"
          },
          {
            "lineNumber": 1163,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1164,
            "text": "\r"
          },
          {
            "lineNumber": 1165,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1166,
            "text": "\t * Creates HTML to help navigate listings pages. \"Older\" and \"Newer\" don't\r"
          }
        ],
        "originalContents": "\r\n\t/**\r\n\t * Given a $meta array collection of a post's entire meta data, retrieves\r\n\t * the single or first value stored in $key.\r\n\t *\r\n\t * @param  array  $meta\r\n\t * @param  string $key  A meta key.\r\n\t * @return string|bool A single meta value or false if the value does not exist\r\n\t */\r\n\tprotected static function meta_array_value_single( $meta, $key ) {\r\n\t\treturn isset( $meta[ $key ][0] ) ? $meta[ $key ][0] : false;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the prefix added to all vehicle post meta keys.\r\n\t *\r\n\t * @return string The prefix added to all vehicle post meta keys\r\n\t */\r\n\tpublic static function meta_prefix() {\r\n\t\treturn apply_filters( 'invp_meta_prefix', 'inventory_presser_' );\r\n\t}\r\n\r\n\t/**\r\n\t * Indicates whether or not a provided $post_meta_key is a number data\r\n\t * type.\r\n\t *\r\n\t * @param  string $post_meta_key\r\n\t * @return bool True if the given $post_meta_key is a number data type.\r\n\t */\r\n\tpublic static function meta_value_is_number( $post_meta_key ) {\r\n\t\tforeach ( self::keys_and_types() as $key_and_type ) {\r\n\t\t\tif ( apply_filters( 'invp_prefix_meta_key', $key_and_type['name'] ?? '' ) === $post_meta_key ) {\r\n\t\t\t\treturn 'number' === $key_and_type['type'] ?? '' || 'integer' === $key_and_type['type'] ?? '';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * Provides the option group string that is needed for register_setting()\r\n\t * calls.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function option_group() {\r\n\t\treturn apply_filters( 'invp_option_group', 'dealership_options_option_group' );\r\n\t}\r\n\r\n\t/**\r\n\t * Provides the option page string that determines where the settings\r\n\t * sections are rendered.\r\n\t *\r\n\t * @return string\r\n\t */\r\n\tpublic static function option_page() {\r\n\t\treturn apply_filters( 'invp_option_page', self::OPTION_PAGE . '-admin' );\r\n\t}\r\n",
        "range": {
          "endPosition": {
            "line": 1166
          },
          "startPosition": {
            "column": 5,
            "line": 1100
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.2691971957683563
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t/**\r\n\t\t * Provides default values for the plugin settings stored in an option\r\n\t\t * with name INVP::OPTION_NAME.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function set_default_settings() {\r\n\t\t\t$settings = INVP::settings();\r\n\t\t\t// Do not overwrite taxonomies setting if it exists.\r\n\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r\n\t\t\t$show_menu = false;\r\n\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r\n\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r\n\t\t\t\tunset( $settings['show_all_taxonomies'] );\r\n\t\t\t}\r\n\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r\n\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r\n\t\t\t}\r\n\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * This is the driver function of the entire plugin. Includes dependencies\r\n\t\t * and adds all hooks.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function add_hooks() {\r\n\t\t\t// Only do these things once.\r\n\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// include all this plugin's classes that live in external files.\r\n\t\t\t$this-\u003einclude_dependencies();\r\n\r\n\t\t\t// Ensure addon updaters are initialized in multisite.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r\n\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r\n\t\t\t}\r\n\r\n\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r\n\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r\n\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r\n\r\n\t\t\t// Provide a path to .mo files in /languages.\r\n\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Create our post type and taxonomies\r\n\t\t\t */\r\n\r\n\t\t\t// create a custom post type for the vehicles.\r\n\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r\n",
        "detailedLines": [
          {
            "lineNumber": 590,
            "text": "$pieces = explode( ' ', rtrim( $str ) );\r"
          },
          {
            "lineNumber": 591,
            "text": "\t\t\treturn array_pop( $pieces );\r"
          },
          {
            "lineNumber": 592,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 593,
            "text": "\r"
          },
          {
            "lineNumber": 594,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 595,
            "text": "\t\t * Provides default values for the plugin settings stored in an option\r"
          },
          {
            "lineNumber": 596,
            "text": "\t\t * with name INVP::OPTION_NAME.\r"
          },
          {
            "lineNumber": 597,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 598,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 599,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 600,
            "text": "\t\tpublic static function set_default_settings() {\r"
          },
          {
            "lineNumber": 601,
            "text": "\t\t\t$settings = INVP::settings();\r"
          },
          {
            "lineNumber": 602,
            "text": "\t\t\t// Do not overwrite taxonomies setting if it exists.\r"
          },
          {
            "lineNumber": 603,
            "text": "\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 604,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 605,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 606,
            "text": "\r"
          },
          {
            "lineNumber": 607,
            "text": "\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r"
          },
          {
            "lineNumber": 608,
            "text": "\t\t\t$show_menu = false;\r"
          },
          {
            "lineNumber": 609,
            "text": "\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 610,
            "text": "\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r"
          },
          {
            "lineNumber": 611,
            "text": "\t\t\t\tunset( $settings['show_all_taxonomies'] );\r"
          },
          {
            "lineNumber": 612,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 613,
            "text": "\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r"
          },
          {
            "lineNumber": 614,
            "text": "\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r"
          },
          {
            "lineNumber": 615,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 616,
            "text": "\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r"
          },
          {
            "lineNumber": 617,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 618,
            "text": "\r"
          },
          {
            "lineNumber": 619,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 620,
            "text": "\t\t * This is the driver function of the entire plugin. Includes dependencies\r"
          },
          {
            "lineNumber": 621,
            "text": "\t\t * and adds all hooks.\r"
          },
          {
            "lineNumber": 622,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 623,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 624,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 625,
            "text": "\t\tpublic function add_hooks() {\r"
          },
          {
            "lineNumber": 626,
            "text": "\t\t\t// Only do these things once.\r"
          },
          {
            "lineNumber": 627,
            "text": "\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r"
          },
          {
            "lineNumber": 628,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 629,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 630,
            "text": "\r"
          },
          {
            "lineNumber": 631,
            "text": "\t\t\t// include all this plugin's classes that live in external files.\r"
          },
          {
            "lineNumber": 632,
            "text": "\t\t\t$this-\u003einclude_dependencies();\r"
          },
          {
            "lineNumber": 633,
            "text": "\r"
          },
          {
            "lineNumber": 634,
            "text": "\t\t\t// Ensure addon updaters are initialized in multisite.\r"
          },
          {
            "lineNumber": 635,
            "text": "\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r"
          },
          {
            "lineNumber": 636,
            "text": "\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r"
          },
          {
            "lineNumber": 637,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 638,
            "text": "\r"
          },
          {
            "lineNumber": 639,
            "text": "\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r"
          },
          {
            "lineNumber": 640,
            "text": "\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r"
          },
          {
            "lineNumber": 641,
            "text": "\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r"
          },
          {
            "lineNumber": 642,
            "text": "\r"
          },
          {
            "lineNumber": 643,
            "text": "\t\t\t// Provide a path to .mo files in /languages.\r"
          },
          {
            "lineNumber": 644,
            "text": "\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r"
          },
          {
            "lineNumber": 645,
            "text": "\r"
          },
          {
            "lineNumber": 646,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 647,
            "text": "\t\t\t * Create our post type and taxonomies\r"
          },
          {
            "lineNumber": 648,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 649,
            "text": "\r"
          },
          {
            "lineNumber": 650,
            "text": "\t\t\t// create a custom post type for the vehicles.\r"
          },
          {
            "lineNumber": 651,
            "text": "\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r"
          },
          {
            "lineNumber": 652,
            "text": "\r"
          },
          {
            "lineNumber": 653,
            "text": "\t\t\t// Give all administrator users full capabilities over the custom post type.\r"
          }
        ],
        "originalContents": "\r\n\t\t/**\r\n\t\t * Provides default values for the plugin settings stored in an option\r\n\t\t * with name INVP::OPTION_NAME.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic static function set_default_settings() {\r\n\t\t\t$settings = INVP::settings();\r\n\t\t\t// Do not overwrite taxonomies setting if it exists.\r\n\t\t\tif ( ! empty( $settings['taxonomies'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// If the old show_all_taxonomies is set, maintain that behavior.\r\n\t\t\t$show_menu = false;\r\n\t\t\tif ( isset( $settings['show_all_taxonomies'] ) ) {\r\n\t\t\t\t$show_menu = $settings['show_all_taxonomies'];\r\n\t\t\t\tunset( $settings['show_all_taxonomies'] );\r\n\t\t\t}\r\n\t\t\tif ( ! isset( $settings['taxonomies'] ) ) {\r\n\t\t\t\t$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );\r\n\t\t\t}\r\n\t\t\tupdate_option( INVP::OPTION_NAME, $settings );\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * This is the driver function of the entire plugin. Includes dependencies\r\n\t\t * and adds all hooks.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function add_hooks() {\r\n\t\t\t// Only do these things once.\r\n\t\t\tif ( has_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// include all this plugin's classes that live in external files.\r\n\t\t\t$this-\u003einclude_dependencies();\r\n\r\n\t\t\t// Ensure addon updaters are initialized in multisite.\r\n\t\t\tif ( class_exists( 'Inventory_Presser_Addon' ) ) {\r\n\t\t\t\tInventory_Presser_Addon::ensure_multisite_updaters();\r\n\t\t\t}\r\n\r\n\t\t\t// Prefix and unprefix meta keys with \"inventory_presser_\".\r\n\t\t\tadd_filter( 'invp_prefix_meta_key', array( 'INVP', 'translate_custom_field_names' ) );\r\n\t\t\tadd_filter( 'invp_unprefix_meta_key', array( 'INVP', 'untranslate_custom_field_names' ) );\r\n\r\n\t\t\t// Provide a path to .mo files in /languages.\r\n\t\t\tadd_action( 'init', array( $this, 'load_textdomain' ) );\r\n\r\n\t\t\t/**\r\n\t\t\t * Create our post type and taxonomies\r\n\t\t\t */\r\n\r\n\t\t\t// create a custom post type for the vehicles.\r\n\t\t\tadd_action( 'init', array( $this, 'create_post_type' ) );\r\n",
        "range": {
          "endPosition": {
            "line": 653
          },
          "startPosition": {
            "column": 3,
            "line": 589
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.268588662147522
    },
    {
      "codeBlock": {
        "contents": "public function remove_post_type_block_editor( $post_types ) {\n\t\t// Is this the block editor creating a new vehicle?\n\t\tglobal $pagenow;\n\t\tif ( ! is_admin()\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\n\t\t\t|| 'post-new.php' !== $pagenow ) {\n\t\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Is our post type managed by the Divi Builder?\n\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );\n\t\tif ( false === $index ) {\n\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Yes. Remove it from the list of post types to prevent the Divi nag.\n\t\tunset( $post_types[ $index ] );\n\t\treturn array_values( $post_types );\n\t}\n}\n",
        "detailedLines": [
          {
            "lineNumber": 126,
            "text": "\t * @return string[]"
          },
          {
            "lineNumber": 127,
            "text": "\t */"
          },
          {
            "lineNumber": 128,
            "text": "\tpublic function remove_post_type_block_editor( $post_types ) {"
          },
          {
            "lineNumber": 129,
            "text": "\t\t// Is this the block editor creating a new vehicle?"
          },
          {
            "lineNumber": 130,
            "text": "\t\tglobal $pagenow;"
          },
          {
            "lineNumber": 131,
            "text": "\t\tif ( ! is_admin()"
          },
          {
            "lineNumber": 132,
            "text": "\t\t\t|| get_post_type() !== INVP::POST_TYPE"
          },
          {
            "lineNumber": 133,
            "text": "\t\t\t|| 'post-new.php' !== $pagenow ) {"
          },
          {
            "lineNumber": 134,
            "text": "\t\t\t\t// No."
          },
          {
            "lineNumber": 135,
            "text": "\t\t\treturn $post_types;"
          },
          {
            "lineNumber": 136,
            "text": "\t\t}"
          },
          {
            "lineNumber": 137,
            "text": "\t\t// Is our post type managed by the Divi Builder?"
          },
          {
            "lineNumber": 138,
            "text": "\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );"
          },
          {
            "lineNumber": 139,
            "text": "\t\tif ( false === $index ) {"
          },
          {
            "lineNumber": 140,
            "text": "\t\t\t// No."
          },
          {
            "lineNumber": 141,
            "text": "\t\t\treturn $post_types;"
          },
          {
            "lineNumber": 142,
            "text": "\t\t}"
          },
          {
            "lineNumber": 143,
            "text": "\t\t// Yes. Remove it from the list of post types to prevent the Divi nag."
          },
          {
            "lineNumber": 144,
            "text": "\t\tunset( $post_types[ $index ] );"
          },
          {
            "lineNumber": 145,
            "text": "\t\treturn array_values( $post_types );"
          },
          {
            "lineNumber": 146,
            "text": "\t}"
          },
          {
            "lineNumber": 147,
            "text": "}"
          }
        ],
        "originalContents": "public function remove_post_type_block_editor( $post_types ) {\n\t\t// Is this the block editor creating a new vehicle?\n\t\tglobal $pagenow;\n\t\tif ( ! is_admin()\n\t\t\t|| get_post_type() !== INVP::POST_TYPE\n\t\t\t|| 'post-new.php' !== $pagenow ) {\n\t\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Is our post type managed by the Divi Builder?\n\t\t$index = array_search( INVP::POST_TYPE, $post_types, true );\n\t\tif ( false === $index ) {\n\t\t\t// No.\n\t\t\treturn $post_types;\n\t\t}\n\t\t// Yes. Remove it from the list of post types to prevent the Divi nag.\n\t\tunset( $post_types[ $index ] );\n\t\treturn array_values( $post_types );\n\t}\n}\n",
        "range": {
          "endPosition": {
            "line": 147
          },
          "startPosition": {
            "line": 125
          }
        },
        "relativeWorkspacePath": "includes/integrations/class-divi.php"
      },
      "score": 0.2655237317085266
    },
    {
      "codeBlock": {
        "contents": "\r\n\t/**\r\n\t * Outputs HTML that renders a meta box for the type taxonomy\r\n\t *\r\n\t * @param  WP_Post $post Current post object.\r\n\t * @return void\r\n\t */\r\n\tpublic static function meta_box_html_type( $post ) {\r\n\t\t$taxonomy = 'type';\r\n\t\t$html     = sprintf(\r\n\t\t\t'%1$s \u003ca href=\"edit-tags.php?taxonomy=%2$s\u0026post_type=%3$s\"\u003e%4$s\u003c/a\u003e',\r\n\t\t\tself::taxonomy_meta_box_html( $taxonomy, apply_filters( 'invp_prefix_meta_key', $taxonomy ), $post ),\r\n\t\t\tesc_attr( $taxonomy ),\r\n\t\t\tesc_attr( INVP::POST_TYPE ),\r\n\t\t\tesc_html__( 'Manage', 'inventory-presser' )\r\n\t\t);\r\n\t\t// add an onchange attribute to the select.\r\n\t\t$html = str_replace( '\u003cselect', '\u003cselect onchange=\"invp_vehicle_type_changed( this.value );\" ', $html );\r\n\t\techo $html;\r\n\t}\r\n\r\n\t/**\r\n\t * Populate our taxonomies with terms if they do not already exist\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic static function populate_default_terms() {\r\n\t\t// create the taxonomies or else our wp_insert_term calls will fail.\r\n\t\tself::register_taxonomies();\r\n\r\n\t\t$taxonomy_data = self::taxonomy_data();\r\n\t\t$count         = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\tif ( ! isset( $taxonomy_data[ $i ]['term_data'] ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $taxonomy_data[ $i ]['term_data'] as $abbr =\u003e $desc ) {\r\n\t\t\t\t$taxonomy_name = str_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ?? '' );\r\n\t\t\t\tif ( ! is_array( term_exists( $desc, $taxonomy_name ) ) ) {\r\n\t\t\t\t\t$term_exists = wp_insert_term(\r\n\t\t\t\t\t\t$desc,\r\n\t\t\t\t\t\t$taxonomy_name,\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'description' =\u003e $desc,\r\n\t\t\t\t\t\t\t'slug'        =\u003e $abbr,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 230,
            "text": "\t\t\tesc_html__( 'Manage', 'inventory-presser' )\r"
          },
          {
            "lineNumber": 231,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 232,
            "text": "\t}\r"
          },
          {
            "lineNumber": 233,
            "text": "\r"
          },
          {
            "lineNumber": 234,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 235,
            "text": "\t * Outputs HTML that renders a meta box for the type taxonomy\r"
          },
          {
            "lineNumber": 236,
            "text": "\t *\r"
          },
          {
            "lineNumber": 237,
            "text": "\t * @param  WP_Post $post Current post object.\r"
          },
          {
            "lineNumber": 238,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 239,
            "text": "\t */\r"
          },
          {
            "lineNumber": 240,
            "text": "\tpublic static function meta_box_html_type( $post ) {\r"
          },
          {
            "lineNumber": 241,
            "text": "\t\t$taxonomy = 'type';\r"
          },
          {
            "lineNumber": 242,
            "text": "\t\t$html     = sprintf(\r"
          },
          {
            "lineNumber": 243,
            "text": "\t\t\t'%1$s \u003ca href=\"edit-tags.php?taxonomy=%2$s\u0026post_type=%3$s\"\u003e%4$s\u003c/a\u003e',\r"
          },
          {
            "lineNumber": 244,
            "text": "\t\t\tself::taxonomy_meta_box_html( $taxonomy, apply_filters( 'invp_prefix_meta_key', $taxonomy ), $post ),\r"
          },
          {
            "lineNumber": 245,
            "text": "\t\t\tesc_attr( $taxonomy ),\r"
          },
          {
            "lineNumber": 246,
            "text": "\t\t\tesc_attr( INVP::POST_TYPE ),\r"
          },
          {
            "lineNumber": 247,
            "text": "\t\t\tesc_html__( 'Manage', 'inventory-presser' )\r"
          },
          {
            "lineNumber": 248,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 249,
            "text": "\t\t// add an onchange attribute to the select.\r"
          },
          {
            "lineNumber": 250,
            "text": "\t\t$html = str_replace( '\u003cselect', '\u003cselect onchange=\"invp_vehicle_type_changed( this.value );\" ', $html );\r"
          },
          {
            "lineNumber": 251,
            "text": "\t\techo $html;\r"
          },
          {
            "lineNumber": 252,
            "text": "\t}\r"
          },
          {
            "lineNumber": 253,
            "text": "\r"
          },
          {
            "lineNumber": 254,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 255,
            "text": "\t * Populate our taxonomies with terms if they do not already exist\r"
          },
          {
            "lineNumber": 256,
            "text": "\t *\r"
          },
          {
            "lineNumber": 257,
            "text": "\t * @return void\r"
          },
          {
            "lineNumber": 258,
            "text": "\t */\r"
          },
          {
            "lineNumber": 259,
            "text": "\tpublic static function populate_default_terms() {\r"
          },
          {
            "lineNumber": 260,
            "text": "\t\t// create the taxonomies or else our wp_insert_term calls will fail.\r"
          },
          {
            "lineNumber": 261,
            "text": "\t\tself::register_taxonomies();\r"
          },
          {
            "lineNumber": 262,
            "text": "\r"
          },
          {
            "lineNumber": 263,
            "text": "\t\t$taxonomy_data = self::taxonomy_data();\r"
          },
          {
            "lineNumber": 264,
            "text": "\t\t$count         = count( $taxonomy_data );\r"
          },
          {
            "lineNumber": 265,
            "text": "\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r"
          },
          {
            "lineNumber": 266,
            "text": "\t\t\tif ( ! isset( $taxonomy_data[ $i ]['term_data'] ) ) {\r"
          },
          {
            "lineNumber": 267,
            "text": "\t\t\t\tcontinue;\r"
          },
          {
            "lineNumber": 268,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 269,
            "text": "\r"
          },
          {
            "lineNumber": 270,
            "text": "\t\t\tforeach ( $taxonomy_data[ $i ]['term_data'] as $abbr =\u003e $desc ) {\r"
          },
          {
            "lineNumber": 271,
            "text": "\t\t\t\t$taxonomy_name = str_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ?? '' );\r"
          },
          {
            "lineNumber": 272,
            "text": "\t\t\t\tif ( ! is_array( term_exists( $desc, $taxonomy_name ) ) ) {\r"
          },
          {
            "lineNumber": 273,
            "text": "\t\t\t\t\t$term_exists = wp_insert_term(\r"
          },
          {
            "lineNumber": 274,
            "text": "\t\t\t\t\t\t$desc,\r"
          },
          {
            "lineNumber": 275,
            "text": "\t\t\t\t\t\t$taxonomy_name,\r"
          },
          {
            "lineNumber": 276,
            "text": "\t\t\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 277,
            "text": "\t\t\t\t\t\t\t'description' =\u003e $desc,\r"
          },
          {
            "lineNumber": 278,
            "text": "\t\t\t\t\t\t\t'slug'        =\u003e $abbr,\r"
          },
          {
            "lineNumber": 279,
            "text": "\t\t\t\t\t\t)\r"
          },
          {
            "lineNumber": 280,
            "text": "\t\t\t\t\t);\r"
          },
          {
            "lineNumber": 281,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 282,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 283,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 284,
            "text": "\t}\r"
          },
          {
            "lineNumber": 285,
            "text": "\r"
          },
          {
            "lineNumber": 286,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 287,
            "text": "\t "
          }
        ],
        "originalContents": "\r\n\t/**\r\n\t * Outputs HTML that renders a meta box for the type taxonomy\r\n\t *\r\n\t * @param  WP_Post $post Current post object.\r\n\t * @return void\r\n\t */\r\n\tpublic static function meta_box_html_type( $post ) {\r\n\t\t$taxonomy = 'type';\r\n\t\t$html     = sprintf(\r\n\t\t\t'%1$s \u003ca href=\"edit-tags.php?taxonomy=%2$s\u0026post_type=%3$s\"\u003e%4$s\u003c/a\u003e',\r\n\t\t\tself::taxonomy_meta_box_html( $taxonomy, apply_filters( 'invp_prefix_meta_key', $taxonomy ), $post ),\r\n\t\t\tesc_attr( $taxonomy ),\r\n\t\t\tesc_attr( INVP::POST_TYPE ),\r\n\t\t\tesc_html__( 'Manage', 'inventory-presser' )\r\n\t\t);\r\n\t\t// add an onchange attribute to the select.\r\n\t\t$html = str_replace( '\u003cselect', '\u003cselect onchange=\"invp_vehicle_type_changed( this.value );\" ', $html );\r\n\t\techo $html;\r\n\t}\r\n\r\n\t/**\r\n\t * Populate our taxonomies with terms if they do not already exist\r\n\t *\r\n\t * @return void\r\n\t */\r\n\tpublic static function populate_default_terms() {\r\n\t\t// create the taxonomies or else our wp_insert_term calls will fail.\r\n\t\tself::register_taxonomies();\r\n\r\n\t\t$taxonomy_data = self::taxonomy_data();\r\n\t\t$count         = count( $taxonomy_data );\r\n\t\tfor ( $i = 0; $i \u003c $count; $i++ ) {\r\n\t\t\tif ( ! isset( $taxonomy_data[ $i ]['term_data'] ) ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $taxonomy_data[ $i ]['term_data'] as $abbr =\u003e $desc ) {\r\n\t\t\t\t$taxonomy_name = str_replace( '-', '_', $taxonomy_data[ $i ]['args']['query_var'] ?? '' );\r\n\t\t\t\tif ( ! is_array( term_exists( $desc, $taxonomy_name ) ) ) {\r\n\t\t\t\t\t$term_exists = wp_insert_term(\r\n\t\t\t\t\t\t$desc,\r\n\t\t\t\t\t\t$taxonomy_name,\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'description' =\u003e $desc,\r\n\t\t\t\t\t\t\t'slug'        =\u003e $abbr,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n",
        "range": {
          "endPosition": {
            "column": 2,
            "line": 286
          },
          "startPosition": {
            "line": 229
          }
        },
        "relativeWorkspacePath": "includes/class-taxonomies.php"
      },
      "score": 0.26270896196365356
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {\r\n\t\t\t\treturn $value;\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\tthe_content( null, false, $object_id );\r\n\t\t\t$content = ob_get_clean();\r\n\r\n\t\t\tif ( empty( $content ) ) {\r\n\t\t\t\treturn $value;\r\n\t\t\t}\r\n\r\n\t\t\treturn array( $content );\r\n\t\t}\r\n\t}\r\n}\r\n",
        "detailedLines": [
          {
            "lineNumber": 155,
            "text": "// No.\r"
          },
          {
            "lineNumber": 156,
            "text": "\t\t\t\treturn $value;\r"
          },
          {
            "lineNumber": 157,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 158,
            "text": "\r"
          },
          {
            "lineNumber": 159,
            "text": "\t\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {\r"
          },
          {
            "lineNumber": 160,
            "text": "\t\t\t\treturn $value;\r"
          },
          {
            "lineNumber": 161,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 162,
            "text": "\r"
          },
          {
            "lineNumber": 163,
            "text": "\t\t\tob_start();\r"
          },
          {
            "lineNumber": 164,
            "text": "\t\t\tthe_content( null, false, $object_id );\r"
          },
          {
            "lineNumber": 165,
            "text": "\t\t\t$content = ob_get_clean();\r"
          },
          {
            "lineNumber": 166,
            "text": "\r"
          },
          {
            "lineNumber": 167,
            "text": "\t\t\tif ( empty( $content ) ) {\r"
          },
          {
            "lineNumber": 168,
            "text": "\t\t\t\treturn $value;\r"
          },
          {
            "lineNumber": 169,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 170,
            "text": "\r"
          },
          {
            "lineNumber": 171,
            "text": "\t\t\treturn array( $content );\r"
          },
          {
            "lineNumber": 172,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 173,
            "text": "\t}\r"
          },
          {
            "lineNumber": 174,
            "text": "}\r"
          }
        ],
        "originalContents": "\r\n\t\t\tif ( INVP::POST_TYPE !== get_post_type( $object_id ) ) {\r\n\t\t\t\treturn $value;\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\tthe_content( null, false, $object_id );\r\n\t\t\t$content = ob_get_clean();\r\n\r\n\t\t\tif ( empty( $content ) ) {\r\n\t\t\t\treturn $value;\r\n\t\t\t}\r\n\r\n\t\t\treturn array( $content );\r\n\t\t}\r\n\t}\r\n}\r\n",
        "range": {
          "endPosition": {
            "line": 174
          },
          "startPosition": {
            "column": 4,
            "line": 154
          }
        },
        "relativeWorkspacePath": "includes/class-template-provider.php"
      },
      "score": 0.25409719347953796
    },
    {
      "codeBlock": {
        "contents": "\r\n\t/**\r\n\t * If no parameter is provided, returns an array containing lowercase\r\n\t * weekdays as keys and title case, three-letter abbreviations as values.\r\n\t * If a valid parameter is provided, returns the lowercase day name\r\n\t * it identifies. If an invalid parameter is provided, returns false.\r\n\t *\r\n\t * @param  int $zero_through_six A number between 0 and 6 to identify a single day to return as a string.\r\n\t * @return string|Array|false\r\n\t */\r\n\tpublic static function weekdays( $zero_through_six = null ) {\r\n\t\t$days = array(\r\n\t\t\t'monday'    =\u003e __( 'Mon', 'inventory-presser' ),\r\n\t\t\t'tuesday'   =\u003e __( 'Tue', 'inventory-presser' ),\r\n\t\t\t'wednesday' =\u003e __( 'Wed', 'inventory-presser' ),\r\n\t\t\t'thursday'  =\u003e __( 'Thu', 'inventory-presser' ),\r\n\t\t\t'friday'    =\u003e __( 'Fri', 'inventory-presser' ),\r\n\t\t\t'saturday'  =\u003e __( 'Sat', 'inventory-presser' ),\r\n\t\t\t'sunday'    =\u003e __( 'Sun', 'inventory-presser' ),\r\n\t\t);\r\n\r\n\t\t/**\r\n\t\t * If a valid parameter is provided, return the lowercase day name\r\n\t\t * it identifies.\r\n\t\t */\r\n\t\tif ( null !== $zero_through_six ) {\r\n\t\t\tif ( 0 \u003c= $zero_through_six \u0026\u0026 6 \u003e= $zero_through_six ) {\r\n\t\t\t\treturn array_keys( $days )[ $zero_through_six ];\r\n\t\t\t} else {\r\n\t\t\t\t// If an invalid parameter is provided, return false.\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $days;\r\n\t}\r\n\r\n\t/**\r\n\t * This is a wrapper for wp_count_posts() and counts all vehicle posts.\r\n\t *\r\n\t * @return int\r\n\t */\r\n\tpublic static function vehicle_count() {\r\n\t\t$vehicle_counts = wp_count_posts( self::POST_TYPE );\r\n\t\tif ( empty( $vehicle_counts-\u003epublish ) ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn $vehicle_counts-\u003epublish;\r\n\t}\r\n}\r\n",
        "detailedLines": [
          {
            "lineNumber": 1365,
            "text": "\r"
          },
          {
            "lineNumber": 1366,
            "text": "\t\treturn $meta_key;\r"
          },
          {
            "lineNumber": 1367,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1368,
            "text": "\r"
          },
          {
            "lineNumber": 1369,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1370,
            "text": "\t * If no parameter is provided, returns an array containing lowercase\r"
          },
          {
            "lineNumber": 1371,
            "text": "\t * weekdays as keys and title case, three-letter abbreviations as values.\r"
          },
          {
            "lineNumber": 1372,
            "text": "\t * If a valid parameter is provided, returns the lowercase day name\r"
          },
          {
            "lineNumber": 1373,
            "text": "\t * it identifies. If an invalid parameter is provided, returns false.\r"
          },
          {
            "lineNumber": 1374,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1375,
            "text": "\t * @param  int $zero_through_six A number between 0 and 6 to identify a single day to return as a string.\r"
          },
          {
            "lineNumber": 1376,
            "text": "\t * @return string|Array|false\r"
          },
          {
            "lineNumber": 1377,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1378,
            "text": "\tpublic static function weekdays( $zero_through_six = null ) {\r"
          },
          {
            "lineNumber": 1379,
            "text": "\t\t$days = array(\r"
          },
          {
            "lineNumber": 1380,
            "text": "\t\t\t'monday'    =\u003e __( 'Mon', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1381,
            "text": "\t\t\t'tuesday'   =\u003e __( 'Tue', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1382,
            "text": "\t\t\t'wednesday' =\u003e __( 'Wed', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1383,
            "text": "\t\t\t'thursday'  =\u003e __( 'Thu', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1384,
            "text": "\t\t\t'friday'    =\u003e __( 'Fri', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1385,
            "text": "\t\t\t'saturday'  =\u003e __( 'Sat', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1386,
            "text": "\t\t\t'sunday'    =\u003e __( 'Sun', 'inventory-presser' ),\r"
          },
          {
            "lineNumber": 1387,
            "text": "\t\t);\r"
          },
          {
            "lineNumber": 1388,
            "text": "\r"
          },
          {
            "lineNumber": 1389,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1390,
            "text": "\t\t * If a valid parameter is provided, return the lowercase day name\r"
          },
          {
            "lineNumber": 1391,
            "text": "\t\t * it identifies.\r"
          },
          {
            "lineNumber": 1392,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1393,
            "text": "\t\tif ( null !== $zero_through_six ) {\r"
          },
          {
            "lineNumber": 1394,
            "text": "\t\t\tif ( 0 \u003c= $zero_through_six \u0026\u0026 6 \u003e= $zero_through_six ) {\r"
          },
          {
            "lineNumber": 1395,
            "text": "\t\t\t\treturn array_keys( $days )[ $zero_through_six ];\r"
          },
          {
            "lineNumber": 1396,
            "text": "\t\t\t} else {\r"
          },
          {
            "lineNumber": 1397,
            "text": "\t\t\t\t// If an invalid parameter is provided, return false.\r"
          },
          {
            "lineNumber": 1398,
            "text": "\t\t\t\treturn false;\r"
          },
          {
            "lineNumber": 1399,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1400,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1401,
            "text": "\r"
          },
          {
            "lineNumber": 1402,
            "text": "\t\treturn $days;\r"
          },
          {
            "lineNumber": 1403,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1404,
            "text": "\r"
          },
          {
            "lineNumber": 1405,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 1406,
            "text": "\t * This is a wrapper for wp_count_posts() and counts all vehicle posts.\r"
          },
          {
            "lineNumber": 1407,
            "text": "\t *\r"
          },
          {
            "lineNumber": 1408,
            "text": "\t * @return int\r"
          },
          {
            "lineNumber": 1409,
            "text": "\t */\r"
          },
          {
            "lineNumber": 1410,
            "text": "\tpublic static function vehicle_count() {\r"
          },
          {
            "lineNumber": 1411,
            "text": "\t\t$vehicle_counts = wp_count_posts( self::POST_TYPE );\r"
          },
          {
            "lineNumber": 1412,
            "text": "\t\tif ( empty( $vehicle_counts-\u003epublish ) ) {\r"
          },
          {
            "lineNumber": 1413,
            "text": "\t\t\treturn 0;\r"
          },
          {
            "lineNumber": 1414,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1415,
            "text": "\t\treturn $vehicle_counts-\u003epublish;\r"
          },
          {
            "lineNumber": 1416,
            "text": "\t}\r"
          },
          {
            "lineNumber": 1417,
            "text": "}\r"
          }
        ],
        "originalContents": "\r\n\t/**\r\n\t * If no parameter is provided, returns an array containing lowercase\r\n\t * weekdays as keys and title case, three-letter abbreviations as values.\r\n\t * If a valid parameter is provided, returns the lowercase day name\r\n\t * it identifies. If an invalid parameter is provided, returns false.\r\n\t *\r\n\t * @param  int $zero_through_six A number between 0 and 6 to identify a single day to return as a string.\r\n\t * @return string|Array|false\r\n\t */\r\n\tpublic static function weekdays( $zero_through_six = null ) {\r\n\t\t$days = array(\r\n\t\t\t'monday'    =\u003e __( 'Mon', 'inventory-presser' ),\r\n\t\t\t'tuesday'   =\u003e __( 'Tue', 'inventory-presser' ),\r\n\t\t\t'wednesday' =\u003e __( 'Wed', 'inventory-presser' ),\r\n\t\t\t'thursday'  =\u003e __( 'Thu', 'inventory-presser' ),\r\n\t\t\t'friday'    =\u003e __( 'Fri', 'inventory-presser' ),\r\n\t\t\t'saturday'  =\u003e __( 'Sat', 'inventory-presser' ),\r\n\t\t\t'sunday'    =\u003e __( 'Sun', 'inventory-presser' ),\r\n\t\t);\r\n\r\n\t\t/**\r\n\t\t * If a valid parameter is provided, return the lowercase day name\r\n\t\t * it identifies.\r\n\t\t */\r\n\t\tif ( null !== $zero_through_six ) {\r\n\t\t\tif ( 0 \u003c= $zero_through_six \u0026\u0026 6 \u003e= $zero_through_six ) {\r\n\t\t\t\treturn array_keys( $days )[ $zero_through_six ];\r\n\t\t\t} else {\r\n\t\t\t\t// If an invalid parameter is provided, return false.\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $days;\r\n\t}\r\n\r\n\t/**\r\n\t * This is a wrapper for wp_count_posts() and counts all vehicle posts.\r\n\t *\r\n\t * @return int\r\n\t */\r\n\tpublic static function vehicle_count() {\r\n\t\t$vehicle_counts = wp_count_posts( self::POST_TYPE );\r\n\t\tif ( empty( $vehicle_counts-\u003epublish ) ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn $vehicle_counts-\u003epublish;\r\n\t}\r\n}\r\n",
        "range": {
          "endPosition": {
            "line": 1417
          },
          "startPosition": {
            "line": 1364
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.2507534921169281
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t/**\r\n\t\t * Registers all meta fields our custom post type uses to define a vehicle\r\n\t\t * and its attachments.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function register_meta_fields() {\r\n\t\t\t// Add meta fields to our post type.\r\n\t\t\tforeach ( INVP::keys_and_types( true ) as $key_arr ) {\r\n\r\n\t\t\t\tif ( empty( $key_arr['name'] ) ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r\n\t\t\t\tregister_post_meta(\r\n\t\t\t\t\tINVP::POST_TYPE,\r\n\t\t\t\t\t$key,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'show_in_rest' =\u003e true,\r\n\t\t\t\t\t\t'single'       =\u003e 'options_array' !== $key_arr['name'],\r\n\t\t\t\t\t\t'type'         =\u003e $key_arr['type'] ?? 'string',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// Add a couple fields that are used on media attachments.\r\n\t\t\t$attachment_keys   = array();\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'hash',\r\n\t\t\t\t'type' =\u003e 'string',\r\n\t\t\t);\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'photo_number',\r\n\t\t\t\t'type' =\u003e 'integer',\r\n\t\t\t);\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'vin',\r\n\t\t\t\t'type' =\u003e 'string',\r\n\t\t\t);\r\n\r\n\t\t\t// Add meta fields to attachments.\r\n\t\t\tforeach ( $attachment_keys as $key_arr ) {\r\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r\n\t\t\t\tregister_post_meta(\r\n\t\t\t\t\t'attachment',\r\n\t\t\t\t\t$key,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'sanitize_callback' =\u003e 'sanitize_text_field',\r\n\t\t\t\t\t\t'show_in_rest'      =\u003e true,\r\n\t\t\t\t\t\t'single'            =\u003e true,\r\n\t\t\t\t\t\t'type'              =\u003e $key_arr['type'],\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers every widget that ships with this plugin.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function register_widgets() {\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to sort vehicles by post meta fields.\r\n\t\t\t * Or, enable order by year, make, price, odometer, etc.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Order_By_Widget' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to show EPA Fuel Economy data\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Fuel_Economy_Widget' );\r\n",
        "detailedLines": [
          {
            "lineNumber": 1693,
            "text": "\r"
          },
          {
            "lineNumber": 1694,
            "text": "\t\t\t// force delete.\r"
          },
          {
            "lineNumber": 1695,
            "text": "\t\t\twp_delete_post( $post_id, true );\r"
          },
          {
            "lineNumber": 1696,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1697,
            "text": "\r"
          },
          {
            "lineNumber": 1698,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1699,
            "text": "\t\t * Registers all meta fields our custom post type uses to define a vehicle\r"
          },
          {
            "lineNumber": 1700,
            "text": "\t\t * and its attachments.\r"
          },
          {
            "lineNumber": 1701,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1702,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 1703,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1704,
            "text": "\t\tpublic function register_meta_fields() {\r"
          },
          {
            "lineNumber": 1705,
            "text": "\t\t\t// Add meta fields to our post type.\r"
          },
          {
            "lineNumber": 1706,
            "text": "\t\t\tforeach ( INVP::keys_and_types( true ) as $key_arr ) {\r"
          },
          {
            "lineNumber": 1707,
            "text": "\r"
          },
          {
            "lineNumber": 1708,
            "text": "\t\t\t\tif ( empty( $key_arr['name'] ) ) {\r"
          },
          {
            "lineNumber": 1709,
            "text": "\t\t\t\t\tcontinue;\r"
          },
          {
            "lineNumber": 1710,
            "text": "\t\t\t\t}\r"
          },
          {
            "lineNumber": 1711,
            "text": "\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r"
          },
          {
            "lineNumber": 1712,
            "text": "\t\t\t\tregister_post_meta(\r"
          },
          {
            "lineNumber": 1713,
            "text": "\t\t\t\t\tINVP::POST_TYPE,\r"
          },
          {
            "lineNumber": 1714,
            "text": "\t\t\t\t\t$key,\r"
          },
          {
            "lineNumber": 1715,
            "text": "\t\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 1716,
            "text": "\t\t\t\t\t\t'show_in_rest' =\u003e true,\r"
          },
          {
            "lineNumber": 1717,
            "text": "\t\t\t\t\t\t'single'       =\u003e 'options_array' !== $key_arr['name'],\r"
          },
          {
            "lineNumber": 1718,
            "text": "\t\t\t\t\t\t'type'         =\u003e $key_arr['type'] ?? 'string',\r"
          },
          {
            "lineNumber": 1719,
            "text": "\t\t\t\t\t)\r"
          },
          {
            "lineNumber": 1720,
            "text": "\t\t\t\t);\r"
          },
          {
            "lineNumber": 1721,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1722,
            "text": "\r"
          },
          {
            "lineNumber": 1723,
            "text": "\t\t\t// Add a couple fields that are used on media attachments.\r"
          },
          {
            "lineNumber": 1724,
            "text": "\t\t\t$attachment_keys   = array();\r"
          },
          {
            "lineNumber": 1725,
            "text": "\t\t\t$attachment_keys[] = array(\r"
          },
          {
            "lineNumber": 1726,
            "text": "\t\t\t\t'name' =\u003e 'hash',\r"
          },
          {
            "lineNumber": 1727,
            "text": "\t\t\t\t'type' =\u003e 'string',\r"
          },
          {
            "lineNumber": 1728,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1729,
            "text": "\t\t\t$attachment_keys[] = array(\r"
          },
          {
            "lineNumber": 1730,
            "text": "\t\t\t\t'name' =\u003e 'photo_number',\r"
          },
          {
            "lineNumber": 1731,
            "text": "\t\t\t\t'type' =\u003e 'integer',\r"
          },
          {
            "lineNumber": 1732,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1733,
            "text": "\t\t\t$attachment_keys[] = array(\r"
          },
          {
            "lineNumber": 1734,
            "text": "\t\t\t\t'name' =\u003e 'vin',\r"
          },
          {
            "lineNumber": 1735,
            "text": "\t\t\t\t'type' =\u003e 'string',\r"
          },
          {
            "lineNumber": 1736,
            "text": "\t\t\t);\r"
          },
          {
            "lineNumber": 1737,
            "text": "\r"
          },
          {
            "lineNumber": 1738,
            "text": "\t\t\t// Add meta fields to attachments.\r"
          },
          {
            "lineNumber": 1739,
            "text": "\t\t\tforeach ( $attachment_keys as $key_arr ) {\r"
          },
          {
            "lineNumber": 1740,
            "text": "\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r"
          },
          {
            "lineNumber": 1741,
            "text": "\t\t\t\tregister_post_meta(\r"
          },
          {
            "lineNumber": 1742,
            "text": "\t\t\t\t\t'attachment',\r"
          },
          {
            "lineNumber": 1743,
            "text": "\t\t\t\t\t$key,\r"
          },
          {
            "lineNumber": 1744,
            "text": "\t\t\t\t\tarray(\r"
          },
          {
            "lineNumber": 1745,
            "text": "\t\t\t\t\t\t'sanitize_callback' =\u003e 'sanitize_text_field',\r"
          },
          {
            "lineNumber": 1746,
            "text": "\t\t\t\t\t\t'show_in_rest'      =\u003e true,\r"
          },
          {
            "lineNumber": 1747,
            "text": "\t\t\t\t\t\t'single'            =\u003e true,\r"
          },
          {
            "lineNumber": 1748,
            "text": "\t\t\t\t\t\t'type'              =\u003e $key_arr['type'],\r"
          },
          {
            "lineNumber": 1749,
            "text": "\t\t\t\t\t)\r"
          },
          {
            "lineNumber": 1750,
            "text": "\t\t\t\t);\r"
          },
          {
            "lineNumber": 1751,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1752,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 1753,
            "text": "\r"
          },
          {
            "lineNumber": 1754,
            "text": "\t\t/**\r"
          },
          {
            "lineNumber": 1755,
            "text": "\t\t * Registers every widget that ships with this plugin.\r"
          },
          {
            "lineNumber": 1756,
            "text": "\t\t *\r"
          },
          {
            "lineNumber": 1757,
            "text": "\t\t * @return void\r"
          },
          {
            "lineNumber": 1758,
            "text": "\t\t */\r"
          },
          {
            "lineNumber": 1759,
            "text": "\t\tpublic function register_widgets() {\r"
          },
          {
            "lineNumber": 1760,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1761,
            "text": "\t\t\t * Make a widget available to sort vehicles by post meta fields.\r"
          },
          {
            "lineNumber": 1762,
            "text": "\t\t\t * Or, enable order by year, make, price, odometer, etc.\r"
          },
          {
            "lineNumber": 1763,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1764,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Order_By_Widget' );\r"
          },
          {
            "lineNumber": 1765,
            "text": "\r"
          },
          {
            "lineNumber": 1766,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1767,
            "text": "\t\t\t * Make a widget available to show EPA Fuel Economy data\r"
          },
          {
            "lineNumber": 1768,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1769,
            "text": "\t\t\tregister_widget( 'Inventory_Presser_Fuel_Economy_Widget' );\r"
          },
          {
            "lineNumber": 1770,
            "text": "\r"
          },
          {
            "lineNumber": 1771,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1772,
            "text": "\t\t\t * Make a widget available to embed a Google map pointed at one of\r"
          }
        ],
        "originalContents": "\r\n\t\t/**\r\n\t\t * Registers all meta fields our custom post type uses to define a vehicle\r\n\t\t * and its attachments.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function register_meta_fields() {\r\n\t\t\t// Add meta fields to our post type.\r\n\t\t\tforeach ( INVP::keys_and_types( true ) as $key_arr ) {\r\n\r\n\t\t\t\tif ( empty( $key_arr['name'] ) ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r\n\t\t\t\tregister_post_meta(\r\n\t\t\t\t\tINVP::POST_TYPE,\r\n\t\t\t\t\t$key,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'show_in_rest' =\u003e true,\r\n\t\t\t\t\t\t'single'       =\u003e 'options_array' !== $key_arr['name'],\r\n\t\t\t\t\t\t'type'         =\u003e $key_arr['type'] ?? 'string',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// Add a couple fields that are used on media attachments.\r\n\t\t\t$attachment_keys   = array();\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'hash',\r\n\t\t\t\t'type' =\u003e 'string',\r\n\t\t\t);\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'photo_number',\r\n\t\t\t\t'type' =\u003e 'integer',\r\n\t\t\t);\r\n\t\t\t$attachment_keys[] = array(\r\n\t\t\t\t'name' =\u003e 'vin',\r\n\t\t\t\t'type' =\u003e 'string',\r\n\t\t\t);\r\n\r\n\t\t\t// Add meta fields to attachments.\r\n\t\t\tforeach ( $attachment_keys as $key_arr ) {\r\n\t\t\t\t$key = apply_filters( 'invp_prefix_meta_key', $key_arr['name'] );\r\n\t\t\t\tregister_post_meta(\r\n\t\t\t\t\t'attachment',\r\n\t\t\t\t\t$key,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'sanitize_callback' =\u003e 'sanitize_text_field',\r\n\t\t\t\t\t\t'show_in_rest'      =\u003e true,\r\n\t\t\t\t\t\t'single'            =\u003e true,\r\n\t\t\t\t\t\t'type'              =\u003e $key_arr['type'],\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Registers every widget that ships with this plugin.\r\n\t\t *\r\n\t\t * @return void\r\n\t\t */\r\n\t\tpublic function register_widgets() {\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to sort vehicles by post meta fields.\r\n\t\t\t * Or, enable order by year, make, price, odometer, etc.\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Order_By_Widget' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Make a widget available to show EPA Fuel Economy data\r\n\t\t\t */\r\n\t\t\tregister_widget( 'Inventory_Presser_Fuel_Economy_Widget' );\r\n",
        "range": {
          "endPosition": {
            "line": 1772
          },
          "startPosition": {
            "line": 1692
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.24497880041599274
    },
    {
      "codeBlock": {
        "contents": "\r\n\t\t\t// is this a vehicle?\r\n\t\t\tif ( ! empty( $_POST['post_type'] ) \u0026\u0026 INVP::POST_TYPE !== $_POST['post_type'] ) {\r\n\t\t\t\t// no, don't create any meta data for vehicles.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Tick the last modified date of this vehicle since we're saving changes.\r\n\t\t\t * It looks like this: Tue, 06 Sep 2016 09:26:12 -0400\r\n\t\t\t */\r\n\t\t\t$offset           = sprintf( '%+03d00', intval( get_option( 'gmt_offset' ) ) );\r\n\t\t\t$timestamp_format = 'D, d M Y h:i:s';\r\n\t\t\t// use post_modified to set last_modified.\r\n\t\t\t$post_modified = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_modified );\r\n\t\t\t$timestamp     = $post_modified-\u003eformat( $timestamp_format ) . ' ' . $offset;\r\n\t\t\t$key           = apply_filters( 'invp_prefix_meta_key', 'last_modified' );\r\n\t\t\tdelete_post_meta( $post_id, $key );\r\n\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r\n\r\n\t\t\t/**\r\n\t\t\t * If this is not an update or there is no date entered post meta value,\r\n\t\t\t * set the date_entered meta value using the post_date\r\n\t\t\t */\r\n\t\t\tif ( ! $is_update || empty( INVP::get_meta( 'date_entered', $post_id ) ) ) {\r\n\t\t\t\t// use post_date to set date_entered.\r\n\t\t\t\t$post_date = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_date );\r\n\t\t\t\t$timestamp = $post_date-\u003eformat( $timestamp_format ) . ' ' . $offset;\r\n\t\t\t\t$key       = apply_filters( 'invp_prefix_meta_key', 'date_entered' );\r\n\t\t\t\tdelete_post_meta( $post_id, $key );\r\n\t\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r\n\t\t\t}\r\n\r\n\t\t\tif ( empty( $_POST ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Clear this value that is defined by a checkbox.\r\n\t\t\tupdate_post_meta( $post_id, apply_filters( 'invp_prefix_meta_key', 'featured' ), '0' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Loop over the post meta keys we manage and save their values\r\n\t\t\t * if we find them coming over as part of the post to save.\r\n\t\t\t */\r\n\t\t\t$keys   = INVP::keys();\r\n\t\t\t$keys[] = 'options_array';\r\n",
        "detailedLines": [
          {
            "lineNumber": 1827,
            "text": "|| ( defined( 'DOING_AJAX' ) \u0026\u0026 DOING_AJAX )\r"
          },
          {
            "lineNumber": 1828,
            "text": "\t\t\t) {\r"
          },
          {
            "lineNumber": 1829,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1830,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1831,
            "text": "\r"
          },
          {
            "lineNumber": 1832,
            "text": "\t\t\t// is this a vehicle?\r"
          },
          {
            "lineNumber": 1833,
            "text": "\t\t\tif ( ! empty( $_POST['post_type'] ) \u0026\u0026 INVP::POST_TYPE !== $_POST['post_type'] ) {\r"
          },
          {
            "lineNumber": 1834,
            "text": "\t\t\t\t// no, don't create any meta data for vehicles.\r"
          },
          {
            "lineNumber": 1835,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1836,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1837,
            "text": "\r"
          },
          {
            "lineNumber": 1838,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1839,
            "text": "\t\t\t * Tick the last modified date of this vehicle since we're saving changes.\r"
          },
          {
            "lineNumber": 1840,
            "text": "\t\t\t * It looks like this: Tue, 06 Sep 2016 09:26:12 -0400\r"
          },
          {
            "lineNumber": 1841,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1842,
            "text": "\t\t\t$offset           = sprintf( '%+03d00', intval( get_option( 'gmt_offset' ) ) );\r"
          },
          {
            "lineNumber": 1843,
            "text": "\t\t\t$timestamp_format = 'D, d M Y h:i:s';\r"
          },
          {
            "lineNumber": 1844,
            "text": "\t\t\t// use post_modified to set last_modified.\r"
          },
          {
            "lineNumber": 1845,
            "text": "\t\t\t$post_modified = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_modified );\r"
          },
          {
            "lineNumber": 1846,
            "text": "\t\t\t$timestamp     = $post_modified-\u003eformat( $timestamp_format ) . ' ' . $offset;\r"
          },
          {
            "lineNumber": 1847,
            "text": "\t\t\t$key           = apply_filters( 'invp_prefix_meta_key', 'last_modified' );\r"
          },
          {
            "lineNumber": 1848,
            "text": "\t\t\tdelete_post_meta( $post_id, $key );\r"
          },
          {
            "lineNumber": 1849,
            "text": "\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r"
          },
          {
            "lineNumber": 1850,
            "text": "\r"
          },
          {
            "lineNumber": 1851,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1852,
            "text": "\t\t\t * If this is not an update or there is no date entered post meta value,\r"
          },
          {
            "lineNumber": 1853,
            "text": "\t\t\t * set the date_entered meta value using the post_date\r"
          },
          {
            "lineNumber": 1854,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1855,
            "text": "\t\t\tif ( ! $is_update || empty( INVP::get_meta( 'date_entered', $post_id ) ) ) {\r"
          },
          {
            "lineNumber": 1856,
            "text": "\t\t\t\t// use post_date to set date_entered.\r"
          },
          {
            "lineNumber": 1857,
            "text": "\t\t\t\t$post_date = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_date );\r"
          },
          {
            "lineNumber": 1858,
            "text": "\t\t\t\t$timestamp = $post_date-\u003eformat( $timestamp_format ) . ' ' . $offset;\r"
          },
          {
            "lineNumber": 1859,
            "text": "\t\t\t\t$key       = apply_filters( 'invp_prefix_meta_key', 'date_entered' );\r"
          },
          {
            "lineNumber": 1860,
            "text": "\t\t\t\tdelete_post_meta( $post_id, $key );\r"
          },
          {
            "lineNumber": 1861,
            "text": "\t\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r"
          },
          {
            "lineNumber": 1862,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1863,
            "text": "\r"
          },
          {
            "lineNumber": 1864,
            "text": "\t\t\tif ( empty( $_POST ) ) {\r"
          },
          {
            "lineNumber": 1865,
            "text": "\t\t\t\treturn;\r"
          },
          {
            "lineNumber": 1866,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 1867,
            "text": "\r"
          },
          {
            "lineNumber": 1868,
            "text": "\t\t\t// Clear this value that is defined by a checkbox.\r"
          },
          {
            "lineNumber": 1869,
            "text": "\t\t\tupdate_post_meta( $post_id, apply_filters( 'invp_prefix_meta_key', 'featured' ), '0' );\r"
          },
          {
            "lineNumber": 1870,
            "text": "\r"
          },
          {
            "lineNumber": 1871,
            "text": "\t\t\t/**\r"
          },
          {
            "lineNumber": 1872,
            "text": "\t\t\t * Loop over the post meta keys we manage and save their values\r"
          },
          {
            "lineNumber": 1873,
            "text": "\t\t\t * if we find them coming over as part of the post to save.\r"
          },
          {
            "lineNumber": 1874,
            "text": "\t\t\t */\r"
          },
          {
            "lineNumber": 1875,
            "text": "\t\t\t$keys   = INVP::keys();\r"
          },
          {
            "lineNumber": 1876,
            "text": "\t\t\t$keys[] = 'options_array';\r"
          },
          {
            "lineNumber": 1877,
            "text": "\r"
          },
          {
            "lineNumber": 1878,
            "text": "\t\t\tforeach ( $keys as $unprefixed_key ) {\r"
          },
          {
            "lineNumber": 1879,
            "text": "\t\t\t\t"
          }
        ],
        "originalContents": "\r\n\t\t\t// is this a vehicle?\r\n\t\t\tif ( ! empty( $_POST['post_type'] ) \u0026\u0026 INVP::POST_TYPE !== $_POST['post_type'] ) {\r\n\t\t\t\t// no, don't create any meta data for vehicles.\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Tick the last modified date of this vehicle since we're saving changes.\r\n\t\t\t * It looks like this: Tue, 06 Sep 2016 09:26:12 -0400\r\n\t\t\t */\r\n\t\t\t$offset           = sprintf( '%+03d00', intval( get_option( 'gmt_offset' ) ) );\r\n\t\t\t$timestamp_format = 'D, d M Y h:i:s';\r\n\t\t\t// use post_modified to set last_modified.\r\n\t\t\t$post_modified = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_modified );\r\n\t\t\t$timestamp     = $post_modified-\u003eformat( $timestamp_format ) . ' ' . $offset;\r\n\t\t\t$key           = apply_filters( 'invp_prefix_meta_key', 'last_modified' );\r\n\t\t\tdelete_post_meta( $post_id, $key );\r\n\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r\n\r\n\t\t\t/**\r\n\t\t\t * If this is not an update or there is no date entered post meta value,\r\n\t\t\t * set the date_entered meta value using the post_date\r\n\t\t\t */\r\n\t\t\tif ( ! $is_update || empty( INVP::get_meta( 'date_entered', $post_id ) ) ) {\r\n\t\t\t\t// use post_date to set date_entered.\r\n\t\t\t\t$post_date = DateTime::createFromFormat( 'Y-m-d H:i:s', $post-\u003epost_date );\r\n\t\t\t\t$timestamp = $post_date-\u003eformat( $timestamp_format ) . ' ' . $offset;\r\n\t\t\t\t$key       = apply_filters( 'invp_prefix_meta_key', 'date_entered' );\r\n\t\t\t\tdelete_post_meta( $post_id, $key );\r\n\t\t\t\tupdate_post_meta( $post_id, $key, $timestamp );\r\n\t\t\t}\r\n\r\n\t\t\tif ( empty( $_POST ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Clear this value that is defined by a checkbox.\r\n\t\t\tupdate_post_meta( $post_id, apply_filters( 'invp_prefix_meta_key', 'featured' ), '0' );\r\n\r\n\t\t\t/**\r\n\t\t\t * Loop over the post meta keys we manage and save their values\r\n\t\t\t * if we find them coming over as part of the post to save.\r\n\t\t\t */\r\n\t\t\t$keys   = INVP::keys();\r\n\t\t\t$keys[] = 'options_array';\r\n",
        "range": {
          "endPosition": {
            "column": 4,
            "line": 1878
          },
          "startPosition": {
            "column": 4,
            "line": 1826
          }
        },
        "relativeWorkspacePath": "inventory-presser.php"
      },
      "score": 0.2444383054971695
    },
    {
      "codeBlock": {
        "contents": "}\r\n\r\n\t/**\r\n\t * Retrieves post meta values.\r\n\t *\r\n\t * @param  string $unprefixed_meta_key A meta key suffix like 'vin' or 'date_entered'.\r\n\t * @param  int    $post_id A vehicle post ID.\r\n\t * @return string|int|double|array\r\n\t */\r\n\tpublic static function get_meta( $unprefixed_meta_key, $post_id = null ) {\r\n\t\tif ( empty( $post_id ) ) {\r\n\t\t\t$post_id = get_the_ID();\r\n\t\t}\r\n\r\n\t\t$meta_key = apply_filters( 'invp_prefix_meta_key', $unprefixed_meta_key );\r\n\r\n\t\t// Options are stored as a multi-valued meta field.\r\n\t\t$single = 'options_array' !== $unprefixed_meta_key;\r\n\r\n\t\t$meta_value = get_post_meta( $post_id, $meta_key, $single );\r\n\t\t// Kill dupes for singles. Added after finding duplicate date_entered and last_modified dates.\r\n\t\tif ( $single ) {\r\n\t\t\t$array_value = get_post_meta( $post_id, $meta_key );\r\n\t\t\tif ( $array_value \u0026\u0026 1 \u003c count( $array_value ) ) {\r\n\t\t\t\tdelete_post_meta( $post_id, $meta_key );\r\n\t\t\t\tupdate_post_meta( $post_id, $meta_key, $meta_value );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If key is a number, return a number/zero instead of empty string.\r\n\t\tif ( self::meta_value_is_number( $meta_key ) ) {\r\n\t\t\tif ( empty( $meta_value ) ) {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ( false === strpos( $meta_value ?? '', '.' ) ) {\r\n\t\t\t\treturn (int) $meta_value;\r\n\t\t\t}\r\n\t\t\treturn (float) $meta_value;\r\n\t\t}\r\n\t\treturn $meta_value;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads phone numbers from post meta into an array.\r\n\t *\r\n\t * @param  int $term_id The location term ID from which to extract phones.\r\n\t * @return array An array of arrays describing phone numbers\r\n\t */\r\n\tpublic static function get_phones( $term_id ) {\r\n\t\t$phones    = array();\r\n\t\t$term_meta = get_term_meta( $term_id );\r\n\r\n\t\tfor ( $p = 1; $p \u003c= self::LOCATION_MAX_PHONES; $p++ ) {\r\n\t\t\t// Is there a phone number in this slot?\r\n\t\t\tif ( empty( $term_meta[ 'phone_' . $p . '_uid' ][0] ) ) {\r\n\t\t\t\t// No, we're done with this location.\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n",
        "detailedLines": [
          {
            "lineNumber": 372,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 373,
            "text": "\r"
          },
          {
            "lineNumber": 374,
            "text": "\t\t\t$hours[] = $set;\r"
          },
          {
            "lineNumber": 375,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 376,
            "text": "\t\treturn $hours;\r"
          },
          {
            "lineNumber": 377,
            "text": "\t}\r"
          },
          {
            "lineNumber": 378,
            "text": "\r"
          },
          {
            "lineNumber": 379,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 380,
            "text": "\t * Retrieves post meta values.\r"
          },
          {
            "lineNumber": 381,
            "text": "\t *\r"
          },
          {
            "lineNumber": 382,
            "text": "\t * @param  string $unprefixed_meta_key A meta key suffix like 'vin' or 'date_entered'.\r"
          },
          {
            "lineNumber": 383,
            "text": "\t * @param  int    $post_id A vehicle post ID.\r"
          },
          {
            "lineNumber": 384,
            "text": "\t * @return string|int|double|array\r"
          },
          {
            "lineNumber": 385,
            "text": "\t */\r"
          },
          {
            "lineNumber": 386,
            "text": "\tpublic static function get_meta( $unprefixed_meta_key, $post_id = null ) {\r"
          },
          {
            "lineNumber": 387,
            "text": "\t\tif ( empty( $post_id ) ) {\r"
          },
          {
            "lineNumber": 388,
            "text": "\t\t\t$post_id = get_the_ID();\r"
          },
          {
            "lineNumber": 389,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 390,
            "text": "\r"
          },
          {
            "lineNumber": 391,
            "text": "\t\t$meta_key = apply_filters( 'invp_prefix_meta_key', $unprefixed_meta_key );\r"
          },
          {
            "lineNumber": 392,
            "text": "\r"
          },
          {
            "lineNumber": 393,
            "text": "\t\t// Options are stored as a multi-valued meta field.\r"
          },
          {
            "lineNumber": 394,
            "text": "\t\t$single = 'options_array' !== $unprefixed_meta_key;\r"
          },
          {
            "lineNumber": 395,
            "text": "\r"
          },
          {
            "lineNumber": 396,
            "text": "\t\t$meta_value = get_post_meta( $post_id, $meta_key, $single );\r"
          },
          {
            "lineNumber": 397,
            "text": "\t\t// Kill dupes for singles. Added after finding duplicate date_entered and last_modified dates.\r"
          },
          {
            "lineNumber": 398,
            "text": "\t\tif ( $single ) {\r"
          },
          {
            "lineNumber": 399,
            "text": "\t\t\t$array_value = get_post_meta( $post_id, $meta_key );\r"
          },
          {
            "lineNumber": 400,
            "text": "\t\t\tif ( $array_value \u0026\u0026 1 \u003c count( $array_value ) ) {\r"
          },
          {
            "lineNumber": 401,
            "text": "\t\t\t\tdelete_post_meta( $post_id, $meta_key );\r"
          },
          {
            "lineNumber": 402,
            "text": "\t\t\t\tupdate_post_meta( $post_id, $meta_key, $meta_value );\r"
          },
          {
            "lineNumber": 403,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 404,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 405,
            "text": "\r"
          },
          {
            "lineNumber": 406,
            "text": "\t\t// If key is a number, return a number/zero instead of empty string.\r"
          },
          {
            "lineNumber": 407,
            "text": "\t\tif ( self::meta_value_is_number( $meta_key ) ) {\r"
          },
          {
            "lineNumber": 408,
            "text": "\t\t\tif ( empty( $meta_value ) ) {\r"
          },
          {
            "lineNumber": 409,
            "text": "\t\t\t\treturn 0;\r"
          },
          {
            "lineNumber": 410,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 411,
            "text": "\t\t\tif ( false === strpos( $meta_value ?? '', '.' ) ) {\r"
          },
          {
            "lineNumber": 412,
            "text": "\t\t\t\treturn (int) $meta_value;\r"
          },
          {
            "lineNumber": 413,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 414,
            "text": "\t\t\treturn (float) $meta_value;\r"
          },
          {
            "lineNumber": 415,
            "text": "\t\t}\r"
          },
          {
            "lineNumber": 416,
            "text": "\t\treturn $meta_value;\r"
          },
          {
            "lineNumber": 417,
            "text": "\t}\r"
          },
          {
            "lineNumber": 418,
            "text": "\r"
          },
          {
            "lineNumber": 419,
            "text": "\t/**\r"
          },
          {
            "lineNumber": 420,
            "text": "\t * Loads phone numbers from post meta into an array.\r"
          },
          {
            "lineNumber": 421,
            "text": "\t *\r"
          },
          {
            "lineNumber": 422,
            "text": "\t * @param  int $term_id The location term ID from which to extract phones.\r"
          },
          {
            "lineNumber": 423,
            "text": "\t * @return array An array of arrays describing phone numbers\r"
          },
          {
            "lineNumber": 424,
            "text": "\t */\r"
          },
          {
            "lineNumber": 425,
            "text": "\tpublic static function get_phones( $term_id ) {\r"
          },
          {
            "lineNumber": 426,
            "text": "\t\t$phones    = array();\r"
          },
          {
            "lineNumber": 427,
            "text": "\t\t$term_meta = get_term_meta( $term_id );\r"
          },
          {
            "lineNumber": 428,
            "text": "\r"
          },
          {
            "lineNumber": 429,
            "text": "\t\tfor ( $p = 1; $p \u003c= self::LOCATION_MAX_PHONES; $p++ ) {\r"
          },
          {
            "lineNumber": 430,
            "text": "\t\t\t// Is there a phone number in this slot?\r"
          },
          {
            "lineNumber": 431,
            "text": "\t\t\tif ( empty( $term_meta[ 'phone_' . $p . '_uid' ][0] ) ) {\r"
          },
          {
            "lineNumber": 432,
            "text": "\t\t\t\t// No, we're done with this location.\r"
          },
          {
            "lineNumber": 433,
            "text": "\t\t\t\tbreak;\r"
          },
          {
            "lineNumber": 434,
            "text": "\t\t\t}\r"
          },
          {
            "lineNumber": 435,
            "text": "\r"
          },
          {
            "lineNumber": 436,
            "text": "\t\t\t$phones[] = array(\r"
          },
          {
            "lineNumber": 437,
            "text": "\t\t\t\t'uid'         =\u003e $term_meta[ 'phone_' . $p . '_uid' ][0],\r"
          }
        ],
        "originalContents": "}\r\n\r\n\t/**\r\n\t * Retrieves post meta values.\r\n\t *\r\n\t * @param  string $unprefixed_meta_key A meta key suffix like 'vin' or 'date_entered'.\r\n\t * @param  int    $post_id A vehicle post ID.\r\n\t * @return string|int|double|array\r\n\t */\r\n\tpublic static function get_meta( $unprefixed_meta_key, $post_id = null ) {\r\n\t\tif ( empty( $post_id ) ) {\r\n\t\t\t$post_id = get_the_ID();\r\n\t\t}\r\n\r\n\t\t$meta_key = apply_filters( 'invp_prefix_meta_key', $unprefixed_meta_key );\r\n\r\n\t\t// Options are stored as a multi-valued meta field.\r\n\t\t$single = 'options_array' !== $unprefixed_meta_key;\r\n\r\n\t\t$meta_value = get_post_meta( $post_id, $meta_key, $single );\r\n\t\t// Kill dupes for singles. Added after finding duplicate date_entered and last_modified dates.\r\n\t\tif ( $single ) {\r\n\t\t\t$array_value = get_post_meta( $post_id, $meta_key );\r\n\t\t\tif ( $array_value \u0026\u0026 1 \u003c count( $array_value ) ) {\r\n\t\t\t\tdelete_post_meta( $post_id, $meta_key );\r\n\t\t\t\tupdate_post_meta( $post_id, $meta_key, $meta_value );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If key is a number, return a number/zero instead of empty string.\r\n\t\tif ( self::meta_value_is_number( $meta_key ) ) {\r\n\t\t\tif ( empty( $meta_value ) ) {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ( false === strpos( $meta_value ?? '', '.' ) ) {\r\n\t\t\t\treturn (int) $meta_value;\r\n\t\t\t}\r\n\t\t\treturn (float) $meta_value;\r\n\t\t}\r\n\t\treturn $meta_value;\r\n\t}\r\n\r\n\t/**\r\n\t * Loads phone numbers from post meta into an array.\r\n\t *\r\n\t * @param  int $term_id The location term ID from which to extract phones.\r\n\t * @return array An array of arrays describing phone numbers\r\n\t */\r\n\tpublic static function get_phones( $term_id ) {\r\n\t\t$phones    = array();\r\n\t\t$term_meta = get_term_meta( $term_id );\r\n\r\n\t\tfor ( $p = 1; $p \u003c= self::LOCATION_MAX_PHONES; $p++ ) {\r\n\t\t\t// Is there a phone number in this slot?\r\n\t\t\tif ( empty( $term_meta[ 'phone_' . $p . '_uid' ][0] ) ) {\r\n\t\t\t\t// No, we're done with this location.\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n",
        "range": {
          "endPosition": {
            "line": 437
          },
          "startPosition": {
            "line": 371
          }
        },
        "relativeWorkspacePath": "includes/class-invp.php"
      },
      "score": 0.24401170015335083
    }
  ]
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Updating the JavaScript check to use the correct post type `'inventory_vehicle'`:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 1, lines removed: 1

```diff
@@ -328,5 +328,5 @@
  				// Check if we're in a post editor context (not widgets editor)
  				var editorStore = wp.data.select( 'core/editor' );
- 				if ( ! editorStore || ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory' ) {
+ 				if ( ! editorStore || ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory_vehicle' ) {
  					// Not in post editor or not editing a vehicle, return null
  					return null;
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking for linting errors:


_**Agent (default)**_

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


Parameters:

```json
{
  "paths": [
    "js/editor-sidebar.js",
    "includes/admin/class-admin-editor-sidebar.php"
  ]
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

## Summary of Fixes

### 1. **PHP Fix** (`class-admin-editor-sidebar.php`)
- Added a check to only enqueue the script on post editor pages (`post.php` or `post-new.php`), not on `widgets.php` or other admin pages.

### 2. **JavaScript Fixes** (`editor-sidebar.js`)

**a) Top-level code guard:**
- Added checks before accessing `wp.media.view.settings.post.id` to prevent errors when the media settings don't exist (like on widgets.php).

**b) Taxonomy hiding function guard:**
- Added a check to ensure the `core/editor` store exists before trying to dispatch actions.

**c) Plugin render function guard:**
- Added an early return if we're not in a post editor context or not editing a vehicle (`inventory_vehicle` post type).
- Fixed the unsafe access to `getEditedPostAttribute('meta')` by checking if `meta` exists before accessing its properties.

These changes ensure:
- The script only loads when editing vehicle posts
- If it loads in the wrong context, it exits early without errors
- All post data access is guarded against undefined values

The error should be resolved. Refresh `wp-admin/widgets.php`; the red banner and console errors should be gone. The sidebar will still work when editing vehicles in the post editor.

---

_**User (2025-11-09 00:29:34Z)**_

i still see this console error. did we not fix this, or am i seeing cached scripts? 



Uncaught TypeError: can't access property "inventory_presser_type", wp.data.select(...).getEditedPostAttribute(...) is undefined

    render https://buyrichsautos.test/wp-content/plugins/inventory-presser/js/editor-sidebar.js?ver=15.2.4:523

    renderWithHooks https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:15496

    mountIndeterminateComponent https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:20113

    beginWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:21636

    callCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4151

    invokeGuardedCallbackDev https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4200

    invokeGuardedCallback https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:4264

    beginWork$1 https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:27500

    performUnitOfWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26606

    workLoopSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26515

    renderRootSync https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:26483

    performConcurrentWorkOnRoot https://buyrichsautos.test/wp-includes/js/dist/vendor/react-dom.js?ver=18.3.1.1:25787

    workLoop https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2653

    flushWork https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2626

    performWorkUntilDeadline https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2920

    EventHandlerNonNull* https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:2958

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:13

    <anonymous> https://buyrichsautos.test/wp-includes/js/dist/vendor/react.js?ver=18.3.1.1:14

editor-sidebar.js:523:68



---

_**Agent (default)**_

Checking the current state of the file around line 523:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Checking where we access `inventory_presser_type`:


_**Agent (default)**_

<tool-use data-tool-type="search" data-tool-name="grep">
<details>
<summary>Tool use: **grep** • Grep for "inventory_presser_type" in "js/editor-sidebar.js" • 3 matches</summary>

Output mode: content


| File | Content | Line |
|------|------|------|
| `js/editor-sidebar.js` | `var inventory_presser_type = ( meta && meta.inventory_presser_type ) ? meta.inventory_presser_type : '';` | L541 |
| `js/editor-sidebar.js` | `if ( inventory_presser_type && 'boat' === inventory_presser_type.toLowerCase() ) \{` | L542 |
| `js/editor-sidebar.js` | `fields = wp.hooks.applyFilters( 'invp_editor_sidebar_elements', fields, inventory_presser_type );` | L586 |


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

The error points to line 523, likely from a cached script. The guard may not catch all cases. Improving the guard to also verify that `getEditedPostAttribute` returns a value before accessing it:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Strengthening the guard: `getCurrentPostType()` may not work as expected on the widgets page. Adding additional checks:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 15, lines removed: 2

```diff
@@ -328,6 +328,19 @@
  				// Check if we're in a post editor context (not widgets editor)
  				var editorStore = wp.data.select( 'core/editor' );
- 				if ( ! editorStore || ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory_vehicle' ) {
- 					// Not in post editor or not editing a vehicle, return null
+ 				if ( ! editorStore ) {
+ 					return null;
+ 				}
+ 
+ 				// Check if getCurrentPostType exists and returns the correct post type
+ 				if ( ! editorStore.getCurrentPostType || editorStore.getCurrentPostType() !== 'inventory_vehicle' ) {
+ 					return null;
+ 				}
+ 
+ 				// Additional safety check: verify getEditedPostAttribute works and returns meta
+ 				if ( ! editorStore.getEditedPostAttribute ) {
+ 					return null;
+ 				}
+ 				var testMeta = editorStore.getEditedPostAttribute( 'meta' );
+ 				if ( ! testMeta || typeof testMeta !== 'object' ) {
  					return null;
  				}
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Updating the code to reuse the `testMeta` variable we already retrieved:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/js/editor-sidebar.js</summary>

**Chunk 1**
Lines added: 2, lines removed: 2

```diff
@@ -550,6 +550,6 @@
  					),
  				);
- 				// Is this a boat?
- 				var meta = editorStore.getEditedPostAttribute( 'meta' );
+ 				// Is this a boat? (testMeta was already retrieved in the guard check above)
+ 				var meta = testMeta;
  				var inventory_presser_type = ( meta &amp;&amp; meta.inventory_presser_type ) ? meta.inventory_presser_type : '';
  				if ( inventory_presser_type &amp;&amp; 'boat' === inventory_presser_type.toLowerCase() ) {
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "paths": [
    "js/editor-sidebar.js"
  ]
}
```
Result:

```json
{
  "path": "js/editor-sidebar.js"
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

The error likely comes from a cached script. Verifying the PHP enqueue check and ensuring it prevents loading on the widgets page. Checking if we need to adjust the hook or add additional checks:


_**Agent (default)**_

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

</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

The `enqueue_block_assets` hook fires on all block editor pages. Switching to a hook that only runs in the post editor:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/admin/class-admin-editor-sidebar.php</summary>

**Chunk 1**
Lines added: 3, lines removed: 1

```diff
@@ -51,5 +51,7 @@
  	 */
  	public function add_hooks() {
- 		add_action( 'enqueue_block_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );
+ 		// Use enqueue_block_editor_assets instead of enqueue_block_assets
+ 		// This hook only fires in the block editor, and we'll add additional checks
+ 		add_action( 'enqueue_block_editor_assets', array( $this, 'sidebar_plugin_script_enqueue' ) );
  		add_action( 'init', array( $this, 'sidebar_plugin_register' ) );
  		add_action( 'admin_enqueue_scripts', array( $this, 'scripts_and_styles' ) );
```

</details>

</tool-use>

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

</details></tool-use>

_**Agent (default)**_

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


Parameters:

```json
{
  "paths": [
    "includes/admin/class-admin-editor-sidebar.php"
  ]
}
```
Result:

```json
{
  "path": "includes/admin/class-admin-editor-sidebar.php"
}
```
Status: **completed**


</details>
</tool-use>

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

</details></tool-use>

_**Agent (default)**_

Made two changes:

1. **Changed the hook** from `enqueue_block_assets` to `enqueue_block_editor_assets` (though both can fire on widgets.php, so the page check is still needed).

2. **Strengthened the JavaScript guard** to verify:
   - The editor store exists
   - `getCurrentPostType()` exists and returns `'inventory_vehicle'`
   - `getEditedPostAttribute()` exists
   - `getEditedPostAttribute('meta')` returns a valid object

The error you're seeing is likely from a cached script. The browser is loading an old version where line 523 was the problematic code.

## To fix the caching issue:

1. Hard refresh the page:
   - Chrome/Edge: `Ctrl+Shift+R` (Windows) or `Cmd+Shift+R` (Mac)
   - Firefox: `Ctrl+F5` (Windows) or `Cmd+Shift+R` (Mac)
   - Safari: `Cmd+Option+R`

2. Clear browser cache for the site.

3. If using a minified version, check if `SCRIPT_DEBUG` is enabled. If not, the `.min.js` file may need to be regenerated, or temporarily enable `SCRIPT_DEBUG` to use the unminified version.

4. Check if a caching plugin is serving old JavaScript. Clear that cache.

After clearing cache, the error should be gone. The JavaScript guard will prevent the error even if the script loads on the widgets page.
