Admin notice for update permalink settings!
972307
public function admin_notices() {
		if ( version_compare( get_option( 'cptp_permalink_checked' ), '3.0.0', '<' ) ) {
			// translators: %s URL.
			$format  = __( '[Custom Post Type Permalinks] <a href="%s"><strong>Please check your permalink settings!</strong></a>', 'custom-post-type-permalinks' );
			$message = sprintf( $format, admin_url( 'options-permalink.php' ) );
			echo sprintf( '<div class="notice notice-warning"><p>%s</p></div>', wp_kses( $message, wp_kses_allowed_html( 'post' ) ) );
		}
	}
1280703
public function create_admin_page() {
		$action = is_multisite() ? 'edit.php?action=github-updater' : 'options.php';
		$tab    = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : 'github_updater_settings';
		$subtab = isset( $_GET['subtab'] ) ? esc_attr( $_GET['subtab'] ) : 'github_updater';
		$logo   = plugins_url( basename( GITHUB_UPDATER_DIR ) . '/assets/GitHub_Updater_logo_small.png' ); ?>
		<div class="wrap github-updater-settings">
			<h1>
				<a href="https://github.com/afragen/github-updater" target="_blank"><img src="<?php esc_attr_e( $logo ); ?>" alt="GitHub Updater logo" /></a><br>
				<?php esc_html_e( 'GitHub Updater', 'github-updater' ); ?>
			</h1>
			<?php $this->options_tabs(); ?>
			<?php $this->admin_page_notices(); ?>
			<?php if ( 'github_updater_settings' === $tab ) : ?>
				<?php $this->options_sub_tabs(); ?>
				<form class="settings" method="post" action="<?php esc_attr_e( $action ); ?>">
					<?php
					settings_fields( 'github_updater' );
					if ( 'github_updater' === $subtab ) {
						do_settings_sections( 'github_updater_install_settings' );
						$this->add_hidden_settings_sections();
					} else {
						do_settings_sections( 'github_updater_' . $subtab . '_install_settings' );
						$this->display_ghu_repos( $subtab );
						$this->add_hidden_settings_sections( $subtab );
					}
					submit_button();
					?>
				</form>
				<?php $refresh_transients = add_query_arg( [ 'github_updater_refresh_transients' => true ], $action ); ?>
				<form class="settings" method="post" action="<?php esc_attr_e( $refresh_transients ); ?>">
					<?php submit_button( esc_html__( 'Refresh Cache', 'github-updater' ), 'primary', 'ghu_refresh_cache' ); ?>
				</form>
			<?php endif; ?>

			<?php
			/**
			 * Action hook to add admin page data to appropriate $tab.
			 *
			 * @since 8.0.0
			 *
			 * @param string $tab    Name of tab.
			 * @param string $action Save action for appropriate WordPress installation.
			 *                       Single site or Multisite.
			 */
			do_action( 'github_updater_add_admin_page', $tab, $action );
			?>
		</div>
		<?php
	}
1332592
public function index() {        
        $action = Filter::post('action');        
        if($action == 'update' && Filter::checkCsrf()) $this->update();
        
        Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
        $ctrl = new PageController();
        $ctrl
            ->restrictAccess(Auth::isAdmin())
            ->setPageTitle($this->module->getTitle());

        $view_bag = new ViewBag();
        $view_bag->set('title', $ctrl->getPageTitle());
        $view_bag->set('module', $this->module);
        
        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
    }
161079
def user_modify(attribs)
      defaults = {user_name: "!", min_bal: "!",
                  email: "!", dept_name: "!", pimary_pin: "!",
                  secondary_pin: "!", quota: "!", alternate_pin: "!",
                  home_server: "!", locked: "!", location: "!",
                  default_bc: "!", additional_info: "!", home_folder: "!"}
      attribs = defaults.merge(attribs)
      attribs = check_atrribs(attribs)
      "modify ur #{attribs[:user_id]} \"#{attribs[:user_name]}\"" +
      " #{attribs[:min_bal]} #{attribs[:email]} #{attribs[:dept_name]}" +
      " #{attribs[:primary_pin]} #{attribs[:secondary_pin]}" +
      " #{attribs[:quota]} #{attribs[:alternate_pin]}" +
      " #{attribs[:home_server]} #{attribs[:locked]}" +
      " #{attribs[:location]} #{attribs[:default_bc]}" +
      " #{attribs[:additional_info]} #{attribs[:home_folder]}"
    end
510234
public static function displayNotices()
    {
        if ($notices = get_option('staticwp_deferred_admin_notices')) {
            foreach ($notices as $notice) {
                $message = $notice;
                $type = 'updated';

                if (is_array($notice)) {
                    $message = isset($notice['message']) ? $notice['message'] : '';
                    $type = isset($notice['type']) ? $notice['type'] : $type;
                }

                echo '<div class="' . $type . '"><p>' . $message . '</p></div>';
            }
            delete_option('staticwp_deferred_admin_notices');
        }
    }
128227
def update_seo_description
      @post = LatoBlog::Post.find_by(id: params[:id])
      return unless check_post_presence

      @post.update(seo_description: params[:seo_description])
    end
1037682
public function updateSettings()
    {
        $settings = \Input::all();

        foreach ($settings as $key => $value) {
            $option = str_replace('_', '.', $key);

            Option::findByKey($option)->update([
                'value' => $value,
            ]);
        }

        return \Redirect::back()->withFlashMessage('Settings has been successfully updated!');
    }
69447
protected function updateSettings()
    {
        $this->controlAccess('settings_edit');

        foreach ($this->getSubmitted() as $key => $value) {
            $this->config->set($key, $value);
        }

        $this->redirect('', $this->text('Settings have been updated'), 'success');
    }
518688
function disable_wporg_update( $r, $url ) {

		if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
			return $r;
		}

		// Decode the JSON response.
		$themes = json_decode( $r['body']['themes'] );

		unset( $themes->themes->{$this->product->get_slug()} );

		// Encode the updated JSON response.
		$r['body']['themes'] = json_encode( $themes );

		return $r;
	}
442561
public function postTypeSettings()
    {
        // Add section
        add_settings_section(
            'olympus-permalinks',
            Translate::t('posttypehook.custom_permalinks'),
            [&$this,'postTypeSettingTitle'],
            'permalink'
        );

        // Flush all rewrite rules
        if (isset($_POST['flushpermalink'])) {
            flush_rewrite_rules();
        }

        // Special case: do not change post/page component
        if (in_array($this->slug, $this->reserved_slugs)) {
            return false;
        }

        // Option
        $opt = 'permalink_structure_'.$this->slug;

        // Check POST
        if (isset($_POST[$opt])) {
            $value = $_POST[$opt];
            Option::set($opt, $value);
        } else {
            $value = Option::get($opt, '/%'.$this->slug.'%-%post_id%');
        }

        // Define metabox title
        $title = $this->name.' <code>%'.$this->slug.'%</code>';

        // Add fields
        add_settings_field(
            $opt,
            $title,
            [$this, 'postTypeSettingFunc'],
            'permalink',
            'olympus-permalinks',
            [
                'name' => $opt,
                'value' => $value,
            ]
        );

        return true;
    }
362083
private function should_add_sticky_optin_notice() {
            if ( fs_is_network_admin() ) {
                if ( ! $this->_is_network_active ) {
                    return false;
                }

                if ( ! $this->is_network_activation_mode() ) {
                    return false;
                }

                return ! isset( $this->_storage->sticky_optin_added_ms );
            }

            if ( ! $this->is_activation_mode() ) {
                return false;
            }

            // If running from a blog admin and delegated the connection.
            return ! isset( $this->_storage->sticky_optin_added );
        }
141056
public static function _maybe_update_settings() {
		if ( ! empty( $_POST['menu-icons']['settings'] ) ) {
			check_admin_referer( self::UPDATE_KEY, self::UPDATE_KEY );

			$redirect_url = self::_update_settings( $_POST['menu-icons']['settings'] ); // Input var okay.
			wp_redirect( $redirect_url );
		} elseif ( ! empty( $_REQUEST[ self::RESET_KEY ] ) ) {
			check_admin_referer( self::RESET_KEY, self::RESET_KEY );
			wp_redirect( self::_reset_settings() );
		}
	}
1104074
private function show_plugin_update_notices() {
		add_action( 'in_plugin_update_message-' . $this->app->define->plugin_base_name, function ( $data, $r ) {
			$new_version = $r->new_version;
			$url         = $this->app->utility->array_get( $data, 'PluginURI' );
			$notices     = $this->get_upgrade_notices( $new_version, $url );
			if ( ! empty( $notices ) ) {
				$this->get_view( 'admin/include/upgrade', [
					'notices' => $notices,
				], true );
			}
		}, 10, 2 );
	}
286014
public function update_8006007() {
    $composer_json = $this->updater->getComposerJson();
    if (!empty($composer_json['extra']['drupal-scaffold']['excludes'])) {
      $composer_json['extra']['drupal-scaffold']['excludes'] = array_unique(array_values($composer_json['extra']['drupal-scaffold']['excludes']));
    }
    $this->updater->writeComposerJson($composer_json);
  }
275150
public function postSettings()
    {
        $setting = app(Repository::class);

        if (Binput::get('remove_banner') === '1') {
            $setting->set('app_banner', null);
        }

        $parameters = Binput::all();

        if (isset($parameters['header'])) {
            if ($header = Binput::get('header', null, false, false)) {
                $setting->set('header', $header);
            } else {
                $setting->delete('header');
            }
        }

        if (isset($parameters['footer'])) {
            if ($footer = Binput::get('footer', null, false, false)) {
                $setting->set('footer', $footer);
            } else {
                $setting->delete('footer');
            }
        }

        if (isset($parameters['stylesheet'])) {
            if ($stylesheet = Binput::get('stylesheet', null, false, false)) {
                $setting->set('stylesheet', $stylesheet);
            } else {
                $setting->delete('stylesheet');
            }
        }

        if (Binput::hasFile('app_banner')) {
            $this->handleUpdateBanner($setting);
        }

        $excludedParams = [
            '_token',
            'app_banner',
            'remove_banner',
            'header',
            'footer',
            'stylesheet',
        ];

        try {
            foreach (Binput::except($excludedParams) as $settingName => $settingValue) {
                if ($settingName === 'app_analytics_pi_url') {
                    $settingValue = rtrim($settingValue, '/');
                }

                $setting->set($settingName, $settingValue);
            }
        } catch (Exception $e) {
            return Redirect::back()->withErrors(trans('dashboard.settings.edit.failure'));
        }

        if (Binput::has('app_locale')) {
            Lang::setLocale(Binput::get('app_locale'));
        }

        if (Binput::has('always_authenticate')) {
            Artisan::call('route:clear');
        }

        return Redirect::back()->withSuccess(trans('dashboard.settings.edit.success'));
    }
1024966
def update
      @script_url.user_id = current_user.id
      @script_url.org_id = current_user.org_id
      if @script_url.update(script_url_params)
        redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
        else
          render :edit
      end
    end
564647
function replacePermalink(permalink, resource) {
    let output = permalink,
        primaryTagFallback = 'all',
        publishedAtMoment = moment.tz(resource.published_at || Date.now(), settingsCache.get('active_timezone')),
        permalinkLookUp = {
            year: function () {
                return publishedAtMoment.format('YYYY');
            },
            month: function () {
                return publishedAtMoment.format('MM');
            },
            day: function () {
                return publishedAtMoment.format('DD');
            },
            author: function () {
                return resource.primary_author.slug;
            },
            primary_author: function () {
                return resource.primary_author ? resource.primary_author.slug : primaryTagFallback;
            },
            primary_tag: function () {
                return resource.primary_tag ? resource.primary_tag.slug : primaryTagFallback;
            },
            slug: function () {
                return resource.slug;
            },
            id: function () {
                return resource.id;
            }
        };

    // replace tags like :slug or :year with actual values
    output = output.replace(/(:[a-z_]+)/g, function (match) {
        if (_.has(permalinkLookUp, match.substr(1))) {
            return permalinkLookUp[match.substr(1)]();
        }
    });

    return output;
}