forked from beezwax/WP-Publish-to-Apple-News
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathpage-index.php
57 lines (56 loc) · 1.86 KB
/
page-index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Publish to Apple News partials: Index page template
*
* phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
*
* @global Admin_Apple_News_List_Table $table
*
* @package Apple_News
*/
$apple_current_screen = get_current_screen(); ?>
<div class="wrap">
<h1><?php esc_html_e( 'Apple News', 'apple-news' ); ?></h1>
<?php if ( ! \Apple_News::is_initialized() ) : ?>
<div id="apple-news-publish">
<?php
printf(
/* translators: First token is opening a tag, second is closing a tag */
esc_html__( 'You must enter your API information on the %1$ssettings page%2$s before using Publish to Apple News.', 'apple-news' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=apple-news-options' ) ) . '">',
'</a>'
);
?>
</div>
<?php else : ?>
<form method="get">
<?php
/**
* Allows for custom HTML to be printed before the article list table.
*
* This is called the "index table" because it is the table that is
* printed on the main (or "index") page of the plugin, which is accessed
* by clicking on Apple News in the WordPress sidebar.
*/
do_action( 'apple_news_before_index_table' );
?>
<?php if ( ! empty( $apple_current_screen->parent_base ) ) : ?>
<input type="hidden" name="page" value="<?php echo esc_attr( $apple_current_screen->parent_base ); ?>">
<?php endif; ?>
<?php
$table->search_box( __( 'Search', 'apple-news' ), 'apple-news-search' );
$table->display();
?>
<?php
/**
* Allows for custom HTML to be printed after the article list table.
*
* This is called the "index table" because it is the table that is
* printed on the main (or "index") page of the plugin, which is accessed
* by clicking on Apple News in the WordPress sidebar.
*/
do_action( 'apple_news_after_index_table' );
?>
</form>
<?php endif; ?>
</div>