CMB2 Repeatable Group & JSON API

Consider using the CMB2 API. <SITE_URL>/wp-json/cmb2/v1/boxes/<METABOX_ID>/fields/PhotoGalleryGroup?object_id=<POST_ID>&object_type=post You will need to enable the API feature for your box/fields. Documentation for that is in the wiki.

Loading child theme script after plugins scripts

The 3rd parameter of wp_enqueue_script(), called $deps, will help you to solve this. You just need to know the handle with which owl carousel was enqueued. Assuming it is owlcarousel, you’d change your code to this wp_enqueue_script( ‘custom-script’, get_stylesheet_directory_uri() . ‘/custom-script.js’, array(‘jquery’,’ultrabootstrap-bootstrap’,’ultrabootstrap-scripts’,’owlcarousel’) // added this new dependancy —————————————–^ ); This way, WordPress will do the … Read more

Add Extra codes by plugin

There are hooks that you can use for this purpose. The wp_head hook allows you to add your content to the header, while wp_footer does the same for your footer. Use it as follows: add_action( ‘wp_head’, ‘my_function’); function my_function (){ echo “Hello World!”; } This will print Hello World! in your header. However, there is … Read more

View Private Published Page with URL Code (no login required)

You can actually hook the built-in page/post password feature and set it up to check for url params that match page/post password, and then change the value of $required to false. add_filter( ‘post_password_required’, ‘my_allow_url_param’, 10, 2 ); function my_allow_url_param( $required, $post ) { if ( empty( $post->post_password ) ) { $required = false; return $required; … Read more

Carbon Fields use in custom plugin class

I found the answer to my question. From the part, the problem was that I connected the vendor/autoload.php after accessing the __construct(). An example of solving this task below use Carbon_Fields\Container; use Carbon_Fields\Field; class PluginOption { public function __construct() { require_once( ‘vendor/autoload.php’ ); \Carbon_Fields\Carbon_Fields::boot(); add_action( ‘carbon_fields_register_fields’, array( $this, ‘crb_attach_theme_options’) ); } public function crb_attach_theme_options() { … Read more

One-to-many post relationships that are displayed by category (using posts-to-posts plugin)

I’m not that familiar with the posts-to-posts Plugin, but your main problem may be that the category page doesn’t know which building you chose in the step before if you don’t transmit it in a parameter or save it in a session or cookie. Maybe it would be better to output the connected items on … Read more