Submit
Path:
F:
/
Inetpub
/
vhosts
/
solasmarine.com.tr
/
httpdocs
/
wp-includes
/
File Content:
class-wp-icons-registry.php
<?php /** * Icons API: WP_Icons_Registry class * * @package WordPress * @since 7.0.0 */ /** * Core class used for interacting with registered icons. * * @since 7.0.0 */ class WP_Icons_Registry { /** * Registered icons array. * * @var array[] */ protected $registered_icons = array(); /** * Container for the main instance of the class. * * @var WP_Icons_Registry|null */ protected static $instance = null; /** * Constructor. * * WP_Icons_Registry is a singleton class, so keep this protected. * * For 7.0, the Icons Registry is closed for third-party icon registry, * serving only a subset of core icons. * * These icons are defined in @wordpress/packages (Gutenberg repository) as * SVG files and as entries in a single manifest file. On init, the * registry is loaded with those icons listed in the manifest. */ protected function __construct() { $icons_directory = __DIR__ . '/images/icon-library/'; $manifest_path = __DIR__ . '/assets/icon-library-manifest.php'; if ( ! is_readable( $manifest_path ) ) { wp_trigger_error( __METHOD__, __( 'Core icon collection manifest is missing or unreadable.' ) ); return; } $collection = include $manifest_path; if ( empty( $collection ) ) { wp_trigger_error( __METHOD__, __( 'Core icon collection manifest is empty or invalid.' ) ); return; } foreach ( $collection as $icon_name => $icon_data ) { if ( empty( $icon_data['filePath'] ) || ! is_string( $icon_data['filePath'] ) ) { _doing_it_wrong( __METHOD__, __( 'Core icon collection manifest must provide valid a "filePath" for each icon.' ), '7.0.0' ); return; } $this->register( 'core/' . $icon_name, array( 'label' => $icon_data['label'], 'filePath' => $icons_directory . $icon_data['filePath'], ) ); } } /** * Registers an icon. * * @param string $icon_name Icon name including namespace. * @param array $icon_properties { * List of properties for the icon. * * @type string $label Required. A human-readable label for the icon. * @type string $content Optional. SVG markup for the icon. * If not provided, the content will be retrieved from the `filePath` if set. * If both `content` and `filePath` are not set, the icon will not be registered. * @type string $filePath Optional. The full path to the file containing the icon content. * } * @return bool True if the icon was registered with success and false otherwise. */ protected function register( $icon_name, $icon_properties ) { if ( ! isset( $icon_name ) || ! is_string( $icon_name ) ) { _doing_it_wrong( __METHOD__, __( 'Icon name must be a string.' ), '7.0.0' ); return false; } $allowed_keys = array_fill_keys( array( 'label', 'content', 'filePath' ), 1 ); foreach ( array_keys( $icon_properties ) as $key ) { if ( ! array_key_exists( $key, $allowed_keys ) ) { _doing_it_wrong( __METHOD__, sprintf( // translators: %s is the name of any user-provided key __( 'Invalid icon property: "%s".' ), $key ), '7.0.0' ); return false; } } if ( ! isset( $icon_properties['label'] ) || ! is_string( $icon_properties['label'] ) ) { _doing_it_wrong( __METHOD__, __( 'Icon label must be a string.' ), '7.0.0' ); return false; } if ( ( ! isset( $icon_properties['content'] ) && ! isset( $icon_properties['filePath'] ) ) || ( isset( $icon_properties['content'] ) && isset( $icon_properties['filePath'] ) ) ) { _doing_it_wrong( __METHOD__, __( 'Icons must provide either `content` or `filePath`.' ), '7.0.0' ); return false; } if ( isset( $icon_properties['content'] ) ) { if ( ! is_string( $icon_properties['content'] ) ) { _doing_it_wrong( __METHOD__, __( 'Icon content must be a string.' ), '7.0.0' ); return false; } $sanitized_icon_content = $this->sanitize_icon_content( $icon_properties['content'] ); if ( empty( $sanitized_icon_content ) ) { _doing_it_wrong( __METHOD__, __( 'Icon content does not contain valid SVG markup.' ), '7.0.0' ); return false; } } $icon = array_merge( $icon_properties, array( 'name' => $icon_name ) ); $this->registered_icons[ $icon_name ] = $icon; return true; } /** * Sanitizes the icon SVG content. * * Logic borrowed from twentytwenty. * @see twentytwenty_get_theme_svg * * @param string $icon_content The icon SVG content to sanitize. * @return string The sanitized icon SVG content. */ protected function sanitize_icon_content( $icon_content ) { $allowed_tags = array( 'svg' => array( 'class' => true, 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'aria-hidden' => true, 'role' => true, 'focusable' => true, ), 'path' => array( 'fill' => true, 'fill-rule' => true, 'd' => true, 'transform' => true, ), 'polygon' => array( 'fill' => true, 'fill-rule' => true, 'points' => true, 'transform' => true, 'focusable' => true, ), ); return wp_kses( $icon_content, $allowed_tags ); } /** * Retrieves the content of a registered icon. * * @param string $icon_name Icon name including namespace. * @return string|null The content of the icon, if found. */ protected function get_content( $icon_name ) { if ( ! isset( $this->registered_icons[ $icon_name ]['content'] ) ) { $content = file_get_contents( $this->registered_icons[ $icon_name ]['filePath'] ); $content = $this->sanitize_icon_content( $content ); if ( empty( $content ) ) { wp_trigger_error( __METHOD__, __( 'Icon content does not contain valid SVG markup.' ) ); return null; } $this->registered_icons[ $icon_name ]['content'] = $content; } return $this->registered_icons[ $icon_name ]['content']; } /** * Retrieves an array containing the properties of a registered icon. * * * @param string $icon_name Icon name including namespace. * @return array|null Registered icon properties or `null` if the icon is not registered. */ public function get_registered_icon( $icon_name ) { if ( ! $this->is_registered( $icon_name ) ) { return null; } $icon = $this->registered_icons[ $icon_name ]; $icon['content'] = $icon['content'] ?? $this->get_content( $icon_name ); return $icon; } /** * Retrieves all registered icons. * * @param string $search Optional. Search term by which to filter the icons. * @return array[] Array of arrays containing the registered icon properties. */ public function get_registered_icons( $search = '' ) { $icons = array(); foreach ( $this->registered_icons as $icon ) { if ( ! empty( $search ) && false === stripos( $icon['name'], $search ) ) { continue; } $icon['content'] = $icon['content'] ?? $this->get_content( $icon['name'] ); $icons[] = $icon; } return $icons; } /** * Checks if an icon is registered. * * * @param string $icon_name Icon name including namespace. * @return bool True if the icon is registered, false otherwise. */ public function is_registered( $icon_name ) { return isset( $this->registered_icons[ $icon_name ] ); } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * * @return WP_Icons_Registry The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } }
Edit
Rename
Chmod
Delete
FILE
DIR
INFO
CMD
Name
Size
Permission
Action
ID3
---
0777
IXR
---
0777
PHPMailer
---
0777
Requests
---
0777
SimplePie
---
0777
Text
---
0777
abilities-api
---
0777
ai-client
---
0777
assets
---
0777
block-bindings
---
0777
block-patterns
---
0777
block-supports
---
0777
blocks
---
0777
build
---
0777
certificates
---
0777
collaboration
---
0777
css
---
0777
customize
---
0777
fonts
---
0777
html-api
---
0777
images
---
0777
interactivity-api
---
0777
js
---
0777
l10n
---
0777
php-ai-client
---
0777
php-compat
---
0777
pomo
---
0777
rest-api
---
0777
sitemaps
---
0777
sodium_compat
---
0777
style-engine
---
0777
theme-compat
---
0777
widgets
---
0777
abilities-api.php
24369bytes
0666
abilities.php
8009bytes
0666
admin-bar.php
39315bytes
0666
ai-client.php
2549bytes
0666
atomlib.php
12181bytes
0666
author-template.php
19844bytes
0666
block-bindings.php
7526bytes
0666
block-editor.php
28724bytes
0666
block-i18n.json
316bytes
0666
block-patterns.php
15606bytes
0666
block-template-utils.php
62804bytes
0666
block-template.php
18261bytes
0666
blocks.php
119442bytes
0666
bookmark-template.php
12768bytes
0666
bookmark.php
15427bytes
0666
cache-compat.php
11021bytes
0666
cache.php
13486bytes
0666
canonical.php
34645bytes
0666
capabilities.php
43633bytes
0666
category-template.php
56985bytes
0666
category.php
12834bytes
0666
class-IXR.php
2616bytes
0666
class-avif-info.php
30008bytes
0666
class-feed.php
539bytes
0666
class-http.php
367bytes
0666
class-json.php
43676bytes
0666
class-oembed.php
401bytes
0666
class-phpass.php
6771bytes
0666
class-phpmailer.php
664bytes
0666
class-pop3.php
21121bytes
0666
class-requests.php
2237bytes
0666
class-simplepie.php
453bytes
0666
class-smtp.php
457bytes
0666
class-snoopy.php
37715bytes
0666
class-walker-category-dropdown.php
2469bytes
0666
class-walker-category.php
8477bytes
0666
class-walker-comment.php
14221bytes
0666
class-walker-nav-menu.php
12044bytes
0666
class-walker-page-dropdown.php
2710bytes
0666
class-walker-page.php
7612bytes
0666
class-wp-admin-bar.php
18004bytes
0666
class-wp-ajax-response.php
5266bytes
0666
class-wp-application-passwords.php
17099bytes
0666
class-wp-block-bindings-registry.php
8263bytes
0666
class-wp-block-bindings-source.php
2992bytes
0666
class-wp-block-editor-context.php
1350bytes
0666
class-wp-block-list.php
4713bytes
0666
class-wp-block-metadata-registry.php
11846bytes
0666
class-wp-block-parser-block.php
2555bytes
0666
class-wp-block-parser-frame.php
1994bytes
0666
class-wp-block-parser.php
11520bytes
0666
class-wp-block-pattern-categories-registry.php
4383bytes
0666
class-wp-block-patterns-registry.php
10312bytes
0666
class-wp-block-processor.php
69959bytes
0666
class-wp-block-styles-registry.php
6419bytes
0666
class-wp-block-supports.php
6551bytes
0666
class-wp-block-template.php
2033bytes
0666
class-wp-block-templates-registry.php
7080bytes
0666
class-wp-block-type-registry.php
5030bytes
0666
class-wp-block-type.php
17233bytes
0666
class-wp-block.php
24720bytes
0666
class-wp-classic-to-block-menu-converter.php
4026bytes
0666
class-wp-comment-query.php
48631bytes
0666
class-wp-comment.php
9371bytes
0666
class-wp-connector-registry.php
14409bytes
0666
class-wp-customize-control.php
26119bytes
0666
class-wp-customize-manager.php
202881bytes
0666
class-wp-customize-nav-menus.php
57968bytes
0666
class-wp-customize-panel.php
10710bytes
0666
class-wp-customize-section.php
11209bytes
0666
class-wp-customize-setting.php
29963bytes
0666
class-wp-customize-widgets.php
72594bytes
0666
class-wp-date-query.php
35970bytes
0666
class-wp-dependencies.php
17089bytes
0666
class-wp-dependency.php
2653bytes
0666
class-wp-duotone.php
40910bytes
0666
class-wp-editor.php
72228bytes
0666
class-wp-embed.php
15908bytes
0666
class-wp-error.php
7502bytes
0666
class-wp-exception.php
253bytes
0666
class-wp-fatal-error-handler.php
8150bytes
0666
class-wp-feed-cache-transient.php
3304bytes
0666
class-wp-feed-cache.php
969bytes
0666
class-wp-hook.php
16636bytes
0666
class-wp-http-cookie.php
7269bytes
0666
class-wp-http-curl.php
13261bytes
0666
class-wp-http-encoding.php
6689bytes
0666
class-wp-http-ixr-client.php
3516bytes
0666
class-wp-http-proxy.php
5980bytes
0666
class-wp-http-requests-hooks.php
2022bytes
0666
class-wp-http-requests-response.php
4243bytes
0666
class-wp-http-response.php
2977bytes
0666
class-wp-http-streams.php
16764bytes
0666
class-wp-http.php
41648bytes
0666
class-wp-icons-registry.php
7857bytes
0666
class-wp-image-editor-gd.php
20705bytes
0666
class-wp-image-editor-imagick.php
36977bytes
0666
class-wp-image-editor.php
17418bytes
0666
class-wp-list-util.php
7443bytes
0666
class-wp-locale-switcher.php
6776bytes
0666
class-wp-locale.php
16848bytes
0666
class-wp-matchesmapregex.php
1828bytes
0666
class-wp-meta-query.php
30507bytes
0666
class-wp-metadata-lazyloader.php
6833bytes
0666
class-wp-navigation-fallback.php
9193bytes
0666
class-wp-network-query.php
19714bytes
0666
class-wp-network.php
12296bytes
0666
class-wp-object-cache.php
17524bytes
0666
class-wp-oembed-controller.php
6905bytes
0666
class-wp-oembed.php
31603bytes
0666
class-wp-paused-extensions-storage.php
5067bytes
0666
class-wp-phpmailer.php
4348bytes
0666
class-wp-plugin-dependencies.php
25182bytes
0666
class-wp-post-type.php
30672bytes
0666
class-wp-post.php
6483bytes
0666
class-wp-query.php
163331bytes
0666
class-wp-recovery-mode-cookie-service.php
6877bytes
0666
class-wp-recovery-mode-email-service.php
11166bytes
0666
class-wp-recovery-mode-key-service.php
4914bytes
0666
class-wp-recovery-mode-link-service.php
3523bytes
0666
class-wp-recovery-mode.php
11453bytes
0666
class-wp-rewrite.php
63693bytes
0666
class-wp-role.php
2523bytes
0666
class-wp-roles.php
9321bytes
0666
class-wp-script-modules.php
40599bytes
0666
class-wp-scripts.php
36789bytes
0666
class-wp-session-tokens.php
7319bytes
0666
class-wp-simplepie-file.php
3552bytes
0666
class-wp-simplepie-sanitize-kses.php
1910bytes
0666
class-wp-site-query.php
31482bytes
0666
class-wp-site.php
7459bytes
0666
class-wp-speculation-rules.php
7554bytes
0666
class-wp-styles.php
13356bytes
0666
class-wp-tax-query.php
19577bytes
0666
class-wp-taxonomy.php
18559bytes
0666
class-wp-term-query.php
40751bytes
0666
class-wp-term.php
5263bytes
0666
class-wp-text-diff-renderer-inline.php
979bytes
0666
class-wp-text-diff-renderer-table.php
18932bytes
0666
class-wp-textdomain-registry.php
10481bytes
0666
class-wp-theme-json-data.php
1809bytes
0666
class-wp-theme-json-resolver.php
35692bytes
0666
class-wp-theme-json-schema.php
7367bytes
0666
class-wp-theme-json.php
173639bytes
0666
class-wp-theme.php
65761bytes
0666
class-wp-token-map.php
28618bytes
0666
class-wp-url-pattern-prefixer.php
4802bytes
0666
class-wp-user-meta-session-tokens.php
2954bytes
0666
class-wp-user-query.php
44102bytes
0666
class-wp-user-request.php
2305bytes
0666
class-wp-user.php
23016bytes
0666
class-wp-walker.php
13322bytes
0666
class-wp-widget-factory.php
3347bytes
0666
class-wp-widget.php
18417bytes
0666
class-wp-xmlrpc-server.php
215020bytes
0666
class-wp.php
26371bytes
0666
class-wpdb.php
118638bytes
0666
class.wp-dependencies.php
373bytes
0666
class.wp-scripts.php
343bytes
0666
class.wp-styles.php
338bytes
0666
collaboration.php
2158bytes
0666
comment-template.php
103211bytes
0666
comment.php
134085bytes
0666
compat-utf8.php
19554bytes
0666
compat.php
16063bytes
0666
connectors.php
24080bytes
0666
cron.php
44996bytes
0666
date.php
400bytes
0666
default-constants.php
11365bytes
0666
default-filters.php
37417bytes
0666
default-widgets.php
2295bytes
0666
deprecated.php
193977bytes
0666
embed-template.php
338bytes
0666
embed.php
38906bytes
0666
error-protection.php
4092bytes
0666
feed-atom-comments.php
5504bytes
0666
feed-atom.php
3121bytes
0666
feed-rdf.php
2668bytes
0666
feed-rss.php
1189bytes
0666
feed-rss2-comments.php
4136bytes
0666
feed-rss2.php
3799bytes
0666
feed.php
25189bytes
0666
fonts.php
9790bytes
0666
formatting.php
354690bytes
0666
functions.php
290326bytes
0666
functions.wp-scripts.php
20492bytes
0666
functions.wp-styles.php
8654bytes
0666
general-template.php
174934bytes
0666
global-styles-and-settings.php
20780bytes
0666
http.php
27255bytes
0666
https-detection.php
5857bytes
0666
https-migration.php
4741bytes
0666
kses.php
82580bytes
0666
l10n.php
71415bytes
0666
link-template.php
160147bytes
0666
load.php
56475bytes
0666
locale.php
162bytes
0666
media-template.php
63275bytes
0666
media.php
223794bytes
0666
meta.php
66739bytes
0666
ms-blogs.php
26331bytes
0666
ms-default-constants.php
4921bytes
0666
ms-default-filters.php
6636bytes
0666
ms-deprecated.php
21750bytes
0666
ms-files.php
2857bytes
0666
ms-functions.php
91842bytes
0666
ms-load.php
20038bytes
0666
ms-network.php
3782bytes
0666
ms-settings.php
4204bytes
0666
ms-site.php
41729bytes
0666
nav-menu-template.php
25990bytes
0666
nav-menu.php
44269bytes
0666
option.php
105079bytes
0666
pluggable-deprecated.php
6324bytes
0666
pluggable.php
127558bytes
0666
plugin.php
36501bytes
0666
post-formats.php
7070bytes
0666
post-template.php
68615bytes
0666
post-thumbnail-template.php
10879bytes
0666
post.php
296525bytes
0666
query.php
37095bytes
0666
registration-functions.php
200bytes
0666
registration.php
200bytes
0666
rest-api.php
100881bytes
0666
revision.php
30712bytes
0666
rewrite.php
19461bytes
0666
robots-template.php
5185bytes
0666
rss-functions.php
255bytes
0666
rss.php
23203bytes
0666
script-loader.php
163126bytes
0666
script-modules.php
11943bytes
0666
session.php
258bytes
0666
shortcodes.php
24034bytes
0666
sitemaps.php
3238bytes
0666
speculative-loading.php
8600bytes
0666
spl-autoload-compat.php
441bytes
0666
style-engine.php
7563bytes
0666
taxonomy.php
177144bytes
0666
template-canvas.php
544bytes
0666
template-loader.php
4267bytes
0666
template.php
36824bytes
0666
theme-i18n.json
1892bytes
0666
theme-previews.php
2887bytes
0666
theme-templates.php
4060bytes
0666
theme.json
9037bytes
0666
theme.php
134631bytes
0666
update.php
38276bytes
0666
user.php
178824bytes
0666
utf8.php
7260bytes
0666
vars.php
6607bytes
0666
version.php
1131bytes
0666
view-transitions.php
602bytes
0666
widgets.php
70828bytes
0666
wp-db.php
445bytes
0666
wp-diff.php
799bytes
0666