pejca
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryI deactivated all the plugins and it’s still not working.
Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryJust reinstalled and deleted the folder via terminal (again) and i clicked on the button: https://ibb.co/bFXkxnW
- This reply was modified 7 months ago by pejca.
Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryI just made it kind of work…
I go to my home page of the website and on the top of the page i see “Collections #Custom Elementor Page Maker” (or something similar). I go to delete the plugin and it says it’s deleted. I go to my FTP terminal and I see the folder is still there so I delete it. I go back to browser and go to my tab where plugin is loaded and still not refreshed(https://ibb.co/8MqvHYQ). For some reason I click on the upload image button and… it works? I refresh the page and obviously it says the page doesn’t exist. Now I upload it again and again it isn’t working.
Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryWell, it looks like it wasn’t ‘some unimportant code’. I added you knew button next to my old button (
<button class="button" id="upload_image_button">Upload Image</button>
) and your does nothing somehow. I changed the theme to default and it’s the same.Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryI tried to replace
wp_enqueue_media()
and it stopped my site from working. Something about fatal error. After I activated my backup from few days ago I try it again and it didnt let me activate the plugin.Plugin could not be activated because it triggered a?fatal error.
So i take it as I wasn’t supposed to do that.
Forum: Developing with WordPress
In reply to: My plugin cant load images in media libaryfunction load_media_files() {
? ? wp_enqueue_media();
}
add_action( 'admin_enqueue_scripts', 'load_media_files' );
function cep_create_menu() {
? ? add_menu_page('Create Collection', 'Create Collection', 'manage_options', 'create-collection', 'cep_create_collection_page');
}
add_action('admin_menu', 'cep_create_menu');
function cep_create_collection_page() {
? ? ?>
? ? <div class="wrap">
? ? ?some unimportant code...
? ? </div>
? ? <?php
? ? if (isset($_POST['submit'])) {
? ? ? ? cep_create_elementor_page($_POST['name'], $_POST['tag_slug'], $_POST['image']);
? ? }
}
function cep_create_elementor_page($name, $tag_slug, $image) {
? ? $page_id = wp_insert_post(array(
? ? ? ? 'post_title' => $name,
? ? ? ? 'post_content' => '[products tag="' . esc_attr($tag_slug) . '"]',
? ? ? ? 'post_status' => 'publish',
? ? ? ? 'post_type' => 'page',
? ? ));
? ? if ($page_id) {
? ? ? ? update_post_meta($page_id, '_elementor_data', json_encode(array(
? ? ? ? ? ? 'version' => '3.0.0',
? ? ? ? ? ? 'elements' => array(
? ? ? ? ? ? ? ? array(
? ? ? ? ? ? ? ? ? ? 'id' => 'image',
? ? ? ? ? ? ? ? ? ? 'elType' => 'widget',
? ? ? ? ? ? ? ? ? ? 'widgetType' => 'image',
? ? ? ? ? ? ? ? ? ? 'settings' => array(
? ? ? ? ? ? ? ? ? ? ? ? 'image' => $image,
? ? ? ? ? ? ? ? ? ? ? ? 'image_size' => 'full',
? ? ? ? ? ? ? ? ? ? ? ? 'width' => '1200',
? ? ? ? ? ? ? ? ? ? ? ? 'height' => '540',
? ? ? ? ? ? ? ? ? ? ),
? ? ? ? ? ? ? ? ),
? ? ? ? ? ? ? ? array(
? ? ? ? ? ? ? ? ? ? 'id' => 'spacer',
? ? ? ? ? ? ? ? ? ? 'elType' => 'widget',
? ? ? ? ? ? ? ? ? ? 'widgetType' => 'spacer',
? ? ? ? ? ? ? ? ? ? 'settings' => array(
? ? ? ? ? ? ? ? ? ? ? ? 'height' => '50',
? ? ? ? ? ? ? ? ? ? ),
? ? ? ? ? ? ? ? ),
? ? ? ? ? ? ),
? ? ? ? )));
? ? }
}
function cep_enqueue_media() {
? ? wp_enqueue_media();
? ? wp_enqueue_script('cep-media-upload', plugin_dir_url(__FILE__) . 'media-upload.js', array('jquery'));
}
add_action('admin_enqueue_scripts', 'cep_enqueue_media');This is almost full php file.
So Im not sure what do i do with
wp_enqueue_media( array $args = array() )
, do i just replace that with already existingwp_enqueue_media()
? (I’m probably being dump right now, sorry)Forum: Developing with WordPress
In reply to: Help me open media library with my plugin.I used diffrent AI tool and it helped me lol
- This reply was modified 7 months ago by pejca.
Forum: Developing with WordPress
In reply to: Help me open media library with my plugin.I know AI isn’t really that great at coding, but I thought it was gonna work because it’s nothing complicated. Anyways, I’ve tried to look for the errors, but there are none. I went to browser console and there were 4 errors (before I clicked it) and when I click nothing changes.
Forum: Fixing WordPress
In reply to: Search page makes my images scuffedHere is the website if you need more details because i don’t quite understand you https://37.220.78.72:65400/
This only happens on search page. Every other page where there are products shown, its normal.
I didn’t change themes from the creation of the website. I downloaded the plugin you suggested and it didn’t help.
Thanks for answer anyway!
Forum: Fixing WordPress
In reply to: Recover lost passwordI’m currently away from home so I’ll try when I get home but are you sure I can do that cuz there is no user interface on my linux server?
Forum: Fixing WordPress
In reply to: Elementor not loading, 23 errors?Thanks!