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
https://code.tutsplus.com/ru/tutorials/object-oriented-php-for-beginners--net-12762 |
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
$user = JFactory::getUser(); | |
$isroot = $user->authorise('core.admin'); | |
if($isroot){ | |
} |
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
function pippin_add_taxonomy_filters() { | |
global $typenow; | |
// an array of all the taxonomyies you want to display. Use the taxonomy name or slug | |
$taxonomies = array('course_category'); | |
// must set this to the post type you want the filter(s) displayed on | |
if( $typenow == 'course' ){ | |
foreach ($taxonomies as $tax_slug) { |
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
// $array - array to convert | |
// return array | |
$result = array_reduce($array, "array_merge", array()); |
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
// Установить плагин CMAvatar (https://extensions.joomla.org/extension/cmavatar/) | |
<?php | |
$user = JFactory::getUser(); | |
require_once JPATH_PLUGINS . '/user/cmavatar/helper.php'; | |
$avatar = PlgUserCMAvatarHelper::getAvatar($user->id); | |
//print_r($avatar); | |
?> |
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
function set_same_height(selector){ | |
var max_height = 0; | |
$(selector).each(function(){ | |
if($(this).height() > max_height){ | |
max_height = $(this).height(); | |
} | |
}); | |
$(selector).each(function(){ | |
$(this).height(max_height); |
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
function add_acf_columns ( $columns ) { | |
return array_merge ( $columns, array ( | |
'location' => __ ( 'Location' ), | |
'price' => __ ( 'Price' ) | |
) ); | |
} | |
add_filter ( 'manage_course_posts_columns', 'add_acf_columns' ); | |
function course_custom_column ( $column, $post_id ) { | |
switch ( $column ) { |
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
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> | |
<h3>Extra profile information</h3> | |
<table class="form-table"> | |
<tr> | |
<th><label for="phone">Phone Number</label></th> | |
<td> | |
<input type="text" name="phone" id="phone" value="<?php echo esc_attr( get_the_author_meta( 'phone', $user->ID ) ); ?>" class="regular-text" /><br /> | |
<span class="description">Please enter your phone number.</span> |
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 | |
define('OAUTH2_CLIENT_ID', ''); | |
define('OAUTH2_CLIENT_SECRET', ''); | |
$authorizeURL = 'https://github.com/login/oauth/authorize'; | |
$tokenURL = 'https://github.com/login/oauth/access_token'; | |
$apiURLBase = 'https://api.github.com/'; | |
session_start(); |
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
$query = $_SERVER['QUERY_STRING']; | |
$query_arr = explode("&", $query); | |
$count_arr = count($query_arr); | |
for($j = 0; $j < $count_arr; $j++){ | |
if(strpos($query_arr[$j], "pagen") !== false){ | |
//echo $j . "<br />"; |