PluginProbe
Friends / 4.3.1
Friends v4.3.1
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / templates / admin / preview-rules.php

preview-rules.php in Friends 4.3.1, at templates/admin/preview-rules.php

95 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This template contains a preview of rules.
4 *
5 * @package Friends
6 */
7
8 namespace Friends;
9
10 /**
11 * Render a preview row.
12 *
13 * @param \WP_Post $_post The post.
14 * @param array $args The arguments.
15 */
16 function preview_row( $_post, $args ) {
17 $modified_post = $args['feed']->apply_feed_rules( $_post, null, $args['friend'] );
18 ?>
19 <tr>
20
21 <td class="title column-title column-primary" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Title' ); ?>"><a href="<?php the_permalink( $modified_post ? $modified_post : $_post ); ?>" rel="noopener noreferrer"><?php echo esc_html( $modified_post ? $modified_post->post_title : $_post->post_title ); ?></a></td>
22 <td class="author column-author" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Author' ); ?>"><?php echo esc_html( get_post_meta( $_post->ID, 'author', true ) ); ?></td>
23 <td class="date column-date" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Date' ); ?>"><?php echo esc_html( date_i18n( __( 'F j, Y g:i a' ), strtotime( $_post->post_date ) ) ); ?></td>
24 <td class="action column-action" data-colname="<?php esc_attr_e( 'Action', 'friends' ); ?>">
25 <?php
26 if ( ! $modified_post || $modified_post->_feed_rule_delete ) {
27 echo esc_html( _x( 'Delete', 'verb', 'friends' ) );
28 ?>
29 </td><td class="view column-view" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'View' ); ?>">
30 <?php
31 } else {
32 if ( isset( $modified_post->_feed_rule_transform['post_status'] ) && 'trash' === $modified_post->_feed_rule_transform['post_status'] ) {
33 echo esc_html( _x( 'Trash', 'verb' ) ); // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
34 } else {
35 echo esc_html( _x( 'Accept', 'verb', 'friends' ) );
36 }
37 ?>
38 </td>
39 <td class="view column-view" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'View' ); ?>">
40 <a href="<?php echo esc_url( $args['friend']->get_local_friends_page_url( $_post->ID ) ); ?>?show-hidden"><?php esc_html_e( 'View post', 'friends' ); ?></a>
41 <?php
42 }
43 ?>
44 </td>
45 </tr>
46 <?php
47 }
48
49 if ( $args['post'] ) :
50 ?>
51 <h2><?php esc_html_e( 'Selected post', 'friends' ); ?></h2>
52
53 <p>
54 <?php
55 esc_html_e( 'You chose muffle this post. To do this, use the rule section above to enter keywords that only match this or similar items. Remember to save your changes.', 'friends' );
56 ?>
57 </p>
58 <table class="wp-list-table widefat fixed striped" style="margin-top: 2em; margin-bottom: 2em; margin-right: 1em">
59 <thead>
60 <tr>
61 <th class="column-primary column-title"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Title' ); ?></th>
62 <th class="column-author"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Author' ); ?></th>
63 <th class="column-date"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Date' ); ?></th>
64 <th class="column-action"><?php esc_html_e( 'Action', 'friends' ); ?></th>
65 <th class="column-view"><?php esc_html_e( 'Friends Page', 'friends' ); ?></th>
66 </tr>
67 </thead>
68 <tbody>
69 <?php preview_row( $args['post'], $args ); ?>
70 <tr>
71 <td colspan="5"><?php echo esc_html( get_the_excerpt( $args['post'] ) ); ?></td>
72 </tr>
73 </tbody>
74 </table>
75 <?php endif; ?>
76
77 <h2><?php esc_html_e( 'Last feed items', 'friends' ); ?></h2>
78
79 <table class="wp-list-table widefat fixed striped" style="margin-top: 2em; margin-bottom: 2em; margin-right: 1em">
80 <tbody>
81 <tr>
82 <th class="column-primary column-title"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Title' ); ?></th>
83 <th class="column-author"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Author' ); ?></th>
84 <th class="column-date"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Date' ); ?></th>
85 <th class="column-action"><?php esc_html_e( 'Action', 'friends' ); ?></th>
86 <th class="column-view"><?php esc_html_e( 'Friends Page', 'friends' ); ?></th>
87 </tr>
88 <?php
89 foreach ( $args['friend_posts']->get_posts() as $_post ) {
90 preview_row( $_post, $args );
91 }
92 ?>
93 </tbody>
94 </table>
95