View content from uploaded file in editor

Okay.. I’m really losing it here. I’m just gonna extract it all so it might be more clear. In my functions.php: function jj_readcsv($filename, $header=false) { $handle = fopen($filename, “r”); echo ‘<table style=”width:100%;”>’; //display header row if true if ($header) { $csvcontents = fgetcsv($handle); echo ‘<tr>’; foreach ($csvcontents as $headercolumn) { echo “<th>$headercolumn</th>”; } echo ‘</tr>’; … Read more

Disable WYSIWYG rich text editor only on post excerpt

Excerpts can be automatically generated in which case you have some control over them or manually generated in which case there is very little control available, and the wordpress way is that they may have any type of content. if you need something more restrictive you will need to create your own “meta box” for … Read more

How to remove_filter that filters iframes in posts? [duplicate]

This filter does not. This feature is disabled in the visual editor TinyMCE. function wpse49619_change_mce_options($initArray) { $ext=”iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]”; if ( isset( $initArray[‘extended_valid_elements’] ) ) { $initArray[‘extended_valid_elements’] .= ‘,’ . $ext; } else { $initArray[‘extended_valid_elements’] = $ext; } // maybe; set tiny paramter verify_html //$initArray[‘verify_html’] = false; return $initArray; } add_filter(‘tiny_mce_before_init’, ‘wpse49619_change_mce_options’); Also you can use examples … Read more

Theme Advanced Styles in Visual Editor and Paragraphs

If you always want <br/> instead of <p> for newlines you can change the TinyMCE configuration: forced_root_block: false, force_br_newlines: true, force_p_newlines : false, I think you cannot do this based on the context (use <br/> when in class=”box_note”, <p> otherwise), but it is an interesting question for the TinyMCE forum. Shift+Enter is indeed the standard … Read more

data-accordion removed in Visual Editor

Here is an example of How to Update kses and TinyMCE to allow select data-* attributes in WordPress. Reference add_action( ‘after_setup_theme’, ‘x_kses_allow_data_attributes_on_links’ ); function x_kses_allow_data_attributes_on_links() { global $allowedposttags; $tags = array( ‘a’ ); $new_attributes = array( ‘data-foo’ => array(), ‘data-bar’ => array(), ); foreach ( $tags as $tag ) { if ( isset( $allowedposttags[ $tag … Read more

Dynamically textarea with TinyMce editor

Add this function to you JavaScript: function textarea_to_tinymce(id){ if ( typeof( tinyMCE ) == “object” && typeof( tinyMCE.execCommand ) == “function” ) { tinyMCE.execCommand(‘mceAddControl’, false, id); } } then when you create the textarea dynamically call it and pass the textarea’s id to it. Just make sure TinyMCE is loaded on that page before or … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)