Having become curious about the code because of your last reply, I had a look at it and holy..
I could barely believe the size & complexity of the codebase for something as basic as 'managing links'.
The plugin exposes a global
I also noticed that the plugin is not compatible with PHP 5.2.x and under (it should mention PHP 5.3+). The
EDIT: fiddled with it. as a quick hack for returning a link category, go to
This will return an array of Link objects for that categoryId, eg you'd access the first link in the first category's url like this:
I could barely believe the size & complexity of the codebase for something as basic as 'managing links'.
The plugin exposes a global
$lm_links
, but all properties are protected so no way to get the raw data, unless you modify the core with your own return function, or change existing ones. I also noticed that the plugin is not compatible with PHP 5.2.x and under (it should mention PHP 5.3+). The
preg_replace_callback
functions in the functions.php
file use an anonymous function while it should be a reference by string name for compatibility. See http://php.net/manual/en/function.preg-replace-callback.php#109248.EDIT: fiddled with it. as a quick hack for returning a link category, go to
links_manager/inc/Links.php
, and on line 83, change the private
keyword to public
, then add the following code in links_manager/functions.php
: PHP Code:
function return_links_raw($catId) {
global $lm_links;
return $lm_links->get_by_category($catId);
}
$link = return_links_raw(0)[0]->url
.