This file contains hidden or 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 | |
/** | |
* Modify permalinks structure | |
*/ | |
function modify_permalinks() { | |
global $wp_rewrite; | |
$wp_rewrite->set_permalink_structure( '/%category%/%postname%/' ); | |
$wp_rewrite->flush_rules(); |
This file contains hidden or 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 | |
global $user_ID; | |
$page = get_page_by_title('Page title'); | |
if($home == null){ | |
$page['post_type'] = 'page'; | |
$page['post_content'] = ''; | |
$page['post_parent'] = 0; | |
$page['post_author'] = $user_ID; | |
$page['post_status'] = 'Page title'; |
This file contains hidden or 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 | |
$hook_name = 'hook'; | |
global $wp_filter; | |
var_dump( $wp_filter[$hook_name] ); | |
?> |
This file contains hidden or 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
mkfile 50m test.tmp |
This file contains hidden or 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 | |
Zend_Debug::dump($var); | |
?> |
This file contains hidden or 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 | |
$dom = new Zend_Dom_Query($blockHTML); | |
$images = $dom->query('img'); | |
?> |
This file contains hidden or 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 CompanyName_ModuleName_Block_BlockName extends Mage_Core_Block_Template | |
{ | |
protected function _construct(){ | |
parent::_construct(); | |
} | |
} |
This file contains hidden or 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
#!/bin/bash | |
EXPECTED_ARGS=3 | |
E_BADARGS=65 | |
MYSQL=`which mysql` | |
Q1="CREATE DATABASE IF NOT EXISTS $1;" | |
Q2="CREATE USER '$2'@'localhost' IDENTIFIED BY '$3';" | |
Q3="GRANT ALL PRIVILEGES ON $1.* TO '$2'@'localhost' WITH GRANT OPTION;" | |
Q4="FLUSH PRIVILEGES;" |