Restrict file uploads by extension?

Is there a way in WordPress 3.1 to restrict allowed file uploads by extension (images only) and file size? Bonus question: Can I limit users to only be able view files they have uploaded themselves? 1 Answer 1 I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes … Read more

How to remove these comments and html tags from the content?

These are actually input fields. paragraph is the textarea field. i query the contents from database and try to show them in this textarea field. But the textarea field is showing me unwanted comments and tags. When I echo them outtside the textarea field, it is fine. My code…. <?php while($userNotes->have_posts()): $userNotes->the_post(); ?> <li> <input … Read more

How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?

[*] Starting with version 5 the HTML standard allows <a> tags wrap block-level elements. On a specific page I need to wrap a heading and an image with an <a> tag: Some intro text. <div> <a href=”http://somewhere/”> <h4>Some heading</h4> <img src=”http://somewhere/some-img.jpg” alt=”Some image” /> </a> </div> While I can enter this in the text editor … Read more

How to make a customized “Create Gallery” tab in the ‘Add Media’ window?

I’m developing a plug-in and wanting to make a customized version of the the “Create Gallery” tab of WP v4.0, but have the resulting output (i.e. what gets inserted into the TinyMCE editor) to be different. The user would click “Add Media”, then “Create Media Gallery” on the left, then pick any files (not just … Read more

Added custom styles to Visual Editor. Classes are appended and not replaced as intended

Followed several tutorials and have added custom classes in the formats section of the visual editor. The classes used are being appended and not replaced as I had intended. Is there a way to have them overwrite the existing style if there is one instead of adding to the class tag? My use case is … Read more

TinyMce in WordPress – Getting the “fullscreen” button to stay on the right when customising button layout

I’m using TinyMce inside WordPress and I have customised the button layout like so: add_filter( ‘tiny_mce_before_init’, ‘blm_format_tiny_mce’ ); add_filter( ‘mce_buttons’, ‘blm_extended_editor_mce_buttons’, 0 ); add_filter( ‘mce_buttons_2’, ‘blm_extended_editor_mce_buttons_2’, 0 ); function blm_format_tiny_mce( $in ) { $in[‘remove_linebreaks’] = true; $in[‘convert_newlines_to_brs’] = false; $in[‘keep_styles’] = true; $in[‘tabfocus_elements’] = ‘publish’; $in[‘paste_remove_styles’] = false; $in[‘paste_remove_spans’] = true; $in[‘paste_strip_class_attributes’] = ‘mso’; $in[‘paste_text_linebreaktype’] … Read more

WMP Plugin not showing up in the plugin panel?

I just downloaded the WMD Editor plugin. For some reason is not showing up in the Plugins menu. the folder is called wmd-editor/ wmd-editor.php: <?php /* Plugin Name: WMD Editor Plugin URI: http://c.hadcoleman.com/wordpress/wmd-editor Description: Adds the <a href=”http://wmd-editor.com/”>WMD Editor</a> to the comment field, to make life easier for your commenters. Version: 1.0 Author: Chad Coleman … Read more