Media Manager 3.5 custom options

I got the solution. I used the following script: WordPress Media Manager 3.5 – default link to and altered it to my needs with this modification: (function() { var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay; wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({ render: function() { _AttachmentDisplay.prototype.render.apply(this, arguments); this.$el.find(‘select.link-to’).val(‘none’); this.model.set(‘link’, ‘none’); this.updateLinkTo(); this.$el.find(‘select.link-to’).parent(‘label’).hide(); this.$el.find(‘select.size option[value=full]’).hide(); this.model.set(‘size’, ‘medium’); this.updateLinkTo(); } }); })();

Change the default-view of Media Library in 3.5?

There were two minor mistakes in my previous answer: I forgot to trigger the change event for the parent. I called the function on every AJAX call, making other selections impossible. Here is the fixed code: <?php /** * Plugin Name: Pre-select post specific attachments */ add_action( ‘admin_footer-post-new.php’, ‘wpse_76048_script’ ); add_action( ‘admin_footer-post.php’, ‘wpse_76048_script’ ); function … Read more

How to retrieve images contained in a post

I’m guessing you’ll need to fetch the post content and parse it using something like this as a guide (pasted code from above link for future reference). // Get the all post content in a variable $posttext = $post->post_content; $posttext1 = $post->post_content; // search for the src=”” in the post content $regular_expression = ‘~src=”[^”]*”~’; $regular_expression1 … Read more

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