Skip to content

Instantly share code, notes, and snippets.

View bfintal's full-sized avatar
🎯
Focusing

Benjamin Intal bfintal

🎯
Focusing
View GitHub Profile
// line 436
// return wp_get_attachment_image_src( $id, 'full' );
return wp_get_attachment_image_src( $id, array( 1600, 1100 ) );
// line 447
// return wp_get_attachment_image_src( $attachmentID, 'full' );
return wp_get_attachment_image_src( $attachmentID, array( 1600, 1100 ) );
(function(){;
// File start: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-no-conflict.js
var jQuery = window.jQuery.noConflict(true);
var $ = jQuery;
window['raptor'] = jQuery;
;
// File end: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-no-conflict.js
;
// File start: /var/deployments/www.raptor-editor.com.3/raptor-gold/raptor-dependencies/jquery-hotkeys.js
/*
@bfintal
bfintal / install-wp-tests.sh
Created September 5, 2015 05:53
Test installer that works both in Travis CI & locally with VVV
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
@bfintal
bfintal / install-wp-tests.sh
Created September 5, 2015 07:24
Test installer that works both in Travis CI & locally with VVV for newly scaffolded projects
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly
}
class TitanFrameworkOptionUpload extends TitanFrameworkOption {
private static $firstLoad = true;
public $defaultSecondarySettings = array(
'size' => 'full', // The size of the image to use in the generated CSS
var getCTNode = function( domElement ) {
// Go through all the editable regions of CT
var regions = ContentTools.EditorApp.get().regions();
for ( var i in regions ) {
// Go through all the children / Element Nodes
var children = regions[ i ].children;
for ( var k in children ) {
/**
* A collection of functions that extend the capabilities of HTMLString to
* manipulate CSS styles.
*
* This is used by various formatting tools.
*/
/* globals HTMLString */
/***************************************************************************
* Change Bold tool. Instead of just adding a `<b>` tag,
* use font-weight styles.
***************************************************************************/
ContentTools.Tools.Bold.canApply = function(element, selection) {
return ContentTools.Tools.Heading.canApply( element, selection );
};
ContentTools.Tools.Bold.isApplied = function(element, selection) {
var from = 0, to = 0, _ref;
@bfintal
bfintal / gist:f595728ee55171affbef
Last active November 25, 2015 09:30
This index.html has a br after the image
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ContentTools sandbox</title>
<link rel="stylesheet" type="text/css" href="sandbox.css">
<link rel="stylesheet" type="text/css" href="../build/content-tools.min.css">
</head>
<body>
<article class="article">
@bfintal
bfintal / base-frame-template.php
Last active January 7, 2021 18:33
Since it's hard to find an example of how to create a readily usable modal popup using Backbone & WordPress, here's one that you can drop in your code and use right away.
<script type="text/html" id="tmpl-my-frame">
<div class="media-frame-title">
<h1>My Frame</h1>
</div>
<div class="media-frame-content"></div>
<div class="media-frame-toolbar">
<div class="media-toolbar">
<div class="media-toolbar-secondary"></div>
<div class="media-toolbar-primary search-form">
<button type="button" class="button button-primary media-button button-large">My Button</button>