Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cómo usar AJAX en WordPress By Rhonalf Martinez
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
WordPress Barranquilla
December 21, 2017
Technology
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cómo usar AJAX en WordPress By Rhonalf Martinez
https://www.meetup.com/es-ES/WordPress-Barranquilla/events/245921270/
WordPress Barranquilla
December 21, 2017
More Decks by WordPress Barranquilla
See All by WordPress Barranquilla
Lead Generation By Jaime Vengoechea
wpbq
0
29
5 cosas que debes saber para convertirte en un desarrollador Web Profesional (5 Things You Need to Know to Becoming a Professional Web Developer) By Fabian Altahona.
wpbq
0
76
Conociendo la API REST de WordPress By Rhonalf Martinez.
wpbq
0
23
Como crear widgets personalizados en el desarrollo de un tema en WordPress By Sergio Orozco
wpbq
0
55
The Art of Typography in the Web Design By Nestor Ramirez
wpbq
0
35
Mi primer theme con kili. Framework By Fabian Altahona
wpbq
0
97
Introducción a Kili. Framework by Fabian Altahona
wpbq
0
120
Métodos de protección legal de tus productos TIC By Javier Cantillo
wpbq
0
120
Como funcionan realmente los Frameworks en WordPress
wpbq
0
66
Other Decks in Technology
See All in Technology
そのPoC、何を検証したつもりでしたか? AIプロダクトの価値検証で陥った落とし穴
techtekt
PRO
0
150
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
7
3.9k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.8k
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
330
Platform engineering for developers, architects & the rest of us (AI agents)
danielbryantuk
0
180
AIを「創る」と「使う」の循環 — HRテックが実践するリアルなAI組織実装
taketo957
0
1.6k
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
350
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
250
10倍の生産性を実現するAI駆動並列エージェントのすべて
kumaiu
3
610
個人の発見を、組織の知恵に 〜生成AI活用を"探索"から"組織の仕組み"へ〜
kintotechdev
2
1k
新アーキテクチャ「TiDB X」解説とDedicated比較 TiDB Cloud Premiumのゲーム運用活用を検証
staffrecruiter
0
110
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
Building the Perfect Custom Keyboard
takai
2
780
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
240
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
WCS-LA-2024
lcolladotor
0
620
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Between Models and Reality
mayunak
4
330
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
The Invisible Side of Design
smashingmag
302
52k
Transcript
#WPBQ
Cómo usar AJAX en WordPress Rhonalf Martinez - Full-stack WordPress
developer @rhonaldomaster
AJAX • Asyncronous Javascript And Xml (javascript asíncrono y xml)
• Es una de las formas para realizar peticiones a un servidor • Nos da la posibilidad de obtener y enviar datos sin recargar la página
Y cómo lo uso en WordPress? • Define la llamada
y la acción en tu tema • Define la función en tu archivo functions.php • Lleva a cabo la accion!
El javascript var request = $.ajax({ url: 'https://ejemplo.com/wp-admin/admin-ajax.php', type: 'get',
data: {nombre: 'Ana'} }); request.done(function (result) { alert(result); }); Mas tradicional: https://jsfiddle.net/v3rfpef2/
El PHP • Aca creamos un hook para manejar la
respuesta • El hook se crea con add_action('wp_ajax_nopriv_ejemplo','mi_funcion') • En caso que se necesite que el usuario esté logueado, el action sera 'wp_ajax_ejemplo' • Si es para ambos, hay que definir los dos
function saludar() { $nombre = $_GET['nombre']; wp_die( "¡Hola $nombre! ¿Como
estas?" );// Puede usarse tambien wp_send_json } add_action( 'wp_ajax_ejemplo', 'saludar' ); add_action( 'wp_ajax_nopriv_ejemplo', 'saludar' );
Algunos link • https://developer.mozilla.org/es/docs/Web/Guide/AJAX/Primeros_Pasos • https://code.tutsplus.com/es/tutorials/improved-ajax-techniques-for-wordpress -object-oriented-programming--cms-24897 • https://ayudawp.com/ajax-con-wordpress-y-jquery/
Gracias :) #WPBQ