check if page have children, but not attachment

You should specify the post_type for the get_children() function, which can be one of attachment, page, revision or any and considered to be any by default: $children = get_children( array( ‘post_parent’ => get_the_ID(), ‘post_type’ => ‘page’ ) );

How to use apply_filters() inside a plugin class?

Your code is good — you are using both apply_filters() and add_filter() correctly. But the timing/hook does not seem correct. I think it’s clear from what everyone is saying that it must be an issue of things happening in the wrong order, but don’t plugins always load before the theme? Wrong order: Yes — you … Read more

In a plugin, How to update a json file using ajax

Here is your main problem: chemin = plugin_dir_url( __FILE__ ) . “inc/json/notes.json”; There are 5 critical mistakes in the code: file_get_contents requires a file path, but you’re asking for a URL by using plugin_dir_url, not all servers support remote URLs in file_get_contents for security reasons, and if they do, this would be a big performance … Read more