Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Wordpress: If a theme isn't installed (given the name), an undefined function (themes_api) is called #281

Closed
samcleaver opened this Issue · 7 comments

3 participants

@samcleaver

As per the title:
File: includes/presets.php
Function: get_name
Condition: If the theme doesn't exist then themes_api is called (which doesn't exist). Not sure what function this was referring to? Can't find it in the latest Wordpress source anywhere.

//theme isn't installed, use the WP.org API to grab the name rather than risk losing data on upgrade
        $api = themes_api( 'theme_information', array( 'slug' => $stylesheet, 'fields' => array( 'sections' => false, 'tags' => false ) ) );
@samcleaver

Tracking: Originally raised by a user on the Wordpress forums with 3.3.1 (though checked latest source 3.4.2 as well).

@67726e

@Beaver6813 I can't find anything related to this in any of the previous tagged releases on the WordPress SVN either. There is an filter hook called themes_api so I'm thinking this is what was meant to be used and this is just some erroneous code? I'll look at this more tonight after work.

@benbalter

themes_api is defined in wp-admin/includes/theme.php since 2.8.

@samcleaver

Ahh, I was looking in the main wp-includes folder, probably why I couldn't find it! Are we sure that this function is definitely only used while they're in the admin panel? As that might explain the issue.
Asked the finder for clarification on where they see the issue.

@samcleaver

Yeah, looks like the get_name function is being called on the homepage for some reason. Will have a look later (unless one of you guys beats be to it!) as to why.

well .. now I deactivate the plugin and the website works but if I try to activate it .. the website doesnt work at all .. and you go on the website you can only read this:

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.steyoyoke.com/home/wp-content/plugins/infinite-scroll/includes/presets.php on line 591

Fatal error: Call to undefined function themes_api() in /web/htdocs/www.steyoyoke.com/home/wp-content/plugins/infinite-scroll/includes/presets.php on line 598
@67726e 67726e referenced this issue from a commit
@67726e 67726e Issue #281 Included files needed for `themes_api` call and added util…
…ity methods to handle now deprecated `get_theme(s)` calls
2700de7
@67726e 67726e closed this
@samcleaver

Hmm.. with the fix for this, do we really need to be including presets.php at all if we're not already in the admin panel?

@67726e

@Beaver6813 It would take a large refactoring, and that is not something I want to engage in at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.