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 | |
| /** | |
| * PHP default array map function doesn't provide access to array item key | |
| * So there is no way to map array based on some condition which depends on | |
| * array item key. And that's why array_mapx is here to help you in that case. | |
| * @param array $arr Array that is going to be mapped | |
| * @param callable $callback Callback function to map array $a | |
| * @param boolean $preserve_keys To maintain the old keys | |
| * @return array Mapped array | |
| */ |
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
| /** | |
| NOTES: | |
| ======================== | |
| 0. Extend container view from "VcColumnView" so that you get a clean UI. | |
| 1. Render method called after element is added (cloned), and on first initalization. | |
| 2. Use model.getParam(param_name) to get specific param from params. | |
| 3. Use model.get("params") to get complete params object. | |
| 4. If params is changed then shortcode will be rendered automatically. | |
| 5. You do not need to override method that you are not going change, in our file "render". | |
| **/ |
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
| window.VcCustomElementView = vc.shortcode_view.extend( { | |
| elementTemplate: false, | |
| $wrapper: false, | |
| changeShortcodeParams: function ( model ) { | |
| var params; | |
| window.VcCustomElementView.__super__.changeShortcodeParams.call( this, model ); | |
| params = _.extend( {}, model.get( 'params' ) ); | |
| if ( ! this.elementTemplate ) { | |
| this.elementTemplate = this.$el.find( '.vc_custom-element-container' ).html(); |
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
| /* ========================================================= | |
| * composer-view.js v0.2.1 | |
| * ========================================================= | |
| * Copyright 2013 Wpbakery | |
| * | |
| * Visual composer backbone/underscore version | |
| * ========================================================= */ | |
| (function ( $ ) { | |
| var i18n = window.i18nLocale, | |
| store = vc.storage, |
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
| // Fixed named events | |
| var _events = [ | |
| "vc:access:initialize", | |
| "vc:access:backend:ready", | |
| "shortcodes:vc_row:add:param:name:parallax", | |
| "shortcodes:vc_row:update:param:name:parallax", | |
| "shortcodes:vc_single_image:sync", | |
| "shortcodes:vc_single_image:add", | |
| "shortcodes:add:param:type:el_id", | |
| "click:media_editor:add_image", |
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
| /** | |
| * Code snippet from http://উত্তরাধিকার.বাংলা/ | |
| * | |
| * Really inspiring if you wanna know code smell | |
| * and how to write bad code | |
| */ | |
| function determine_ashaba(sel_rel_arr,ashabas_from_qh,exclude_from_qh,qhs) | |
| { | |
| var ashabas = []; |
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
| <!-- START header.php --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- Other head stuff lives here --> | |
| <?php wp_head(); ?> | |
| </head> | |
| <body> | |
| <?php | |
| if ( is_page_template( 'special-page-template-name.php' ) ) : |
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 | |
| /* | |
| Plugin Name: Rewrite Rule Tutorials | |
| */ | |
| add_action( 'init', 'pmg_rewrite_add_rewrites' ); | |
| function pmg_rewrite_add_rewrites() | |
| { | |
| add_rewrite_endpoint( 'json', EP_PERMALINK ); | |
| add_rewrite_rule( |
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
| // Code written by Me and | |
| // doc written by Zafree [http://github.com/zafree] vai :D | |
| // Get Siblings | |
| // It is a simple function to get all child from parent | |
| // Feel free to use it like a Pro |
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 | |
| function wp_class_register_mb() { | |
| add_meta_box( | |
| 'wpclass-mb', // unique id | |
| esc_html__( 'WP Class Metabox', 'text-domain' ), // metabox title | |
| 'wp_class_mb_cb', // metabox callback | |
| array('post','page'), // screen name [string|array] | |
| 'side', // context | |
| 'high' // priority | |
| ); |