run second instance of a WordPress plugin? - wordpress

There is this (Business Directory Plugin),
The question is, is it possible to run a second instance of this plugin to run another type of directory in same WordPress installation (not multi-site)?
Tried to bulk rename classes and hooks..etc, but no luck.
Is there a plugin that support this behavior or some hint?
It was possible to reach one post stating it could be possible for a different plugin.
Any help appreciated ,
Thank you.
Update:
Just to clarify the point of the question/solution:
I want to run multiple directory in my WordPress Installation
One for Medicine Directory
The other for Medicine Agents/Marketers Directory
Each directory has its own fields and content
Anyhow, I found the solution bellow
Thanks for all help

Probably not if they're using post types and taxonomies that are regiatered through the plugin. You could probably extend the plugin functionality and create your own post type.

I managed to find the solution and it worked like charm without any errors!!!!
I used notepad++ to search all files and did a bulk replace classes and main plugin's keywords (custom type and meta slugs' names and all possible duplicates ) into 2nd instance names.
I uploaded the plugin into WordPress single installation and it was activated successfully and I was able to add new custom posts and new custom meta data...
Here is a screenshot of second instance of my plugin.....its is possible to do it and it worked like charm!!!
Back end First and Second Instance
Back end
Front End First Instance
Front End Second Instance
After I figure it out , it took from me 10 min to run another instance of the plugin
Thank you
Update:
I was even able to link between the two instance entries
Off course I had also to create another instance of the Shortcode!

Related

What happens with WordPress after I activate a plugin

I would like to know what happens when I click on activate on a WordPress-Plugin on "Activate". Which files and functions get Triggered by WordPress.
How I actually think WordPress is working are these steps:
A file and function from WordPress is in a loop which gets triggered like this:
WordPress gets from the main-file the Header-fields and calls a file(which?) with the functions and defines it to the public output with echo or return.
WordPress calls the activation_function. When the user has not defined it then it does nothing.
The main file runs now like each other program.
While the program runs, WordPress has a file/function which gets triggered on "plugin->deactivate" and a function which will look similarly:"
(I am a type of human who likes to play compiler)
(I add a picture because I got only: "Your post appears to contain code that is not properly formatted as code" and could not solve like 10 minutes.)
This "Your post appears to contain code that is not properly formatted as code" is driving me crazy. I had to delete a few things.
I have looked on pages like these but no one goes so deep inside:
https://developer.wordpress.org/plugins/plugin-basics/
I appreciate you are thinking this way.
But before you get any answer to this, may i ask why you are asking this?
Meaning, what you want to understand? Is there any specific thing you want to achieve at plugin activation?
There is not much WordPress does while activating plugin.
WordPress scans each file or top level directory inside plugin directory and looks for header comment
See for more details: https://developer.wordpress.org/plugins/plugin-basics/#getting-started
Once it recognizes a plugin, it offers to activate it.
Here is a ruff sketch what happens once you click activate:
WordPress runs any callback function that is bound with register_activation_hook. Its not required to have an activation hook. If you have a callback function, WordPress runs it, if not, WordPress does not do anything. This callback function is used by plugins to do all sort of stuff like creating default options, creating required database tables, checking for dependent plugins , WordPress and PHP required version compatibility to name a few.
WordPress updates an option in DB to keep track of active plugins. so that these can be loaded for each page call. option id is active_plugins. Screenshot: https://snipboard.io/e7sjB9.jpg
On Next page load, WordPress check this option active_plugins and looks for these active plugins and load/run their header comments file code.
Hope it helps.
Regards,
Rao
P.S. this question belongs to https://wordpress.stackexchange.com/

Why is my Wordpress plugin trying to update as someone else's?

I'm writing a plugin, based on someone else's tutorial.. I've been changing parts of it as I'm building it, such as the name, names of functions and so forth. The basics of the plugin work as expected, and it shows up in the plugin manager UI. However, when I activate it, it shows my custom metadata (plugin name, version, etc), but it INCORRECTLY displays and "Update this plugin" message of someone else's plugin. Now this plugin appears not to be related to the tutorial maker (which was my first suspicion).. it seems not to be directly related to the plugin name, folder name, or filenames.. but I really can't seem to control it – other than remove the whole metadata section, which seems illogical.
What is linking my plugin to someone else's plugin, or otherwise causing it to wrongly identify?
Thanks in advance
The plugin section gathers info from their online repo, so if you have named it to something that's already there, it will pull through that data.
Just give it a unique name:
/*
Plugin Name: My Unique Plugin
*/

WordPress: Web Form with Image/File Submission

First of all, I am absolutely new to WP.
I am hoping to build a site using WP and figured out how to manage every thing except one feature. The feature that is required is to be able to submit a form with files (images in particular) by a non member.
For example, you should be able to visit the site and fill a form and submit your image along it.
Is it possible to upload files as above? How is this achievable?
Thanks in advance.
If you are not a wordpress coder , I would sugest you use a plugin for that .
Some options :
http://wordpress.org/extend/plugins/user-submitted-posts/
http://wordpress.org/extend/plugins/tdo-mini-forms/
http://wordpress.org/extend/plugins/quick-post-widget/
http://www.gravityforms.com/category/features/
and many more ..
read also this tutorial : http://wp.tutsplus.com/tutorials/allow-users-to-submit-images-your-site/ - it is not for VISITORS but for registered users - but it might help you to understand what is needed to be done .
I would use the Contact Form 7 plugin to do this, as it's extremely easy.
In the plugin settings you'll be able to choose what parts of the form you'd like to include, adding a way to upload is one of those options. You can even limit the type of file that is being used as well the max file size.
Once you create a form in the settings, you just use its shortcode to add it to your Wordpress page.
Yes you can upload file, but it is not a Wordpress specific solution, unless you want to use a plugin. You can code html/php as per usual to achieve it:
http://www.w3schools.com/php/php_file_upload.asp
To embed it on a page, you can create a Page in Wordpress, and assign it a custom page template that you create with the upload form:
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

WordPress Plugin Development Idea? Is this possible? Am I on the right track?

I'm very new to WP development. I host a website which needs a list of trails (hiking, biking, etc) and I'd like to write a WordPress plugin to do it.
Can someone please tell me if I'm taking the right approach, and if what I'm proposing is possible.
I'd like the site to end up with an auto-generated and filtered index at http://example.com/trail-guide, and the discrete trail info pages at http://example.com/trail-guide/trailname. This data would all be stored in a single database table holding info for each trail, with an admin page for adding, editing, and deleting entries from here.
Is a WP plugin the best way to go about doing this, or should I be looking at something else?
From the way you're describing, your best bet would be to Register A Custom Post Type. This can be done by adding to your existing theme's Functions.php file, or by creating a plugin.
If you don't plan on changing themes, my advice would be to just hardcode everything into your functions.php file. Otherwise, creating a plugin for this particular job would be the safest alternative.
Using this functionality in tandem with Custom Meta Boxes and Custom Taxonomies will allow you to keep everything organized within the Wordpress Framework with your own special data.
This means that these new posts can also be queried at any time through the standard Wordpress Loop or search box.
If you are uncomfortable with writing your own functions to extend your existing framework, you might want to look into some plugins like GD Custom Posts And Taxonomies Tools to manage your own.
Hope this helps.

Live Sorting by Custom Field in Wordpress

Im working on a wordpress powered website for a client that involves a directory of local offices. Part of their requirement is that live sorting be implemented via drop downs, so when someone selects X Office in X Area, the page dynamically loads the relevant results.
I currently have a custom post type set-up called "listing", which lists all the relevant information for that office. I then display each of those fields via the Loop.
In a perfect world, a plugin would exist that would perform the above, but I've yet to find one. The closest I've come is The custom category sorting over at Digging into Wordpress.
Any suggestions on a "easy" solution that would allow me to sort "listings" with multiple attributes?
please use the wp-smart-sort plugin for that.
With the help of this plugin you can also sort the custom field
If there is any issue after the use of this plugin then let me know
thanks

Resources