芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/code-snippets/php/class-active-snippets.php
active_snippets[ $scope_key ] ) ) { $this->active_snippets[ $scope_key ] = code_snippets()->db->fetch_active_snippets( $scope ); } return $this->active_snippets[ $scope_key ]; } /** * Print snippet code fetched from the database from a certain scope. * * @param string $scope Name of scope to print. */ private function print_content_snippets( string $scope ) { $snippets_list = $this->fetch_active_snippets( [ 'head-content', 'footer-content' ] ); foreach ( $snippets_list as $snippets ) { foreach ( $snippets as $snippet ) { if ( $scope === $snippet['scope'] ) { // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo "\n", $snippet['code'], "\n"; } } } } /** * Print head content snippets. */ public function load_head_content() { $this->print_content_snippets( 'head-content' ); } /** * Print footer content snippets. */ public function load_footer_content() { $this->print_content_snippets( 'footer-content' ); } }