Too few arguments at registering new templates in my plugin

This is the problem, or rather what is missing from it: add_filter( ‘theme_page_templates’, __NAMESPACE__ . ‘\register_plugin_templates’ ); Specifically, you never told it that your function can accept 3 parameters, so it assumed it only accepts 1 as that’s the absolute minimum needed for a filter to work. Then on top of that, none of your … Read more

How do I set register_meta for a specific CPT?

register_post_meta has a post type parameter, or just set object_subtype to the post type. register_meta( ‘post’, ‘_duib_cl_heading’, [ ‘auth_callback’ => ‘__return_true’, ‘default’ => __( ”, ‘_duib_cl_heading’ ), ‘show_in_rest’ => true, ‘single’ => true, ‘type’ => ‘string’, ‘object_subtype’ => ‘testimonial’, ] ); Or register_post_meta( ‘testimonial’, ‘_duib_cl_heading’, [ ‘auth_callback’ => ‘__return_true’, ‘default’ => __( ”, ‘_duib_cl_heading’ ), … Read more

A splash page on landing page

I would propose first to make this at the front end. The reason is Google and other crawlers can read your content and don’t penalize you for sneaky (the user didn’t expect a redirect) redirects or slow loading times. What I would do: On the main page : function load_splash() { setTimeout(function () { $(‘#hiddendiv’).hide(); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)