forked from beezwax/WP-Publish-to-Apple-News
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1141 from alleyinteractive/release/v2.5.0
Release version 2.5.0
- Loading branch information
Showing
83 changed files
with
9,182 additions
and
6,561 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,33 @@ | ||
# A set of files you probably don't want in your WordPress.org distribution | ||
*.sql | ||
*.tar.gz | ||
*.zip | ||
.DS_Store | ||
.babelrc | ||
.circleci/config.yml | ||
# Exclusions when publishing to WordPress.org | ||
|
||
# Directories | ||
.git | ||
.github | ||
assets/js/admin-settings | ||
assets/js/components | ||
assets/js/config | ||
assets/js/pluginsidebar | ||
assets/js/services | ||
assets/js/util | ||
node_modules | ||
tests | ||
vendor | ||
|
||
# Files | ||
.distignore | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.json | ||
.git | ||
.github | ||
.gitignore | ||
.gitlab-ci.yml | ||
.idea | ||
.phpcs | ||
.phpcs-cache.json | ||
.nvmrc | ||
.phpcs.xml | ||
.phpcs.xml.dist | ||
.phpstan | ||
.phpcs-cache.json | ||
.phpunit.result.cache | ||
.travis.yml | ||
.vscode | ||
.wordpress-org | ||
.wp-env.json | ||
Gruntfile.js | ||
README.md | ||
Thumbs.db | ||
assets/js/pluginsidebar | ||
assets/js/util | ||
behat.yml | ||
bin | ||
bitbucket-pipelines.yml | ||
babel.config.json | ||
composer.json | ||
composer.lock | ||
multisite.xml | ||
multisite.xml.dist | ||
node_modules | ||
npm-debug.log | ||
package-lock.json | ||
package.json | ||
phpcs.xml | ||
phpcs.xml.dist | ||
phpstan.neon.dist | ||
phpunit.xml | ||
package-lock.json | ||
phpunit.xml.dist | ||
tags | ||
tests | ||
vendor | ||
README.md | ||
webpack.config.js | ||
wp-cli.local.yml | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Publish to Apple News: \Apple_Actions\Index\Channel class | ||
* | ||
* @package Apple_News | ||
*/ | ||
|
||
namespace Apple_Actions\Index; | ||
|
||
require_once dirname( __DIR__ ) . '/class-api-action.php'; | ||
|
||
use Apple_Actions\API_Action; | ||
|
||
/** | ||
* A class to handle a channel request from the admin. | ||
* | ||
* @package Apple_News | ||
*/ | ||
class Channel extends API_Action { | ||
/** | ||
* Get the channel data from Apple News. | ||
* | ||
* @return object|null An object containing the response from the API or null on failure. | ||
*/ | ||
public function perform() { | ||
$channel = get_transient( 'apple_news_channel' ); | ||
if ( false === $channel ) { | ||
if ( $this->is_api_configuration_valid() ) { | ||
$channel = $this->get_api()->get_channel( $this->get_setting( 'api_channel' ) ); | ||
set_transient( 'apple_news_channel', $channel, 300 ); | ||
} | ||
} | ||
|
||
return ! empty( $channel ) ? $channel : null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.