This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inject partials into main menu | |
add_filter('wp_nav_menu_items', function ($items, $args) { | |
if ($args->menu->name != 'Primary') { | |
return $items; | |
} | |
$dom = new DOMDocument(); | |
$dom->loadHTML($items); | |
$xpath = new DOMXpath($dom); | |
$find = $xpath->query('//li[contains(@class, "product-menu")]|//li[contains(@class, "resource-menu")]'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getFeaturedImageAttribute() { | |
if (!empty($this->thumbnail)) { | |
return $this->thumbnail->size('original'); | |
} else { | |
return null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createObject() { | |
$object = [ | |
'_id' => $this->id, | |
'_type' => 'employee', | |
'name' => $this->name, | |
'slug' => $this->slug, | |
]; | |
return $object; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category extends \Corcel\Model\Taxonomy { | |
public function getIdAttribute() { | |
return $this->term_id; | |
} | |
public function getTitleAttribute() { | |
return $this->name; | |
} | |
public function createObject() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function setupCategories() { | |
$categories = Category::where('taxonomy', 'category')->get(); | |
foreach($categories as $category) { | |
$data = $category->createObject(); | |
array_push($this->dataObject, $data); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animation: navigation-base 1s 1; | |
@keyframes navigation-base { | |
0% { | |
width: 0px; | |
height: 0px; | |
box-shadow: 0px; | |
} | |
40% { | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animation: navigation-links 2s 1; | |
@keyframes navigation-links { | |
0% { | |
opacity: 0; | |
} | |
50% { | |
opacity: 0; | |
} | |
100% { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoload": { | |
"psr-4": { | |
"Sample\\": "src/" | |
} | |
}, | |
"minimum-stability": "dev", | |
"prefer-stable": true, | |
"require": { | |
"illuminate/database": "^7.14.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Sample Plugin | |
* Description: A sample plugin | |
* Version: 1.0 | |
*/ | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$plugin = new \Sample\Loader(__DIR__, plugin_dir_url(__FILE__)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sample; | |
use \Illuminate\Database\Capsule\Manager as Capsule; | |
class Loader { | |
public function init() { | |
$this->initEloquent(); | |
$this->initActions(); | |
$this->initFilters(); |