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
import React, {Component} from 'react'; | |
class Example extends Component { | |
handleChange(e){ | |
let file = e.target.files[0]; | |
let fileReader = new FileReader(); | |
fileReader.onload = () => { | |
console.log(fileReader.result); | |
}; | |
fileReader.readAsText(file); |
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
import React, {Component} from 'react'; | |
import {_pushpull} from '../accessoris/functions'; | |
import Editor from 'react-medium-editor'; | |
import MediumEditorTable from 'medium-editor-tables'; | |
import MediumButton from 'medium-button'; | |
import 'medium-editor/dist/css/medium-editor.css'; | |
import 'medium-editor/dist/css/themes/default.css'; | |
import 'medium-editor-tables/dist/css/medium-editor-tables.css'; |
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
getCurrentSelection() { | |
var html = '' | |
var sel | |
if (typeof window.getSelection != 'undefined') { | |
sel = window.getSelection() | |
if (sel.rangeCount) { | |
var container = document.createElement('div') | |
for (var i = 0, len = sel.rangeCount; i < len; ++i) { | |
container.appendChild(sel.getRangeAt(i).cloneContents()) |
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
class DdItem extends Component { | |
... | |
} | |
class DdHead extends Component { | |
... | |
} | |
class Dropdown extends Component { | |
render(){ | |
let head, items = []; |
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
import React, {Component} from 'react'; | |
import axios from 'axios'; | |
class UploadFiles extends Component { | |
componentWillMount(){ | |
this.setState({ | |
file: undefined | |
}); | |
} | |
handleSubmit(event){ |
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 | |
add_action('add_attachment', 'my_add_attachment'); | |
function my_add_attachment($attchment_id){ | |
wp_update_post(array('ID' => $attchment_id, 'post_title' => 'something')); | |
} | |
?> |
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 | |
add_action('create_category', 'actplugin_set_catslug', 10, 1); | |
function actplugin_set_catslug($cat_id){ | |
wp_update_term($cat_id, 'category', array( | |
'slug' => 'c'.$cat_id | |
)); | |
} | |
add_action('create_term', 'actplugin_set_tagslug', 10, 3); | |
function actplugin_set_tagslug($term_id, $tt_id, $taxonomy){ | |
if($taxonomy == 'post_tag'){ |
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 | |
$keyword = 'something'; | |
global $wpdb; | |
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_title LIKE '%keyword%'"); | |
foreach($posts as $p){ | |
$id = $p->ID; | |
$title = $p->post_title; | |
$content = $p->post_content; | |
wp_update_post(array( | |
'ID' => $id, |
NewerOlder