inc2734/wp-github-theme-updater

A library for WordPress that automatic theme updater with GitHub API.

1.0.3 2019-02-01 06:29 UTC

README

Build Status Latest Stable Version License

Install

$ composer require inc2734/wp-github-theme-updater

How to use

<?php
// When Using composer auto loader
$updater = new Inc2734\WP_GitHub_Theme_Updater\Bootstrap( get_template(), 'user-name', 'repository' );

Filter hooks

inc2734_github_theme_updater_zip_url

Customize downloaded api url.

add_filter(
  'inc2734_github_theme_updater_zip_url',
  function( $url, $user_name, $repository, $tag_name ) {
    return $url;
  },
  10,
  4
);

inc2734_github_theme_updater_request_url

Customize requested api url.

add_filter(
  'inc2734_github_theme_updater_request_url',
  function( $url, $user_name, $repository ) {
    return $url;
  },
  10,
  3
);