Override plugin functions in functions.php

I´d like to override $title = get_bloginfo(); with –> $title = get_bloginfo('siteurl');

Some code from the plugin “Really simple Facebook Twitter share buttons“:

Read More
function really_simple_share ($content, $filter, $link='', $title='', $author='') {
    static $last_execution = '';

    ...

    $custom_field_disable = get_post_custom_values('really_simple_share_disable');
    if ($custom_field_disable[0]=='yes' and $filter!='shortcode') {
        return $content;
    }

    //GET ARRAY OF STORED VALUES
    global $really_simple_share_option;
    $option = $really_simple_share_option;

    ...

    $first_shown = false; // NO PADDING FOR THE FIRST BUTTON

    // IF LINK AND TITLE ARE NOT SET, USE DEFAULT FUNCTIONS
    if ($link=='' and $title=='') {
        $link = ($option['use_shortlink']) ? wp_get_shortlink() : get_permalink();

        $title = get_bloginfo(); // OVERRIDE

        $author = get_the_author_meta('nickname');
    }

Can I do this in my functions.php because I´ll updating this plugin without changing this lines after every update.

Thanks

Related posts

Leave a Reply

1 comment

  1. It is possible to filter the get_bloginfo(), but you’ll have to find a way to fine tune the conditional, because the override is global

    add_filter( 'pre_option_blogname', 'wpse_58030_override_blogname' );
    
    function wpse_58030_override_blogname( $bool )
    {
        // If not page with ID == 28, do nothing
        if( !is_page( 28 )  ) 
            return false;
            
        // Change the 'blogname'
        return "Not The Blog Name";
    }
    

    enter image description here

    Observation

    get_bloginfo() is the same as get_bloginfo('blogname').

    If the desired filter was siteurl, the filter would be pre_option_siteurl.