Tag Info

New answers tagged

0

I found the answer. Problem was I was retrieving those setting option values outside the if statement if(isset($_POST['formvalue'])){ } and using them inside it. For that reason values were actually not pulled from database.


0

You can TEST THE TIME of get_option (100 iterations) using this code (put in functions.php or somewhere): add_action('wp','My_Test'); function My_Test(){ var_dump(microtime(true)); for ($i=1; $i<100; $i++) { get_option('blogdescription'); } var_dump(microtime(true)); for ($i=1; $i<100; $i++) { get_theme_mod('blogdescription'); } ...


0

Another Method is to add this code into functions.php (or in plugin), without need of require '/path/to/wp-load.php'... but it will not be as faster as SHORTINIT : // EXAMPLE function MyFuncion(){ if (isset($_POST['mynamee'])) { echo get_option('my_nm');} } //===================Then==================== //1) Execute directly MyFunction(); ...



Top 50 recent answers are included