_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q25500 | BaseType.getView | train | public function getView(bool $prefixed = true): string
{
if ($prefixed && ! is_null($theme = | php | {
"resource": ""
} |
q25501 | BaseType.setValue | train | public function setValue($value): FieldTypeInterface
{
$this->value = | php | {
"resource": ""
} |
q25502 | BaseType.getRawValue | train | public function getRawValue()
{
$value = $this->transformer->reverseTransform($this->value);
| php | {
"resource": ""
} |
q25503 | BaseType.error | train | public function error(string $name = '', bool $first = false)
{
$errors = $this->errors();
if (empty($name)) {
$name = $this->getName();
}
if ($first) | php | {
"resource": ""
} |
q25504 | Handler.unauthenticated | train | protected function unauthenticated($request, AuthenticationException $e)
{
return $request->expectsJson()
| php | {
"resource": ""
} |
q25505 | Handler.convertExceptionToResponse | train | protected function convertExceptionToResponse(Exception $e)
{
$headers = $this->isHttpException($e) ? $e->getHeaders() : [];
$statusCode = $this->isHttpException($e) ? $e->getStatusCode() : 500;
try {
$content = config('app.debug') && class_exists(Whoops::class)
... | php | {
"resource": ""
} |
q25506 | Handler.renderExceptionWithWhoops | train | protected function renderExceptionWithWhoops(Exception $e)
{
return tap(new Whoops(), function ($whoops) {
$whoops->pushHandler($this->whoopsHandler());
| php | {
"resource": ""
} |
q25507 | Handler.whoopsHandler | train | protected function whoopsHandler()
{
return tap(new PrettyPageHandler(), function ($handler) {
$files = new Filesystem();
$handler->handleUnconditionally(true);
foreach (config('app.debug_blacklist', []) as $key => $secrets) {
foreach ($secrets as $secret... | php | {
"resource": ""
} |
q25508 | Handler.context | train | protected function context()
{
try {
return [
'userId' => Auth::id(),
'email' => | php | {
"resource": ""
} |
q25509 | Ajax.listen | train | public function listen($action, $callback, $logged = 'both'): AjaxInterface
{
// Front-end ajax for non-logged users
// Set $logged to false
if ($logged === false || $logged === 'no') {
$this->action->add('wp_ajax_nopriv_'.$action, $callback);
}
// Front-end and | php | {
"resource": ""
} |
q25510 | CoreServiceProvider.boot | train | public function boot()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../../../dist' => web_path('dist')
], 'themosis');
$this->publishes([
| php | {
"resource": ""
} |
q25511 | ViewServiceProvider.registerTwigEnvironment | train | public function registerTwigEnvironment()
{
$this->app->singleton('twig', function ($app) {
$twig = new \Twig_Environment(
$app['twig.loader'],
[
'auto_reload' => true,
'cache' => $app['config']['view.twig']
... | php | {
"resource": ""
} |
q25512 | ViewServiceProvider.registerTwigEngine | train | public function registerTwigEngine()
{
/** @var Factory $factory */
$factory = $this->app['view'];
$factory->addExtension('twig', 'twig', function () {
| php | {
"resource": ""
} |
q25513 | CollectionType.setDefaultOptions | train | protected function setDefaultOptions(): array
{
// A limit of "0" means no-limit.
$default = [
'limit' => 0,
'type' => ['image', 'application']
];
if (function_exists('_x')) {
$default['l10n'] = [
'add' => _x('Add Media', 'field', ... | php | {
"resource": ""
} |
q25514 | CollectionType.metaboxSave | train | public function metaboxSave($value, int $post_id)
{
$this->setValue($value);
$previous = get_post_meta($post_id, $this->getName(), false);
if (is_null($value) || empty($value)) {
delete_post_meta($post_id, $this->getName());
} elseif (empty($previous) && is_array($value... | php | {
"resource": ""
} |
q25515 | IntegerToLocalizedStringTransformer.reverseTransform | train | public function reverseTransform($data)
{
$value = parent::reverseTransform($data);
| php | {
"resource": ""
} |
q25516 | ChoiceToValueTransformer.parseNumeric | train | protected function parseNumeric($value)
{
if (is_numeric($value)) {
if (false !== strrpos($value, '.')) | php | {
"resource": ""
} |
q25517 | ProviderRepository.loadManifest | train | public function loadManifest()
{
if ($this->files->exists($this->manifestPath)) {
$manifest = $this->files->getRequire($this->manifestPath);
if ($manifest) { | php | {
"resource": ""
} |
q25518 | ProviderRepository.compileManifest | train | public function compileManifest(array $providers)
{
/*
* The service manifest should contain a list of all of the providers for
* the application so we can compare it on each request to the service
* and determine if the manifest should be recompiled or is current.
*/
... | php | {
"resource": ""
} |
q25519 | ProviderRepository.writeManifest | train | public function writeManifest(array $manifest)
{
if (! is_writable(dirname($this->manifestPath))) {
throw new Exception('The bootstrap/cache directory must be present and writable.');
}
$this->files->put(
| php | {
"resource": ""
} |
q25520 | NumberToLocalizedStringTransformer.transform | train | public function transform($data)
{
if (is_null($data) || '' === $data) {
return '';
}
if (! is_numeric($data)) {
throw new DataTransformerException('A numeric value is expected.');
}
$formatter = $this->getFormatter();
$value = $formatter->... | php | {
"resource": ""
} |
q25521 | NumberToLocalizedStringTransformer.reverseTransform | train | public function reverseTransform($data)
{
if (is_null($data) || empty($data)) {
return '';
}
$formatter = $this->getFormatter();
$value = $formatter->parse($data);
| php | {
"resource": ""
} |
q25522 | NumberToLocalizedStringTransformer.getFormatter | train | protected function getFormatter()
{
$formatter = new \NumberFormatter($this->locale, \NumberFormatter::DECIMAL);
$precision = $this->field->getOption('precision', 0);
if ($precision) {
| php | {
"resource": ""
} |
q25523 | TaxonomyField.make | train | public function make(TaxonomyInterface $taxonomy, array $options = []): TaxonomyField
{
$this->taxonomy = $taxonomy;
| php | {
"resource": ""
} |
q25524 | TaxonomyField.add | train | public function add(FieldTypeInterface $field): TaxonomyField
{
$field->setTheme('themosis.taxonomy');
$field->setPrefix($this->options['prefix'] | php | {
"resource": ""
} |
q25525 | TaxonomyField.set | train | public function set()
{
// Register term meta on Rest API.
if (function_exists('current_filter') && 'init' === current_filter()) {
call_user_func($this->register());
} else {
$this->action->add('init', $this->register());
}
| php | {
"resource": ""
} |
q25526 | TaxonomyField.register | train | protected function register()
{
return function () {
foreach ($this->repository as $field) {
register_meta('term', $field->getName(), [
'type' => $field->getOption('data_type', 'string'),
'single' => ! $field->getOption('multiple', false),
... | php | {
"resource": ""
} |
q25527 | TaxonomyField.sanitize | train | protected function sanitize(FieldTypeInterface $field)
{
return function ($value, $key, $type) use ($field) {
$validator = $this->validator->make(
[$key => $value],
$this->getTermRules(),
| php | {
"resource": ""
} |
q25528 | TaxonomyField.save | train | protected function save()
{
return function ($term_id) {
/** @var Validator $validator */
$validator = $this->validator->make(
$this->getTermData(app('request')),
$this->getTermRules(),
$this->getTermMessages(),
$this->g... | php | {
"resource": ""
} |
q25529 | TaxonomyField.getTermData | train | protected function getTermData(Request $request)
{
$data = [];
foreach ($this->repository as | php | {
"resource": ""
} |
q25530 | TaxonomyField.getTermRules | train | protected function getTermRules()
{
$rules = [];
foreach ($this->repository as | php | {
"resource": ""
} |
q25531 | TaxonomyField.getTermMessages | train | protected function getTermMessages()
{
$messages = [];
foreach ($this->repository as $field) {
foreach ($field->getOption('messages') as $rule => $message) {
| php | {
"resource": ""
} |
q25532 | TaxonomyField.getTermPlaceholders | train | protected function getTermPlaceholders()
{
$placeholders = [];
foreach ($this->repository as | php | {
"resource": ""
} |
q25533 | TaxonomyField.outputEditFields | train | protected function outputEditFields()
{
return function ($term) {
/** @var \WP_Term $term */
foreach ($this->repository as $field) {
if (method_exists($field, 'termGet')) {
| php | {
"resource": ""
} |
q25534 | ButtonType.getDefaultOptions | train | public function getDefaultOptions(): array
{
$options = parent::getDefaultOptions();
// Check the "type" attribute. If it is not set,
// let's define it by default to "submit".
if (! isset($options['attributes']['type'])) {
$options['attributes']['type'] = 'submit';
... | php | {
"resource": ""
} |
q25535 | Factory.make | train | public function make(string $id, $screen = 'post'): MetaboxInterface
{
$metabox = (new Metabox($id, $this->action, $this->filter, new FieldsRepository()))
->setContainer($this->container)
->setTitle($this->setDefaultTitle($id))
->setScreen($screen)
->setContex... | php | {
"resource": ""
} |
q25536 | Factory.setMetaboxTranslations | train | protected function setMetaboxTranslations(MetaboxInterface $metabox)
{
if (! function_exists('__')) {
return $this;
}
$metabox->addTranslation('done', __('Saved', Application::TEXTDOMAIN));
$metabox->addTranslation('error', __('Saved with errors', Application::TEXTDOMAIN... | php | {
"resource": ""
} |
q25537 | Page.set | train | public function set(): PageInterface
{
$hook = $this->isNetwork() ? 'network_admin_menu' : 'admin_menu';
// Action for page display.
$this->action->add($hook, [$this, 'build']);
| php | {
"resource": ""
} |
q25538 | Page.findParentHook | train | protected function findParentHook(): string
{
if (! $this->hasParent()) {
return '';
}
// Check if parent attribute is attached to a custom post type or another page.
if (false !== $pos = strpos($this->getParent(), 'post_type=')) {
// Parent hook is equivalen... | php | {
"resource": ""
} |
q25539 | Page.build | train | public function build()
{
if (is_null($this->getParent())) {
// Add a top menu page.
add_menu_page(
$this->getTitle(),
$this->getMenu(),
$this->getCapability(),
$this->getSlug(),
[$this, 'render'],
... | php | {
"resource": ""
} |
q25540 | Page.with | train | public function with($key, $value = null): PageInterface
{
| php | {
"resource": ""
} |
q25541 | Page.addSections | train | public function addSections(array $sections): PageInterface
{
$sections = array_merge(
$this->repository()->getSections()->all(),
$sections
);
array_walk($sections, function ($section) {
// Set a default view to each section if none defined.
| php | {
"resource": ""
} |
q25542 | Page.addSettings | train | public function addSettings($section, array $settings = []): PageInterface
{
$currentSettings = $this->repository()->getSettings()->all();
if (is_array($section)) {
$settings = array_merge($currentSettings, $section);
} else {
$settings = array_merge($currentSettings... | php | {
"resource": ""
} |
q25543 | Page.setPrefix | train | public function setPrefix(string $prefix): PageInterface
{
$this->prefix = $prefix;
$this->repository()->getSettings()->collapse()->each(function ($setting) use ($prefix) {
/** @var | php | {
"resource": ""
} |
q25544 | Page.configureSettings | train | public function configureSettings()
{
// If no settings && sections, return.
$settings = $this->repository()->getSettings();
$sections = $this->repository()->getSections();
if ($settings->isEmpty() && $sections->isEmpty()) {
return;
}
// Configure sectio... | php | {
"resource": ""
} |
q25545 | Page.prepareSetting | train | protected function prepareSetting(FieldTypeInterface $setting)
{
if (empty($setting->getTheme()) || is_array($setting->getTheme())) {
// Page settings only have the "themosis" theme available.
$setting->setTheme('themosis.pages');
}
$setting->setPrefix($this->getPref... | php | {
"resource": ""
} |
q25546 | Page.sanitizeSetting | train | public function sanitizeSetting($value)
{
$keys = $this->repository()->getSettings()->collapse()->map(function ($setting) {
/** @var FieldTypeInterface $setting */
return $setting->getName();
});
$settingName = $keys->slice($this->offset, 1)->first();
$lastSe... | php | {
"resource": ""
} |
q25547 | Page.getSettingMessages | train | protected function getSettingMessages(FieldTypeInterface $setting): array
{
$messages = [];
foreach ($setting->getOption('messages', []) as $attr => $message) {
| php | {
"resource": ""
} |
q25548 | Page.getSettingPlaceholder | train | protected function getSettingPlaceholder(FieldTypeInterface $setting): array
{
$placeholder = $setting->getOption('placeholder');
if (is_null($placeholder)) {
| php | {
"resource": ""
} |
q25549 | Page.renderSections | train | public function renderSections(array $args)
{
$section = $this->repository()->getSectionByName($args['id']);
$view = sprintf(
'%s.%s.%s',
$this->ui()->getTheme(),
$this->ui()->getLayout(),
| php | {
"resource": ""
} |
q25550 | Page.renderSettings | train | public function renderSettings($setting)
{
// Set the setting value if any.
$value = get_option($setting->getName(), null);
if (! is_null($value)) {
$setting->setValue($value);
}
$view = sprintf('%s.%s', $this->ui()->getTheme(), $setting->getView(false));
... | php | {
"resource": ""
} |
q25551 | Page.getSettingError | train | public function getSettingError(string $name): array
{
$errors = get_settings_errors($this->getSlug());
if (empty($errors)) { | php | {
"resource": ""
} |
q25552 | Page.setView | train | public function setView(string $name, bool $useShortPath = false): PageInterface
{
| php | {
"resource": ""
} |
q25553 | Page.parseGetRoute | train | public function parseGetRoute()
{
$request = $this->getRequest();
if (is_null($request) || ! isset($this->routes['get'])) {
return;
}
$action = $request->get('action', '/');
if (in_array($action, array_keys($this->routes['get']))) {
$callback = $thi... | php | {
"resource": ""
} |
q25554 | Page.parsePostRoute | train | public function parsePostRoute()
{
if (empty($this->routes) || ! isset($this->routes['post'])) {
return;
}
| php | {
"resource": ""
} |
q25555 | Page.route | train | public function route(string $action, $callback, string $method = 'get', string $title = ''): PageInterface
{
$method = strtolower($method);
$action = $this->parseAction($action, $method);
$this->routes[$method][$action] = $callback;
| php | {
"resource": ""
} |
q25556 | Page.registerRouteActions | train | protected function registerRouteActions()
{
// Actions for page routing.
$this->action->add('load-toplevel_page_'.$this->getSlug(), [$this, 'parseGetRoute']);
$this->action->add('load-admin_page_'.$this->getSlug(), [$this, 'parseGetRoute']);
| php | {
"resource": ""
} |
q25557 | Page.parseAction | train | protected function parseAction(string $action, string $method): string
{
if ('post' === $method) {
| php | {
"resource": ""
} |
q25558 | Page.handleTitle | train | public function handleTitle($title)
{
if (is_null($request = $this->getRequest()) || empty($this->titles)) {
return $title;
}
| php | {
"resource": ""
} |
q25559 | Page.getContainer | train | public function getContainer(): Container
{
if (is_null($this->container)) { | php | {
"resource": ""
} |
q25560 | HtmlBuilder.setCharset | train | public function setCharset($charset = null)
{
if (! is_null($charset)) {
$this->charset = $charset;
} elseif (defined('THEMOSIS_CHARSET')) {
$this->charset = THEMOSIS_CHARSET;
| php | {
"resource": ""
} |
q25561 | HtmlBuilder.attributeElement | train | protected function attributeElement($key, $value)
{
// For numeric keys we will assume that the value is a boolean attribute
// where the presence of the attribute represents a true value and the
// absence represents a false value.
// This will convert HTML attributes such as "requi... | php | {
"resource": ""
} |
q25562 | Loop.thumbnailUrl | train | public function thumbnailUrl($size = null, $icon = false)
{
$data = wp_get_attachment_image_src(get_post_thumbnail_id($this->id()), | php | {
"resource": ""
} |
q25563 | Route.setConditions | train | public function setConditions(array $conditions = [])
{
$this->conditions = $conditions;
$this->condition = $this->parseCondition($this->uri());
| php | {
"resource": ""
} |
q25564 | Route.parseCondition | train | protected function parseCondition(string $condition): string
{
$conditions = $this->getConditions();
foreach ($conditions as $signature => $conds) {
$conds = is_array($conds) ? $conds : [$conds];
if | php | {
"resource": ""
} |
q25565 | Route.parseConditionParams | train | protected function parseConditionParams(array $action): array
{
if (empty($this->condition)) {
return [];
}
| php | {
"resource": ""
} |
q25566 | PageSettingsRepository.setSettings | train | public function setSettings(array $settings): SettingsRepositoryInterface
{
| php | {
"resource": ""
} |
q25567 | PageSettingsRepository.getSettingByName | train | public function getSettingByName(string $name): FieldTypeInterface
{
return $this->getSettings()->collapse()->first(function ($setting) use ($name) {
/** @var | php | {
"resource": ""
} |
q25568 | PageSettingsRepository.getSectionByName | train | public function getSectionByName(string $name): SectionInterface
{
return $this->getSections()->first(function ($section) use ($name) {
/** @var | php | {
"resource": ""
} |
q25569 | PageSettingsRepository.parseCompatibleSettings | train | protected function parseCompatibleSettings(array $settings)
{
$settings = collect($settings)->collapse()->all();
foreach ($settings as $setting) {
| php | {
"resource": ""
} |
q25570 | PageView.getView | train | public function getView(): View
{
$path = $this->useShortViewPath ?
$this->getViewPath() : sprintf('%s.%s.%s', $this->getTheme(), $this->getLayout(), $this->getViewPath());
if (is_null($this->viewInstance)) {
| php | {
"resource": ""
} |
q25571 | Finder.addLocation | train | public function addLocation(string $path, string $url): Finder
{
$path = rtrim($path, '\/');
$url = rtrim($url, '\/');
| php | {
"resource": ""
} |
q25572 | Finder.addLocations | train | public function addLocations(array $paths): Finder
{
foreach ($paths as | php | {
"resource": ""
} |
q25573 | Finder.find | train | public function find(string $path): AssetFileInterface
{
if ($this->isExternal($path)) {
return (new File($this->files))
->setPath('')
->setUrl($path)
->setExternal(true)
->setType($path);
}
$path = trim($path, '\/'... | php | {
"resource": ""
} |
q25574 | Finder.isExternal | train | protected function isExternal(string $path): bool
{
foreach ($this->schemes as $scheme) {
if (strpos($path, $scheme) !== false) | php | {
"resource": ""
} |
q25575 | FormFactory.make | train | public function make($dataClass = null, $options = [], $builder = FormBuilder::class): FormBuilderInterface
{
$dataMapperManager = new DataMapperManager(PropertyAccess::createPropertyAccessor());
$form = new Form(
$dataClass,
new FieldsRepository(),
| php | {
"resource": ""
} |
q25576 | CallbackHandler.handleCallback | train | protected function handleCallback($callback, array $args = [])
{
$response = null;
// Check if $callback is a closure.
if ($callback instanceof \Closure || is_array($callback)) {
$response = call_user_func($callback, $args);
} elseif (is_string($callback)) {
... | php | {
"resource": ""
} |
q25577 | ColorType.getDefaultColors | train | protected function getDefaultColors()
{
$colors = [
[
'name' => 'Pale pink',
'color' => '#f78da7'
],
[
'name' => 'Vivid red',
'color' => '#cf2e2e'
],
[
'name' => 'Lumin... | php | {
"resource": ""
} |
q25578 | TaxonomyServiceProvider.registerTaxonomyField | train | protected function registerTaxonomyField()
{
$this->app->bind('taxonomy.field', function ($app) {
$viewFactory = $app['view'];
$viewFactory->addLocation(__DIR__.'/views');
return new TaxonomyField(
new TaxonomyFieldRepository(),
| php | {
"resource": ""
} |
q25579 | WordPressUrl.formatUrl | train | public function formatUrl(string $url, string $delimiter = 'wp-admin', string $fragment = 'cms')
{
/*
* If there is already a "cms" fragment in the URI,
* just return the URL.
*/
if (strrpos($url, $fragment) !== false) {
return $url;
}
/*
... | php | {
"resource": ""
} |
q25580 | WordPressUrl.formatNetworkUrl | train | public function formatNetworkUrl(string $url, string $delimiter = 'wp-admin', string | php | {
"resource": ""
} |
q25581 | PostType.setLabels | train | public function setLabels(array $labels): PostTypeInterface
{
if (isset($this->args['labels'])) {
$this->args['labels'] = array_merge($this->args['labels'], $labels);
} | php | {
"resource": ""
} |
q25582 | PostType.setArguments | train | public function setArguments(array $args): PostTypeInterface
| php | {
"resource": ""
} |
q25583 | PostType.register | train | public function register()
{
$this->instance = register_post_type($this->slug, | php | {
"resource": ""
} |
q25584 | PostType.setTitlePlaceholder | train | public function setTitlePlaceholder(string $title): PostTypeInterface
{
$this->filter->add('enter_title_here', function ($default) use ($title) {
$screen = get_current_screen();
if ($this->slug === $screen->post_type) {
| php | {
"resource": ""
} |
q25585 | PostType.registerStatus | train | protected function registerStatus()
{
if (empty($this->status)) {
return;
}
foreach ($this->status as $key => $args) {
register_post_status($key, $args);
}
Metabox::make('themosis_publish', $this->slug)
| php | {
"resource": ""
} |
q25586 | PostType.status | train | public function status($status, array $args = []): PostTypeInterface
{
if (is_array($status)) {
foreach ($status as $key => $params) {
if (is_int($key)) {
$this->status($params);
} elseif (is_string($key) && | php | {
"resource": ""
} |
q25587 | PostType.prepareStatus | train | protected function prepareStatus(string $status, array $args)
{
$this->status[$status] = $this->parseStatusArguments($status, $args);
// Remove default publish metabox.
$this->action->add('add_meta_boxes', function () {
remove_meta_box('submitdiv', $this->slug, 'side');
... | php | {
"resource": ""
} |
q25588 | PostType.parseStatusArguments | train | protected function parseStatusArguments(string $status, array $args): array
{
$name = ucfirst($status);
return wp_parse_args($args, [
'label' => $name,
'public' => true,
'exclude_from_search' => false,
| php | {
"resource": ""
} |
q25589 | PostType.applyStatus | train | public function applyStatus(string $value)
{
if (isset($_POST['post_type']) && $this->slug === $_POST['post_type'] && ! empty($this->status)) {
if ((isset($_POST['post_status']) && 'publish' === $_POST['post_status'])
&& (isset($_REQUEST['post_status']) && 'draft' === $_REQUEST['post... | php | {
"resource": ""
} |
q25590 | Router.setConditions | train | public function setConditions(array $conditions = [])
{
$config = $this->container->has('config') ? $this->container->make('config') : null;
if (! is_null($config)) | php | {
"resource": ""
} |
q25591 | Router.addWordPressBindings | train | public function addWordPressBindings($route)
{
global $post, $wp_query;
foreach (compact('post', 'wp_query') as $key => $value) {
| php | {
"resource": ""
} |
q25592 | Router.auth | train | public function auth(array $options = [])
{
// Authentication routes.
$this->get('auth/login', 'Auth\LoginController@showLoginForm')->name('login');
$this->post('auth/login', 'Auth\LoginController@login');
$this->post('auth/logout', 'Auth\LoginController@logout')->name('logout');
... | php | {
"resource": ""
} |
q25593 | FormTransformer.transform | train | public function transform(FieldTypeInterface $form)
{
return [
'attributes' => $form->getAttributes(),
'flush' => $form->getOption('flush', true),
'locale' => $form->getLocale(),
'nonce' => $form->getOption('nonce', '_themosisnonce'),
'referer' => ... | php | {
"resource": ""
} |
q25594 | FormTransformer.includeGroups | train | public function includeGroups(FieldTypeInterface $form)
{
/** @var FieldTypeInterface|FormInterface $form */
return $this->collection(
| php | {
"resource": ""
} |
q25595 | Asset.setType | train | public function setType(string $type): AssetInterface
{
$path = $this->file->isExternal() ? $this->getUrl() : $this->getPath();
| php | {
"resource": ""
} |
q25596 | Asset.setArgument | train | public function setArgument($arg = null): AssetInterface
{
if (! is_null($arg)) {
$this->argument = $arg;
return $this;
}
// If no argument is passed but we have its type
// then let's define some defaults.
if ('style' === $this->getType()) {
| php | {
"resource": ""
} |
q25597 | Asset.to | train | public function to($locations = 'front'): AssetInterface
{
if (is_string($locations)) {
$locations = [$locations];
}
| php | {
"resource": ""
} |
q25598 | Asset.enqueue | train | public function enqueue()
{
if (is_null($this->getType())) {
throw new AssetException('The asset must have a type | php | {
"resource": ""
} |
q25599 | Asset.enqueueScript | train | protected function enqueueScript()
{
wp_enqueue_script(
$this->getHandle(),
$this->getUrl(),
$this->getDependencies(),
$this->getVersion(),
$this->getArgument()
);
if (! empty($this->localize)) {
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.