###Select several elements
https://docs.google.com/spreadsheets/d/1H7y_Aoy6pKHUhvXo6EwiYuNKl-7oe9Zyl7mN3QYRIPk/edit?usp=sharing Copy the project here http://goo.gl/LxGXfU Disscussion http://goo.gl/UWi1ee http://www.youtube.com/watch?v=dm4z9l26O0I
| // PASTE INTO JS CONSOLE ON FREEAGENT | |
| (function(){ | |
| var canvas = document.createElement("canvas"); | |
| canvas.width = 16; | |
| canvas.height = 16; | |
| var ctx = canvas.getContext('2d'); | |
| var loop = setInterval(function(){ | |
| if($('span.running').length == 0){ | |
| $('link[rel="Shortcut Icon"]').attr('href', '/favicon.ico'); | |
| }else{ |
| # Sublime: Tools -> Developer -> New Plugin | |
| # Preferences -> Key Bindings | |
| # Default (OSX).sublime-keymap: { "keys": ["alt+1"], "command": "increment_selection" } | |
| import sublime, sublime_plugin | |
| class IncrementSelectionCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| start_value = 1 |
###Select several elements
https://docs.google.com/spreadsheets/d/1H7y_Aoy6pKHUhvXo6EwiYuNKl-7oe9Zyl7mN3QYRIPk/edit?usp=sharing Copy the project here http://goo.gl/LxGXfU Disscussion http://goo.gl/UWi1ee http://www.youtube.com/watch?v=dm4z9l26O0I
| <?php | |
| Class Product extends WP_Model | |
| { | |
| public $postType = 'product'; | |
| public $attributes = [ | |
| 'color', | |
| 'weight', | |
| 'seller_id' | |
| ]; | |
| <?php | |
| Product::register(); | |
| // OR | |
| Product::register([ | |
| 'singular_name' => 'Product' | |
| ]); |
| <?php | |
| $product = new Product; | |
| $product->color = 'white'; | |
| $product->weight = 300; | |
| $product->title = 'the post title'; | |
| $product->content = 'the post content'; | |
| $product->save(); | |
| // OR | |
| $product = new Product([ | |
| 'color' => 'blue', |
| <?php | |
| $product = Product::find(15); |
| <?php | |
| $firstProducts = Product::in(1, 2, 3, 4); |
| <?php | |
| $greenProducts = Product::where('color', 'green'); | |
| //OR | |
| $otherProducts = Product::where([ | |
| [ | |
| 'key' => 'color', | |
| 'value' => 'green', | |
| 'compare' => '!=' |
| <?php | |
| $product->delete(); |