When we call get_the_title()
, then the post title is taken through the wptexturize()
function via the the_title
filter:
add_filter( 'the_title', 'wptexturize' );
The en-dash and em-dash are replaced with
/* translators: en dash */
$en_dash = _x( '–', 'en dash' );
/* translators: em dash */
$em_dash = _x( '—', 'em dash' );
A simple workaround to keep the en/em dashes when you store it to your custom table, could be:
$site_post_title = str_replace(
[ '–', '—' ],
[ '–', '—' ],
get_the_title()
);
or just use the raw $post->post_title
if that’s makes more sense for your setup.
Related Posts:
- How do you properly prepare a %LIKE% SQL statement?
- $wpdb and MySQL Create Trigger
- wpdb->prepare function remove single quote for %s in SQL statment
- Alternative to mysql_real_escape_string
- Increment value (value = value+1) of $wpdb->update
- wpdb Custom Meta Data with 2 conditions
- wpdb prepare syntax
- SQL query not working in alphabetical post title/content search
- MySQL LIKE not working
- Proper way to work with wpdb to get user’s firstname
- How to check for empty and not a failure
- Database: Custom table: sprintf value for DateTime column
- Converting mysql to $wpdb
- WP_USE_EXT_MYSQL
- wpdb insert and boolean fields
- Join new table with SQL query
- writing inner join in wpdb
- How to split the a table in database?
- MySQL Rank & $wpdb
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- How do I get create a custom table showing the hours remaining for all customers in one page from this transactions page?
- How do I join a $wpdb query with user meta using default value if not exist?
- How to translate this mySQL query to $wpdb query
- $wpdb select all meta for each post
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- WordPress(wpdb class) and mysql stored procedures
- Can’t run database query
- Using WPDB->Insert()
- Active DB queries in WordPress?
- How to stop $wpdb from prepending database name
- WordPress $wpdb get posts from category and sort by custom meta
- How to get INSERT errors from $wpdb?
- Getting Error Trying to Create Table
- How to set MYSQLI_OPT_INT_AND_FLOAT_NATIVE option
- Editing mysql tables/database with wordpress or other app/cms
- Understanding custom php that reads from WP MYSQL
- $wpdb->get_var multiple queries in one database check
- List users with the most posts in the last 30 days
- Insert two row in wordpress database
- WordPress $wpdb no result
- PHP variables in mysql query
- MySQL ‘duplicate entry’ error
- User set date and time from frontend doesn’t get stored into database
- Wpdb query with dynamic table name
- get posts whether meta_key exists or not
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- What is my error trying to create a new table in the database?
- How to search usermeta table
- How to add virtual column in wpdb get_result statement
- wpdb insert into point column in db
- WPDB delivers wrong results from complex queries
- $wpdb post type and term query only works when there are no dashes or spaces in the term slug and title
- CONCAT_WS in custom sql query
- Geographical proximity query using post_meta
- MySQL Select within WP Page template
- Saving custom term value to the database in new table
- why is $wpdb->update() causing a DB error from within wp_set_password()
- $wpdb->get_var returns 0
- Initialization of table in database using ‘CREATE … IF NOT EXISTS’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (38)
- ERROR 1698 (28000): Access denied for user ‘root’@’localhost’
- Getting “Lock wait timeout exceeded; try restarting transaction” even though I’m not using a transaction
- Search for all occurrences of a string in a mysql database
- How to update a record using sequelize for node?
- Can’t open the mysql.plugin table. Please run mysql_upgrade to create it
- MySql: is it possible to ‘SUM IF’ or to ‘COUNT IF’?
- MySQL Select Multiple VALUES
- MySQL Error #1071 – Specified key was too long; max key length is 767 bytes
- How To have Dynamic SQL in MySQL Stored Procedure
- What SQL Query to do a simple find and replace
- Scanning Database for malicious Data
- Is it useful to turn on MySQL query cache for performance
- How To Make Connection To WordPress Data Base In A Plugin?
- Programmatically changing role information; editing role name and deleting
- Search and replace in post content
- How to add 2 hours to the wordpress time formed with current_time(“mysql”, false)?
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Mysql SELECT posts
- How to add a private user page populated from sql?
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- Create new database through static page code
- Run Username SQL Query from WordPress Child Theme Functions File
- SQL syntax error. However, it works normally at phpmyadmin
- Get decimal from product price with Mysql
- string literals in query
- Calling mysql_query() on another database, assumes WordPress using that database
- querying user bookmarks from a large number of bookmarks
- How do I echo all users’ display_name and their meta_value who have a certain meta_key?
- How to edit custom table data in frontend
- How to simulate web traffic to test performance of a website
- Remove escape characters from JSON string pulled from a database
- SQL. Select category descendants
- Why is local wordpress install calling live site executions?
- Migration of wordpress database from mariadb 10.0.20 to 5.5.50
- Internal error (500) on local & Fatal error on live when trying to access post type edit screen
- SQL get last entry of a specific gravity form
- mysqldump to a tar.gz