PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.1
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.1
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / Tweaks_Feed.php

Tweaks_Feed.php in Adminify – White Label, Admin Menu Editor, Login Customizer 3.2.1, at Inc/Admin/Options/Tweaks_Feed.php

89 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\AdminSettingsModel;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die;
10 } // Cannot access directly.
11
12 class Tweaks_Feed extends AdminSettingsModel {
13
14 public function __construct() {
15 $this->tweaks_feed_settings();
16 }
17
18 public function get_defaults() {
19 return [
20 'remove_feed' => false,
21 'redirect_feed' => false,
22 ];
23 }
24
25
26 /**
27 * Tweaks: Feed Fields
28 *
29 * @param [type] $feed_fields
30 *
31 * @return void
32 */
33 public function tweaks_feed_fields( &$feed_fields ) {
34 $feed_fields[] = [
35 'type' => 'subheading',
36 'content' => Utils::adminfiy_help_urls(
37 __( 'Cleanup your head section from feed links and redirect them to the homepage if needed.', 'adminify' ),
38 'https://wpadminify.com/kb/wp-adminify-tweaks/',
39 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
40 'https://www.facebook.com/groups/jeweltheme',
41 'https://wpadminify.com/support/'
42 ),
43 ];
44
45 $feed_fields[] = [
46 'id' => 'remove_feed',
47 'type' => 'switcher',
48 'title' => __( 'Remove Feed Links', 'adminify' ),
49 'subtitle' => __( 'Remove all feed links from head section', 'adminify' ),
50 'label' => __( 'This option does not disable feed functionality, just cleans head section.', 'adminify' ),
51 'text_on' => __( 'Yes', 'adminify' ),
52 'text_off' => __( 'No', 'adminify' ),
53 'text_width' => 80,
54 'default' => $this->get_default_field( 'remove_feed' ),
55 ];
56
57 $feed_fields[] = [
58 'id' => 'redirect_feed',
59 'type' => 'switcher',
60 'title' => __( 'Redirect ALL Feeds', 'adminify' ),
61 'subtitle' => __( 'Disable feeds feature by redirection to the homepage (also removes feed links from head section)', 'adminify' ),
62 'label' => __( 'This option totally disables feed functionality. If you are using feeds on your site (e.g. FeedBurner) do not disable feeds.', 'adminify' ),
63 'text_on' => __( 'Yes', 'adminify' ),
64 'text_off' => __( 'No', 'adminify' ),
65 'text_width' => 80,
66 'default' => $this->get_default_field( 'redirect_feed' ),
67 ];
68 }
69
70 public function tweaks_feed_settings() {
71 if ( ! class_exists( 'ADMINIFY' ) ) {
72 return;
73 }
74
75 $feed_fields = [];
76 $this->tweaks_feed_fields( $feed_fields );
77
78 \ADMINIFY::createSection(
79 $this->prefix,
80 [
81 'title' => __( 'Feed', 'adminify' ),
82 'parent' => 'tweaks_performance',
83 'icon' => 'fas fa-rss-square',
84 'fields' => $feed_fields,
85 ]
86 );
87 }
88 }
89