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 | |
/** | |
* Implements hook_form_FORM_ID_alter(). | |
* | |
* Indicate some details about the field on the field overview form | |
*/ | |
function MYMODULE_form_field_ui_field_overview_form_alter(&$form, &$form_state, $form_id) { | |
$instances = field_info_instances( $form['#entity_type'], $form['#bundle'] ); | |
$fields = field_info_fields(); |
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 | |
/** | |
* Implements hook_filter_info(). | |
* | |
* @link https://api.drupal.org/api/drupal/modules%21filter%21filter.api.php/function/hook_filter_info/7.x | |
*/ | |
function examplefilter_filter_info() { | |
$filters['examplefilter_node_embed'] = array( | |
'title' => 'EPI node embed', |
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 | |
/** | |
* Recursively get taxonomy and its children | |
* | |
* @param string $taxonomy | |
* @param int $parent - parent term id | |
* @return array | |
*/ | |
function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) { |
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 | |
/** | |
* Implements hook_theme() | |
* @return array | |
*/ | |
function mymodule_theme(){ | |
$items = array(); | |
$items['mymodule_custom_template'] = 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
<?php | |
/** | |
* Uninstall modules. | |
*/ | |
function lth_configuration_update_7001() { | |
module_disable(array('module1', 'module2')); | |
drupal_uninstall_modules(array('module1', 'module2')); | |
} |
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 | |
/** | |
* Implements hook_webform_select_options_info(). | |
*/ | |
function MODULE_webform_select_options_info() { | |
$items = array(); | |
$vocabularies = taxonomy_get_vocabularies(); |
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 ($) { | |
Drupal.behaviors.videojsajax = { | |
attach: function (context, settings) { | |
if ( typeof videojs != 'undefined' ) { | |
// find all video elements with video-js class, and re-init them | |
$('video.video-js').each( function( i , element ){ | |
videojs($(element)[0] , {}, function() {}); | |
}); | |
} | |
} |
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 | |
/* | |
* Plugin Name: Lock plugin updates | |
* Description: Prevent plugin updates | |
* Version: 1.0.0 | |
* Author: daggerhart | |
*/ | |
add_filter( 'http_request_args', 'lock_plugins_http_request_args', 5, 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
<IfModule mod_rewrite.c> | |
# enable rewriting | |
RewriteEngine on | |
# don't rewrite files that exist in the file system | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# don't rewrite directories that exist in the file system | |
RewriteCond %{REQUEST_FILENAME} !-d |
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 Template - a very simple PHP class for rendering PHP templates | |
*/ | |
class Template { | |
/** | |
* Location of expected template | |
* |