Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cant ignore custome hook #56

Open
Mohammad-Ravand opened this issue Sep 27, 2024 · 1 comment
Open

i cant ignore custome hook #56

Mohammad-Ravand opened this issue Sep 27, 2024 · 1 comment

Comments

@Mohammad-Ravand
Copy link

Mohammad-Ravand commented Sep 27, 2024

this is my code:

<plugins>
    <pluginClass class="PsalmWordPress\Plugin">
        <useDefaultHooks value="true" />
        <requireAllParams value="false" />
        <hooks>
            <HookNotFound errorLevel="suppress" />
        </hooks>
    </pluginClass>
    <pluginClass class="Psl\Psalm\Plugin"/>
</plugins>

i get this error:

ERROR: HookNotFound - inc/normalize.php:106:5 - Hook "wpcf7_autop_or_not" not found
add_filter('wpcf7_autop_or_not', '__return_false');
@mcaskill
Copy link
Collaborator

For context: I haven't worked on this plugin in a while, so my memory is hazy.

I think you might need to generate the stubs for CF7's hooks following this schema. Maybe providing the path to plugin might help.

For this filter, it would look like this (untested):

{
	"$schema": "https://raw.githubusercontent.com/wp-hooks/generator/0.9.0/schema.json",
	"hooks": [
		{
			"name": "wpcf7_autop_or_not",
			"file": "includes/functions.php",
			"type": "filter",
			"doc": {
				"description": "Returns true if wpcf7_autop() is applied.",
				"long_description": "",
				"long_description_html": "",
				"tags": [
					{
						"name": "param",
						"content": "",
						"types": [
							"bool"
						],
						"variable": "$autop"
					},
					{
						"name": "param",
						"content": "",
						"types": [
							"array",
							"string"
						],
						"variable": "$options"
					}
				]
			},
			"args": 2
		}
	]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants