• What´s a diference between bloginfo(); and get_option(); in pratice?

    For example:

    <?php bloginfo(‘url’); ?> its diferent if <?php echo get_option(‘siteurl’); ?>

    What´s is more safe?

    Thank´s!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think the difference is that bloginfo prints directly to the web page, and get_option returns a value. That’s why to output a value using get_option one needs to use the php echo(); function.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    It depends on what exactly you’re wanting.

    – get_option gets arbitrary options out of the database.
    – get_bloginfo gets various blog informational settings.

    The results of these two may not be identical, because something might be filtering the bloginfo and not the options.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bloginfo and get_option’ is closed to new replies.