The problem is this:
selected(get_option('lp_actPage', $slug))
selected
needs 2 parameters, but you gave it 1, and get_option
wants 1 parameter but you gave it 2.
If we reformat this, the problem becomes much clearer:
selected(
get_option('lp_actPage', $slug)
)
What’s necessary is:
selected(
get_option('lp_actPage')
$slug
)
Sidenote
get_pages
doesn’t use the normal post querying code, and doesn’t benefit from the same enhancements and plugin integration you get from other functions.
Instead of get_pages
, consider:
$pages = get_posts( [
'suppress_filters' => false, // enable caching
'post_type' => 'page', // we want pages
'post_status' => 'publish', // speed up by asking for only published posts
'posts_per_page' => 100,
] );
Likewise, don’t use <?
use <?php
or your code will break when your host upgrades PHP in the future.