loading...

Discussion on: Changing the Logo Link in WordPress is surprisingly difficult so I wrote my first WordPress plugin

Collapse
eruizdechavez profile image
Erick Ruiz de Chavez

Thanks for sharing this @jclarke . I am currently working a lot with WordPress writing plugins and themes and it is very nice to see someone share actual code instead just the classic Install plugin X approach.

If you do not mind, I would suggest a couple of things to make it more visible/reusable. The first one would be to share your code in GitHub instead of just a ZIP file. The second one, what if instead of using 'https://awesomesite.com' as the default URL, you use site_url(), that way, the site's logo won't be broken after installing this plugin but before updating the URL.

function easylogolinkchange_register_settings() {
    add_option( 'easylogolinkchange_url', site_url());
    register_setting( 'easylogolinkchangeurl_options_group', 'easylogolinkchange_url', 'easylogolinkchangeurl_callback' );
}
Collapse
jclarke profile image
Joseph Clarke Author

Great idea on using the default site url, I’ll make that change, thanks!