Tag Info

New answers tagged

4

First of all, the prefix is only a configuration option and not a security feature. The reason is that once an attacker has access to your database, he can find out any exisiting table prefix within seconds. There's no way this obscurity protects you from any attack. For the prefix itself, WordPress asks you to use only digits, letters (here only basic ...


1

In many cases, you may use the following filter to disable local ssl verification. This is useful for self-signed certificates errors. add_filter('https_local_ssl_verify', '__return_false'); The current version v4.3.0 determins if a request is "local" with the following, in wp-includes/class-http.php // Determine if this request is to OUR install of ...


0

I ended up appending a string to the iframe break: top.location = self.location.href + "&noframe=1"; Then checking for it. if(isset($_GET['noframe']) && $_GET['noframe'] == 1) Then I insert into the database.


0

So I solve my problem by configuring the all content by default. However I did the same on another example and I came alive with zero configuration to be done, I still don't understand. The Answers a) There is no inconsistency with regard to versions used in place over the remote at that time; b) The use of Plugins did cause the behavior, but technically ...


0

Data Insertion It's actually that easy, please follow the following procedures using wp_insert_post(): (Please note that, I assumed you've already registered a Custom Post Type called cars to store car information) <?php //checking whether the form is submitted and the nonce is verified if( isset( $_POST['x_submit'] ) && isset( ...


1

Quite a few options you have here but the simplest I suppose would be to change your SQL query like so: SELECT 0 AS id, user_login AS name, display_name AS tag, user_status AS status FROM wp_users; You can see that now we have the needed order and when you will do the $row['id'] = $i; assignment we will use that position instead of creating a ...


0

There is no post_name argument for WP_Query, if you're querying by slug, it's just name. Without that argument, your query just gets the latest post back.


2

You're inserting raw POST data straight into an SQL query - sanitize, sanitize, sanitize! The code below should get you started, but I would advise you add some additional checks (is the email valid? are the strings too long? etc.): <?php $errors = $values = array(); if ( isset( $_POST['Submit'] ) ) { $fields = array( 'firstNametxt', ...


1

It looks like you are trying to insert the data before the form is submitted. Your code above had two forms, one for input and one with PHP. You need to check whether the form has been submitted then action the PHP code or if not display the form. $submitted_form = $_POST['submit']; if(isset($submitted_form)) { //process and validate, then insert } ...


0

In your query, you'll see: AND .ID IN (SELECT 'post_id' FROM 'lat_lng_post' WHERE (. The actual posts table name is missing from the query. The problem is you are missing the $ from your declaration of wpdb. global $wpdb.


0

Not sure about DB connection but there seems some syntax issue. lat and lng have been used unlike PHP variables at some places in your code. I believe, they should have been $lat and $lng respectively instead.


0

First, this line if ( 'location' != $_POST['festival-event'] ) should be if ( 'festival-event' != $_POST['post_type'] )


0

1) In order to check what kind of prefix used by current installantion you can goto wp-config.php in a root directory and find line with $table_prefix = 'PREFIX_HERE'; variable 2) Backup the DB before making any action! 3) Additionally check if other tables with different prefixes/name_patters are not used by badly-written 3rd party plugins. They may not ...


0

There is a plugin that regenerates the urls for post/pages/attachments! You can also go to permalinks and select 'default' or custom structure using post id. This hack is only for pages/post not attachments.


0

$location = $_SERVER[‘DOCUMENT_ROOT’]; include ( $location . '/wp-config.php' ); include ( $location . '/wp-load.php' ); global $wpdb; $contactus_table = $wpdb->prefix."user"; if( isset( $_POST['submit'] ) ) { $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $message=$_POST['message']; $sql = "INSERT INTO ...


0

For others who, like me, found this answer. It's possible to store the login information for the second DB as plugin options via WP settings API. sot the actual login information is not in the plugin but in the WP database.


0

Yes You can do it. You use two different prefixes for both sites in database.


-1

ACP > Tools > Export. This will export all post types, comments, etc. Just go to ACP > Tools > Import and it will do the rest. You may have to install the plugin to get it to work but it should guide you quite easily.


0

Are you sure it isn't saving the values to the DB? Perhaps it's just not displaying the previously saved values in your form? $values = get_post_custom( $post->ID ); This is what you are using to get your meta - but this returns a multi-dimensional array. Therefore when accessing your beef_meta_box_price value, you need to use ...


0

Some things to check: Have you update the site URL in the wp_options table? Once you log-in to wp-admin change the permalink structure and click save - this makes the system refresh all the links. I personally always use MySQL Workbench to Export and Import data for MySQL databases as it makes life much easier.


0

Sounds like you are trying hard to shot yourself and you will likely succeed. Every framework has its own assumptions and limitation so if the assumptions of wordpress do not fit your needs then just don't use wordpress for the project. If you (ok, probably the client) have decided that for reasons of cost, delivery time and maintainability wordpress ...


0

You can run this MySQL query to empty post content. UPDATE wp_posts SET post_content=''; make sure you have a backup before you run this query, in case you need it later. Also make sure that your MySQL table prefix is wp_. Another Method. You can also use WP_Query custom query to remove post content. $args = array( 'post_type' => array( 'post', ...


0

In your code, if an email is set and validated (which I suppose should be the normal case), your code will exit at wp_die(), and never reaches the $wpdb->insert. Your $wpdb->insert statement will only ever be reached if an email is not set, or if "validation" is false. You might want to get rid of the wp_die() call altogether, or place that call at the ...


4

If you don't feel any performance degradation then there is no problem. If it took you two years to get to this state then you probably safe for another two years, which is almost forever in the time scale of the internet (unless you are CNN or similar). This doesn't mean that you should not try and save space wherever it is easy to do. Do you really need ...


1

You need to create wp-config.php file. This new file is copy of wp-config-sample.php find it in root directory. After creating this copy name it wp-config.php and set up database setting into it. Also give access permission to it. Let me know if above wording is not used to for you.


1

Create a new file names wp-config.php and paste all the code than enter your db credentials it will solve your wp-config issue. <?php /** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information * by visiting ...


0

You can also use this wordpress plugin: https://wordpress.org/plugins/androapp/ this indeed usage JSON API Plugin as suggested by TopSiteMaker earlier. It also has in-built support for monetization, push notifications, image sharing in built. It currently provides android app only though, do give it a try


1

can I just create one using PHPMYADMIN ? Yes.You can. And its a shortest way to do it.


1

I didn't do this recently but in 2014, in a few WordPress projects that I need additional tables I used Laravel components. In WordPress, if you want to create your own tables by using wpdb and mysql queries. But with the Laravel database classes I managed to do this much more elegantly. A quick rundown how I do this: (note: At the time, I used Laravel 4 ...


2

When I started out with Wordpress I was anti-plugin. I wanted to add everything in my theme's functions.php. When I looked at the bigger picture it began making sense having and leaving some functionalities inside a plugin. There are many write-ups on the subject of what should go into a plugin and what should go into a theme. I, for one, have done one or ...


1

As the codex says, it is legacy with probably no use in any modern version. I have been around wordpress since 2.0.4 and I don't remember it being used or referenced so my guess is that it is a really old legacy thing.


0

I suggest for you some ideas : Before run functions from you make, you register table database store ( Example WP_IP and WP_UTM ) After create 2 table that, you run function of you You need read on Codex some resource on WP working with parameters : https://codex.wordpress.org/Class_Reference/wpdb https://codex.wordpress.org/Creating_Tables_with_Plugins


0

For me it was permissions of the DB user and the DB. They were too strict, once I gave the user ALL privileges, I was able to get passed the loop. Either fix the user permissions of your SQL user, or use root if you have access to that SQL user.



Top 50 recent answers are included