Skip to content

Instantly share code, notes, and snippets.

View javorszky's full-sized avatar
🏠
Working from home

Gabor Javorszky javorszky

🏠
Working from home
View GitHub Profile
@javorszky
javorszky / test.php
Created November 24, 2012 16:11
A test gist
<?php
$something = 'something';
global $post;
foreach( $post as $_t ) {
print_r( $_t );
}
?>
@javorszky
javorszky / nav-menu-template.php
Created November 26, 2012 01:17
Adding extra classes to wp_nav_menu - part 1
<?php
function wp_nav_menu( $args = array() ) {
// function parts before
$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );
// rest of the function after
}
?>
@javorszky
javorszky / functions.php
Created November 26, 2012 01:23
Adding extra classes to wp_nav_menu - part 2
<?php
if( !function_exists( 'preit' ) ) {
function preit($obj, $return = false ) {
if( !$return ) {
echo '<pre>';
print_r($obj);
echo '</pre>';
} else {
$ret = '<pre>' . print_r( $obj, true ) . '</pre>';
return $ret;
@javorszky
javorszky / array.php
Created November 26, 2012 01:28
Adding extra classes to wp_nav_menu - part 3
Array
(
[0] => Array
(
[1] => WP_Post Object
(
[ID] => 100
[post_author] => 1
[post_date] => 2012-11-26 00:09:23
[post_date_gmt] => 2012-11-26 00:09:23
@javorszky
javorszky / modified_classes.php
Created November 26, 2012 01:32
Adding extra classes to wp_nav_menu - part 4
<?php
function display_nav_menu_items( $items, $args ) {
foreach ($items as $item) {
if( $item->current ) {
$item->classes[] = 'active';
}
}
return $items;
}
@javorszky
javorszky / fuzzycoding.php
Created November 26, 2012 16:43
Fuzzy coding comment
<?php
//This will (should) make sure everything is loaded via SSL
//So that the "..not everything is secure.." message doesn't appear
//Still will be a problem if other themes and plugins do not implement ssl correctly
?>
@javorszky
javorszky / jigoshop_admin_functions.md
Last active December 16, 2015 22:39
Functions relating to a Product in Jigoshop 1.6.5. Source can be found in `jigoshop_product.class.php`. If this is on Jigoshop documents, I managed not to find it.

This is a list of admin functions and which files they relate to

admin/jigoshop-admin-settings-api.php

class Jigoshop_Admin_Settings

__construct

Instantiates a Jigoshop_Options_Parser, and gets options, and parses it.

Accounts.createUser({
username: username
, email: email
, password: password
}, function(err){
if(err){
console.log(err);
}else{
Meteor.logout();
// Meteor.Router.to('/');
@javorszky
javorszky / client_meteor.js
Created May 27, 2013 09:12
What my meteor does
// The client side:
Template.resend_verification.rendered = function(){
console.log('this is the rendered function');
userId=Session.get('selectedUserId');
var user = Meteor.user(),
emails = user.emails,
verified = false,
sent = false;
{
"id": 4,
"name": "Bob",
"email": "bob@fromaccounting.com",
"meta": {
"plugins": [
"foo": {
"setting1": "value1",
"etc": "etc"
},