ptryk
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Warning: array_keys(): The first argument should be an array in…trying to sort pages w/r/t a “field” .e.g. “menu_order”.. can’t think of any way to do it where it needs to be done..
got an array that the page data has been read into…eg
$pagedatacopy
it is of the form..eg (“.” signify a clip of many fields)(
[0] => stdClass Object
(
[ID] => 24
.
.
[menu_order] => 30
)
[1] => stdClass Object
(
[ID] => 12
.
.
[menu_order] => 10
)
[1] => stdClass Object
(
[ID] => 31
.
.
[menu_order] => 20
)
)would like to be able to sort the array so that for example the pages will go through the rest of the processing in the correct order for the correct output .. hope this helps to clarify
Forum: Fixing WordPress
In reply to: Warning: array_keys(): The first argument should be an array in…just found another sort method, but i am having trouble with the syntax..
from..
https://se.php.net/manual/en/function.array-multisort.php
posted by AlberT at SuperAlberT dot it
/**
* orders a multidimentional array on the base of a label-key
*
* @param $arr, the array to be ordered
* @param $l the "label" identifing the field
* @param $f the ordering function to be used,
* strnatcasecmp() by default
* @return TRUE on success, FALSE on failure.
*/
function array_key_multi_sort(&$arr, $l , $f='strnatcasecmp') {
return usort($arr, create_function('$a, $b', "return $f(\$a['$l'], \$b['$l']);"));
}
just looking for some alternatives if nothing else
Forum: Plugins
In reply to: Dynamic Navigation Menufound a plugin of interest w/r/t dynamic menu’s includes highlighting, multiple levels.. or not….
https://www.adsworth.info/wp-pagesnavForum: Fixing WordPress
In reply to: Dynamic menu *and* submenu highligthingfound a plugin of interest w/r/t dynamic menu’s includes highlighting, multiple levels.. or not….
https://www.adsworth.info/wp-pagesnavForum: Themes and Templates
In reply to: Dynamic Menu Highlight CSS Problemfound a plugin of interest w/r/t dynamic menu’s includes highlighting, multiple levels.. or not….
https://www.adsworth.info/wp-pagesnav