YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing "Check Now" button in debug bar (missing get_submit_button() function)

Milosh911 opened this issue · comments

I'm trying to setup automatic theme updates and I'm following official guide. It sucks that we need additional plugin to check for theme updates, but it is what it is. The issue is that documentations says the following:

Install Debug Bar.
Click the "Debug" menu in the Admin Bar (a.k.a Toolbar).
Open the "PUC (your-slug)" panel.
Click the "Check Now" button.

Check now button is missing, and by looking at the source code, I found the following:

if ( function_exists('get_submit_button')  ) {
		$checkNowButton = get_submit_button(
			'Check Now',
			'secondary',
			'puc-check-now-button',
			false,
			array('id' => $this->updateChecker->getUniqueName('check-now-button'))
		);
	}

The issue is, the get_submit_button function does not exist...

So I guess the question is, is there another option to force check theme updates?

EDIT: I just figured out that get_submit_button is Wordpress function, but in any case its not available in whatever scope PUC is running... I'm using both the latest Wordpress and PUC versions...

Try opening the Debug Bar from the admin dashboard, not the site front end. Then the button should show up.

I should probably add some workaround for contexts where get_submit_button() is not available, like a plain HTML button.