slug; } /** * @return string */ public function getTitle() { return $this->title; } /** * @return string */ public function getOptionsGroupName() { return 'gdpr_' . $this->getSlug(); } /** * Register a setting on the admin page * * @param $optionName * @param string $args */ public function registerSetting($optionName, $args = []) { register_setting($this->getOptionsGroupName(), $optionName, $args); } /** * Register a section on the admin page * * @param $name * @param $callback */ public function registerSettingSection($id, $title, $callback = null) { add_settings_section( $id, $title, $callback, $this->getOptionsGroupName() ); } /** * Register a setting field on the admin page * * @param $id * @param $title * @param $callback */ public function registerSettingField($id, $title, $callback = null, $section = '', $args = []) { add_settings_field( $id, $title, $callback, $this->getOptionsGroupName(), $section, $args ); } /** * Render the contents including settings fields, sections and submit button. * Trigger hooks for rendering content before and after the settings fields. * * @return string */ public function renderContents() { global $gdpr; $tabs = array("general", "cookie-popup", "consent", "privacy-policy", "do-not-sell", "support"); ob_start(); if (in_array($this->slug, $tabs)) { ?>
Do you like this plugin?
With the PREMIUM version you can have other awesome features:
Custom Consent Text
Data Rectification
Custom relative URLs for the Privacy Policy and other files