Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
miguel_a
tagDiv Member

Ok, Andrei, thanks for feedback.

Cheers

miguel_a
tagDiv Member

Hi Andrei,

thanks for the response. I’ve figured this on my own in the meantime when digging though the the API files, I’m in a rush:)

Now, this doesn’t work – it throws a Fatal error, when I put it into the plugin file. This is because the plugins are initiated before the themes, so I had to put it into a separete file and load that file on in a hook like this:

class uep_api_plugin {
/* vars and functions are here */

add_action(‘td_wp_booster_loaded’, array($this, ‘hook_uep_booster_after’));

public function hook_uep_booster_after() {
include_once(dirname(__FILE__) . ‘/widgets/td_widget_tagcloud.php’);
}

}

IMHO this is a little complicated. Have you considered allowing developers register a widget with some boolean parameter in the td_api_block::add() method?

Something like:
td_api_block::add(‘td_block_tagcloud’,
array(
‘map_in_visual_composer’ => true,
‘register_widget’ => true,
)
);

…And then creating and registering a class for each widget in the array?

Cheers

miguel_a
tagDiv Member

Oh and BTW, your own example plugin, the td-api-plugin, does not register nor provide a way to register a widget.

miguel_a
tagDiv Member

I am a developer and as a developer I naturally expect proper documentation. Of course I can register a widget on my own not using your API without a problem, but as you have an API and you promote it as an advantage of you theme, I would expect a documented API way to register a widget.

As you can see here: https://forum.tagdiv.com/api-blocks-introduction/ the widgets are mentioned however undocumented. So again, like I said, I registered a new block into the VC, which is working just fine, however ir does not automatically appear in the Widgets menu. And trust me, I am not going to reverse engineer your whole API, just because you forgot to write documentation for something…

So are you going to help me here or add the information into the API documentation?

Viewing 4 posts - 1 through 4 (of 4 total)