i have a simple function and i need that while it execute my function it set a variable to true, otherwise false. the execution would be my condition.
while run this func
function need() {
$updates = get_point();
echo $updates['selector'];
echo 'done';
}
i need that my $set is true, otherwise false. how can i put the func inside?
i have a simple function and i need that while it execute my function it set a variable to true, otherwise false. the execution would be my condition.
while run this func
function need() {
$updates = get_point();
echo $updates['selector'];
echo 'done';
}
i need that my $set is true, otherwise false. how can i put the func inside?
Share Improve this question asked Feb 5, 2020 at 16:13 DevBeppeDevBeppe 477 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0a. from the return
function dosome(){ return true; }
OR
function dosome( param = true ){ return param; }
var = dosome();
while ( var ){ need(); }
b. while loop from fixed param TRUE
function need( $param = true) {
while ( param ){
$updates = get_point();
echo $updates['selector'];
echo 'done';
}
}
need();
c. while loop from fixed param FALSE
function need( $param = false) {
while ( param ){
$updates = get_point();
echo $updates['selector'];
echo 'done';
}
}
var = true;
need( var );
DISALLOW_FILE_MODS
directive you sholud not define it as constant ( once defined cannot be undefined as per @TomJNowell comment above) but try to use instead the correspondent filter developer.wordpress/reference/hooks/file_mod_allowed – Andrea Somovigo Commented Feb 5, 2020 at 17:28