PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/QueryMonitor/Output.php +15 -4 2.0.122.6.1 View file →
@@ -64,9 +64,9 @@
64 64 * Add content-control class
65 65 *
66 66 * @param array<string,string> $classes Array of QM classes.
67 67 *
68 - * @return array<string,string>
68 + * @return array<int<0,max>|string,string>
69 69 */
70 70 public function admin_class( $classes ) {
71 71 $classes[] = 'qm-content-control';
72 72
@@ -208,17 +208,28 @@
208 208 foreach ( $posts as $post_id => $post_data ) {
209 209 if ( 'main' === $post_id ) {
210 210 continue;
211 211 }
212 - $post = get_post( $post_id );
213 212
213 + if ( strpos( $post_data['context'], 'terms' ) !== false ) {
214 + $term = get_term( $post_id );
215 + $name = $term->name;
216 + $type = 'TAX: ' . $term->taxonomy;
217 + } elseif ( strpos( $post_data['context'], 'posts' ) !== false ) {
218 + $post = get_post( $post_id );
219 + $name = $post->post_title;
220 + $type = 'PT: ' . $post->post_type;
221 + } else {
222 + continue;
223 + }
224 +
214 225 $user_can_view = $post_data['user_can_view'] ? 'Yes' : 'No';
215 226 $restrictions = $post_data['restrictions'] ? $post_data['restrictions'] : [];
216 227
217 228 echo '<tr>';
218 229 echo '<td>' . esc_html( $post_id ) . '</td>';
219 - echo '<td>' . esc_html( $post->post_title ) . '</td>';
220 - echo '<td>' . esc_html( $post->post_type ) . '</td>';
230 + echo '<td>' . esc_html( $name ) . '</td>';
231 + echo '<td>' . esc_html( $type ) . '</td>';
221 232 echo '<td>' . esc_html( $post_data['context'] ) . '</td>';
222 233 echo '<td>' . esc_html( $user_can_view ) . '</td>';
223 234
224 235 $restrictions_html = [];