wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_assign_new_template_to_theme › WordPress Function
Seitn/v
Veraltetn/v
› wp_assign_new_template_to_theme ( $changes, $request )
Definiert in: |
|
Codex: |
Noch keine Beschreibung.
Quellcode
function wp_assign_new_template_to_theme( $changes, $request ) { // Do not run this for templates created through the old enpoint. $template = $request['id'] ? get_block_template( $request['id'], 'wp_template' ) : null; if ( $template ) { return $changes; } if ( ! isset( $changes->tax_input ) ) { $changes->tax_input = array(); } $changes->tax_input['wp_theme'] = isset( $request['theme'] ) ? $request['theme'] : get_stylesheet(); // All new templates saved will receive meta so we can distinguish between // templates created the old way as edits and templates created the new way. if ( ! isset( $changes->meta_input ) ) { $changes->meta_input = array(); } $changes->meta_input['is_inactive_by_default'] = true; return $changes; }