Function: JScms_get_cat_notused
avatar
Señor FAQ

¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.


Function: JScms_get_cat_notused

The JScms_get_cat_notused function retrieves all categories from the database that are not assigned to any page and do not have an external URL.

Syntax


JScms_get_cat_notused(object $jakdb): array
    

Parameters

  • $jakdb: (object) Database connection instance.

Returns

(array) An array of categories with their id and name.

Example Usage


<?php
$unusedCategories = JScms_get_cat_notused($jakdb);
foreach ($unusedCategories as $category) {
    echo $category["id"] . ": " . $category["name"] . "\n";
}
?>
    

Best Practices

  • Use this function to identify categories that are not in use and can be repurposed or deleted.
  • Ensure that the categories table structure matches the function's expectations.

Common Issues

  • Empty Result: If no categories meet the criteria, the function will return an empty array.
  • Invalid Table Structure: Ensure the categories table has pageid and exturl fields.
Was this article helpful?
0 out of 0 found this helpful