wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_wp_register_default_icons is private and should not be used in themes or plugins directly.
_wp_register_default_icons › WordPress Function
Seit7.1.0
Veraltetn/v
› _wp_register_default_icons ( Keine Parameter )
| Zugriff: |
|
| Definiert in: |
|
| Codex: |
Registers the default core icons from the manifest.
Quellcode
function _wp_register_default_icons() {
$icons_directory = ABSPATH . WPINC . '/images/icon-library/';
$manifest_path = ABSPATH . WPINC . '/assets/icon-library-manifest.php';
if ( ! is_readable( $manifest_path ) ) {
wp_trigger_error(
__FUNCTION__,
__( 'Core icon collection manifest is missing or unreadable.' )
);
return;
}
$collection = include $manifest_path;
if ( empty( $collection ) ) {
wp_trigger_error(
__FUNCTION__,
__( '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(
__FUNCTION__,
__( 'Core icon collection manifest must provide a valid "filePath" for each icon.' ),
'7.0.0'
);
return;
}
wp_register_icon(
'core/' . $icon_name,
array(
'label' => $icon_data['label'],
'file_path' => $icons_directory . $icon_data['filePath'],
)
);
}
}