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 | |
/** | |
* Callables executable test. | |
* | |
* @link https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/403 | |
* @author Alejandro Mostajo <@amostajo> | |
*/ | |
/** |
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 | |
// The class settings is located at PostGallery\Models\PostGallery | |
// There are 2 ways of calling and using this class. | |
// - 1 - Using use statement | |
use PostGallery\Models\PostGallery; | |
$settings = PostGallery::find(); | |
// - 2 - Without use statement | |
$settings = PostGallery\Models\PostGallery::find(); |
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
# source:http://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository | |
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: | |
git fetch upstream |
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 | |
class Main extends Plugin | |
{ | |
public function init() | |
{ | |
// This will call 'save_post' function located in Main class. | |
add_action( 'save_post', [ &$this, 'save_post' ] ); | |
} | |
// Callback handler for action 'save_post'. |
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 | |
public function on_admin() | |
{ | |
$this->add_action( 'ajax_logo', 'view@images.logo', [ 'class' => 'logo-ajax' ] ); | |
} |
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 | |
public function init() | |
{ | |
$this->add_action( 'ajax_logo', 'view@images.logo' ); | |
} |
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 | |
public function on_admin() | |
{ | |
$this->add_action( 'save_post', 'PostController@save', 5, 2 ); | |
$this->add_action( 'admin_menu', 'AdminController@menu', [ 5, $this->config ], 10, 2 ); | |
} |
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 | |
public function on_admin() | |
{ | |
$this->add_action( 'admin_menu', 'AdminController@menu', [ 5, $this->config ] ); | |
} |
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 | |
public function init() | |
{ | |
$this->add_action( 'save_post', 'PostController@save' ); | |
} |
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
<!-- Example in a wordpress template --> | |
<div class="theme-access"> | |
<?php echo $myspecialplugin->my_method() ?> | |
</div> | |
<?php | |
// Example within wordpress php code | |
function test() | |
{ | |
global $myspecialplugin; |