How can I move an associate key in an array so that it is after another specified key?
For example, the current output of $columns is as follows -
$columns = Array(
[title] => Title
[author] => Author
[taxonomy-news_type] => News Types
[date] => Date
[wpseo-score] => SEO
[p2p-from-news_to_people] => Staff linked to this Story
[show_item_ids] => ID
)
One scenario is that I would like to move the key p2p-from-news_to_people to directly after taxonomy-news_type, producing this output -
$columns = Array(
[title] => Title
[author] => Author
[taxonomy-news_type] => News Types
[p2p-from-news_to_people] => Staff linked to this Story
[date] => Date
[wpseo-score] => SEO
[show_item_ids] => ID
)
$columnsarray (they are added by 3rd party plugins for Wordpress). However I can change the order in which they are output.